1 / 25

Towards a Practical Composition Language

Towards a Practical Composition Language. Oscar Nierstrasz Software Composition Group University of Bern. Roadmap. The problem: Software Evolution What about OOP? Components? … Approach: understanding composition Piccola — a small composition language Where are we? Where do we go?

Download Presentation

Towards a Practical Composition Language

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. Towards a PracticalComposition Language Oscar Nierstrasz Software Composition Group University of Bern

  2. Roadmap • The problem: Software Evolution • What about OOP? Components? … • Approach: understanding composition • Piccola — a small composition language • Where are we? Where do we go? • Evaluation; research agenda FMCO, Leiden, 2002-11-07

  3. 1. Thesis — Focus on Software Evolution Software evolution is the key problem in software development Not purely a technical issue • Lehman’s Laws • What’s wrong with OOP? • What’s wrong with Components? FMCO, Leiden, 2002-11-07

  4. Lehman’s Laws Continuing change • A program that is used in a real-world environment must change, or become progressively less useful in that environment. Increasing complexity • As a program evolves, it becomes more complex, and extra resources are needed to preserve and simplify its structure. • Lehman and Belady, 1985 FMCO, Leiden, 2002-11-07

  5. The Myth of Software Maintenance Between 50% and 75% of global effort is spent on “maintenance”! (= “continuous development 17.4% Corrective (fixing reported errors) 60.3% Perfective (new functionality) 18.2% Adaptive (new platforms or OS) • Lientz, 78 4.1% Other FMCO, Leiden, 2002-11-07

  6. What’s wrong with OOP? (I) OOA and OOD are domain driven • Designs are based on domain objects, not available components • Objects end up with rich interfaces, not plugs • Hard to reconfigure and adapt objects FMCO, Leiden, 2002-11-07

  7. What’s wrong with OOP? (II) Implicit Architecture • Source code exposes class hierarchy, not run-time architecture! • Objects are wired, not plugged together • How the objects are wired is distributed amongst the objects • Hard to understand and hard to evolve FMCO, Leiden, 2002-11-07

  8. What’s wrong with OOP? (III) Implicit Reuse Contracts • Idioms and patterns are hidden in the code • Hard to learn frameworks and conventions FMCO, Leiden, 2002-11-07

  9. What about Components? stable ^ A software component is a unit of independent deployment without state • We know how to build components! • We don’t understand how to compose flexible applications from components. • We should be thinking more about composition than about components. FMCO, Leiden, 2002-11-07

  10. 2. Composition A composition language would support flexible, high-level composition of applications from components according to various styles. • Applications = Components + Scripts • Piccola: A Small Composition Language • Forms + Agents + Channels • Styles as Component Algebras FMCO, Leiden, 2002-11-07

  11. Applications = Components + Scripts Components both export and import services Scriptsplug components together FMCO, Leiden, 2002-11-07

  12. Towards a Composition Language Scripting languages Configure applications from components ADLs Specify compositional styles Coordination languages Configure applications from distributed services Glue languages Adapt components to new contexts FMCO, Leiden, 2002-11-07

  13. Piccola — A Small Composition Language Piccola agents compose and coordinate external components FMCO, Leiden, 2002-11-07

  14. Piccola Layers FMCO, Leiden, 2002-11-07

  15. Forms + Agents + Channels Forms embody structure • immutable, extensible records • they unify components, services and namespaces Agents embody behaviour • concurrently executing scripts • they unify concurrency and composition Channels embody state • mailboxes for communicating agents • unify synchronization and communication. FMCO, Leiden, 2002-11-07

  16. Piccola in a Nutshell A form consists of a sequence of bindings: helloForm = # a form Label = "hello world" # a binding do: println Label # a service A script composes components by invoking services makeFrame Title = "Demo” makeButton(helloForm) ? Action(helloForm) High-level connectors hide details of object wiring. FMCO, Leiden, 2002-11-07

  17. Hello World FMCO, Leiden, 2002-11-07

  18. Component Algebras A style can be viewed as a many-sorted algebra: • connectors as operators over components: source | filter is also a source • contrast the procedural view: a.in() -- b.out() doesn’t yield a new component ... FMCO, Leiden, 2002-11-07

  19. Some Piccola Styles Many frameworks can be expressed as component algebras • Pipes and filters (both push & pull flow) • GUI composition • Event listeners • Actor groups • Regulated coordination (law-governed interaction) • Mixin layer composition FMCO, Leiden, 2002-11-07

  20. 3. Where are we? Where do we go? What would be a practical composition language? • How explicit namespaces support composition • Results and shortcomings • The future FMCO, Leiden, 2002-11-07

  21. How forms support composition FMCO, Leiden, 2002-11-07

  22. Results so far • Piccola implementations for Java and Squeak • Sophisticated language bridging • Partial evaluation • Various experimental composition styles • Formal semantics • π calculus with first-class namespaces • Limited reasoning about styles and composition Publications and software: www.iam.unibe.ch/~scg FMCO, Leiden, 2002-11-07

  23. What’s missing? • Explicit components, connectors & styles • Type-checking provided and required services • Reasoning about styles and compositions • Adapting/reengineering existing services FMCO, Leiden, 2002-11-07

  24. The future of composition? • Dynamic composition of ubiquitous services • Service discovery and negotiation • Reconfiguration validation and run-time monitoring FMCO, Leiden, 2002-11-07

More Related