1 / 52

Advanced Programming

Università di Pisa. Advanced Programming. Giuseppe Attardi Dipartimento di Informatica Università di Pisa. Language is an instrument of human reason, not merely a medium for the expression of thought. G. Boole, An Investigation of the Laws of Thought, 1854. Instructor and Assistant.

msorrells
Download Presentation

Advanced Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Università di Pisa Advanced Programming Giuseppe Attardi Dipartimento di Informatica Università di Pisa

  2. Language is an instrument of human reason,not merely a medium for the expression of thought.G. Boole, An Investigation of the Laws of Thought, 1854

  3. Instructor and Assistant Giuseppe Attardi Office: 292 Mail: attardi@di.unipi.it TBD

  4. Recurring questions • To teach or not to teach programming? • How to teach programming? • Programming is not just programming languages

  5. Software Everywhere • Software can be the key to delivering new product offerings and driving continuous product innovation • Software role: • Product innovation • Process flexibility • Process enforcement for quality assurance and matching demands

  6. Software Innovation

  7. Software as Competitive Advantage Most Admired Companies Making IT A Competitive Advantage (Forbes) JP Morgan Chase Kaiser Permanente Mayo Clinic Microsoft Nestle Procter & Gamble Progressive Insurance Schlumberger Target Toyota Wells Fargo • Accenture • Amazon • Apple • Cleveland Clinic • General Electric • Goldman Sachs • Google • Hospital Corporation of America • IBM • Intermountain Healthcare

  8. Introduction • Programming in the 21 century • Software as complex as ever • Command line interface not enough • Data comes from multiple sources: structured (DB) and unstructured • Single computer not enough • Software development is a group activity • Deployment on Web or mobile devices

  9. Requirements • Cannot start from scratch • Reusable components are needed • OS + libraries not enough

  10. Elements of a Solution • Software Framework • Component Model • Execution Environment

  11. More Complex Software • Object-Oriented Programming allows ever larger applications to be built • Require increased high-level application and system oversight • Multi-tier applications development increases the choices on how to build applications • A new Software Architect Role is needed

  12. Software Architect Duties • Creating, defining or choosing an application framework • Creating the component design • Structure a complex application into pieces • Understand the interactions and dependencies among components • Select the platform based on cost/performance criteria • Organize and supervise the “construction site”

  13. Application Framework • A software framework used to implement the standard structure of an application for a specific development environment

  14. Software Framework • A collection of common code providing generic functionality that can be selectively overridden or specialized by user code providing specific functionality • Frameworks, like software libraries, provide reusable abstractions of code wrapped in a well-defined API

  15. Framework Features • Inversion of control • unlike in libraries, the overall program's flow of control is not dictated by the caller, but by the framework • Hollywood Principle: Don’t call us, we’ll call you • Default behavior • Extensibility: usually by selective overriding • Non-modifiable framework code

  16. OO Software Framework • Object-oriented programming frameworks consists in a set of abstract classes • An application can be built simply inheriting from pre-existing classes in the framework • Instantiation of a framework consists of composing and subclassing the existing classes

  17. Examples of Frameworks • GUI • MFC • Gnome • Qt • General • Android • Spring • Cocoa • Web • ASP.Net • GWT • Rails • Concurrence • Hadoop Map/Reduce

  18. Class Hierarchy (NextSTEP 1988)

  19. Cocoa (2013)

  20. Benefits of Frameworks • Drives solution • Dictates how to fill-in-the-blanks • Helps solving recurring problems • Designed for reuse • High value, since reduces cost of development

  21. Framework Design • Intellectual Challenging Task • Requires a deep understanding of the problem domain • Requires mastering of software patterns, OO methods and polymorphism in particular

  22. Design Pattern • More abstract than frameworks • Frameworks can be embodied in code, but only examples of patterns can be embodied in code • Design patterns explain the intent, trade-offs, and consequences of a design • Smaller architectural elements than frameworks • A typical framework contains several design patterns but the reverse is never true. • Less specialized than frameworks • Frameworks always have a particular application domain • Design patterns can be used in nearly any kind of application

  23. Examples • Visitor • Publish/Subscribe • Factory • Dependency Injection • Chain of Responsibility • Observer • Iterator • Decorator

  24. Dependency Injection • Allows avoiding hard-coded dependencies and changing them • Allows selection among multiple implementations of a given dependency interface at run time • Examples: • load plugins dynamically • replace mock objects in test environments vs. real objects in production environments

  25. Dependency Injection public class Client { // Internal reference to the service used by this client     private Service service;     Client() { // Fixed implementation         service = new ServiceExample();     } Client(Service service) { // injection of a specific service     this.service = service; } // Method within this client that uses the service     public String greet() {         return "Hello " + service.getName();     } }

  26. Course Objectives • Understand programming language technology: • Execution Models • Run-time • Analyze programming metaphors: • Objects • Components • Patterns • Learn advanced programming techniques • Understand their limits ad how to overcome them

  27. Course Objectives • Explain how high level programming concepts and metaphors map into executable systems and which are their costs and limitations • Acquaint with modern principles, techniques, and best practices of advanced software construction • Introduce techniques of programming at higher abstraction levels, in particular generative programming, component programming and web computing • Present state-of-the-art frameworks incorporating these techniques

  28. Syllabus

  29. Programming Language Foundations • Syntax, Parsing, Abstract Syntax Tree, Parser Generators • Names, Scope, Binding • Parameter Passing • Static and Dynamic Allocaltion: Stack, Heap • Types, Inheritance, Polymorphism, Overloading • Delegates, Closures • Exception Handling

  30. Run-time Systems • Virtual Execution Environment • Memory Management • Thread Management • Exception Handling • Security • Debugging Support • AOT and JIT Compilation • Dynamic Link/Load • Reflection • Verification • Language Interoperability

  31. Advanced Techniques • Generic Programming • C++ templates • C# Generics • Java Generics • Generative Programming • Metaprogramming • Reflection • Template • Aspect Oriented Programming • Generators

  32. Interoperability • Process level: interprocess communication • Language level: CORBA/IDL • Object level: DCOM

  33. Component Based Programming • COM • JavaBeans • .NET (Assembly, Reflection, Interfaces, Attributes) • OSGi

  34. Web Programming • Web Services, SOA • Web Frameworks • Web 2.0

  35. Web Services • XML, XML-Schema • SOAP, RPC, Rest • WSDL • UDDI

  36. Web Frameworks and Applications • Asp.Net • J2EE • JQuery • AJAX: XHR, jQuery, YUI, GWT • Node.js • React

  37. Service Components • Service Oriented Architecture • Microservices • Flow Based Programming

  38. Scaling • Map/Reduce • CUDA Programming

  39. Web Application Frameworks • Architectures • Principles: • Inversion of control • Features • Templates • Database access and mapping • Scaffolding • Ajax • Web Services • Examples: • Symfony • Laravel

  40. Scripting Languages • Perl • Python • JavaScript • PHP • Ruby

  41. IEEE Spectrum Ranking 2015-2014

  42. IEEE Spectrum Ranking 2016-2015

  43. CodEval Chart

  44. Top 10 Frameworks

  45. Top 10 Web Application Frameworks • Ruby on Rails • AngularJS • Ember.js • CakePHP • Phalcon • Zend • ASP.net • Symfony • Express • Codeigniter

  46. Text Books Programming Language Pragmatics, third ed.. Michael L. Scott, Morgan-Kaufmann, 2009. Software Components: Beyond Object-Oriented Programming. C. Szyperski, D. Gruntz, S. Murer, Addison-Wesley, 2002.

  47. Additional Reading Generative Programming: Methods, Tools, and Applications. K. Czarnecki, U. Eisenecker, Addison-Wesley, 2000. Object Thinking. D. West, Microsoft Press, 2004. jQuery in Action. B. Bibeault, Y. Katz, Manning, 2010.

  48. Assessment • Mid Term Paper: half way, one week homework • Term Paper: at the end of the course, 20 days homework

More Related