5c06fbd5e76f4f1e54a7ba4ea4225f65.ppt
- Количество слайдов: 13
Model-Driven Development for Pluggable Collaborations CORPORATE TECHNOLOGY Iris Groher, Stephan Bleicher, Christa Schwanninger SIEMENS CT SE 2 1 © Siemens AG, CT SE 2
Contents • Aspectual Collaborations • UML for Aspects (UFA) CORPORATE TECHNOLOGY • Standard UML for Aspects (s. UFA) • Model-Driven Development Framework • open. Architecture. Ware • Binding Generation Process 2 © Siemens AG, CT SE 2
Aspectual Collaborations CORPORATE TECHNOLOGY • New programming model that supports the encapsulation of crosscutting concerns • Modular implementation of multiple collaborating types independent of the system they will be applied to • A collaboration interface specifies the abstractions (types) that together form the component • Serves as the interface between its implementation and its mapping to a base application • Interface states which properties and services are provided by the component and which ones are expected from the system (base application) it will be applied to • Can have several distinct implementations • The mapping to a base application is specified in a so-called binding • Composition of binding and implementation using mixin-composition • Explicit deployment • Supported by the aspect-oriented programming languages Caesar. J and Object. Teams 3 © Siemens AG, CT SE 2
Aspectual Collaborations (2) CORPORATE TECHNOLOGY … modularization of „crosscutting concerns“ and beyond that … … focus on component integration by means of aspect-oriented concepts. 4 © Siemens AG, CT SE 2
Composition Observer. Protocol collaboration interface Subject add (Observer) remove(Observer) notify() generic component refinement & bindings with mixin-in inheritance Observer start(Subject) stop(Subject) CORPORATE TECHNOLOGY update(Subject) Observer. Protocol. Impl component binding Observe. Library Subject Book. Copy Observer Book. Manager Library. Observer 5 concrete component © Siemens AG, CT SE 2
UML for Aspects (UFA) CORPORATE TECHNOLOGY • Modeling language for aspect-oriented design that strongly supports the concept of Aspectual Collaborations • The notation extends UML packages to encapsulate complex structures (either component or base application) • Three kinds of packages • Base package for base application • Abstract package for Aspectual Collaboration • Connector package for binding • The classes inside the connector package are enhanced UML classes and support the adaptation of the abstract collaboration to a certain application 6 © Siemens AG, CT SE 2
UML for Aspects (2) Aspectual Collaboration needing refinement before use Package refinement/specialization CORPORATE TECHNOLOGY Package connecting the independent packages Observer and Library Directed adaptation relation: Observer may use and influence Library Ordinary package (base application) 7 © Siemens AG, CT SE 2
Connector Package Mapping of role Subject to class Book. Copy CORPORATE TECHNOLOGY Callin: After methods borrow. Copy() and return. Copy() of class Book. Copy, the method notify() of class Subject is called Mapping of role Observer to class Book. Manager Callout: The abstract method update() of class Observer delegates to method update. Status() of class Book. Manager 8 © Siemens AG, CT SE 2
Standard UML for Aspects CORPORATE TECHNOLOGY • Standard UML compliant using stereotypes • Supports all UFA concepts • Models can be developed using commercial UML modeling tools 9 © Siemens AG, CT SE 2
Caesar. J Binding Code abstract public cclass Observe. Library extends Observer. Protocol { public cclass Subject wraps Book. Copy { public Book. Copy get. Wrappee() { return wrappee; } } CORPORATE TECHNOLOGY public cclass Observer wraps Book. Manager { public void update(Subject. Role s) { wrappee. update. Status(s. get. Wrappee()); } } after(Book. Copy bc): (call(public void borrow. Copy()) || call(public void return. Copy())) && target(bc) { Subject(bc). notify(); } after(Book. Manager bm, Book. Copy bc): (call(public void buy(Book. Copy)) && target(bm) && args(bc) { Observer(bm). start(Subject(bc)); } after(Book. Manager bm, Book. Copy bc): (call(public void drop(Book. Copy)) && target(bm) && args(bc) { Observer(bm). stop(Subject(bc)); } • Implementation of binding code straightforward all necessary information already contained in model • Error prone • Necessary for the component composer to be familiar with Caesar. J / Object. Teams Generate code automatically from model } 10 © Siemens AG, CT SE 2
open. Architecture. Ware CORPORATE TECHNOLOGY • Open source MDD generator framework integrated into eclipse • Supports arbitrary input formats and output formats • Own metamodels can be implemented in Java • A metamodel of the domain has to be defined and implemented as Java classes • Templates specify the output (e. g. code) • A model has to be created (an instance of the metamodel) which can be done using for example UML tools, textual languages or XML • The generator parses the respective model and builds a syntax tree in memory by instantiating the metaclasses • The generator then navigates through the syntax tree and performs the actions described in the templates 11 © Siemens AG, CT SE 2
Binding Generation Process 1 CORPORATE TECHNOLOGY 2 3 4 1. Modeling with standard UML tool using the s. UFA notation 2. XMI export of the model (input to the generator tool chain) 3. Automatic transformation of the XMI model to a defined XML format 4. Validation of the model 5. Generation of Caesar. J / Object. Teams binding code 5 12 © Siemens AG, CT SE 2
CORPORATE TECHNOLOGY Thanks for your attention! 13 © Siemens AG, CT SE 2
5c06fbd5e76f4f1e54a7ba4ea4225f65.ppt