© 2002 IBM Corporation Confidential | Date | Other Information, if necessary Aspect Oriented Modeling Eclipse Summit Europe 2009 Florian Lautenbacher (University of Augsburg, DE) Marc Dutoo (Open Wide, FR)
May 10, 2015
© 2002 IBM Corporation
Confidential | Date | Other Information, if necessary
Aspect Oriented ModelingEclipse Summit Europe 2009
Florian Lautenbacher (University of Augsburg, DE)
Marc Dutoo (Open Wide, FR)
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 2
Overview
Introducing Aspects
Requirements for the modeling domain
EMF – annotations and any*
Exploring EMF techniques
Inversion of Control – genmodel as an example
Managing extensions & an AOM framework
AOM Beyond EMF
Conclusion
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 3
Introducing Aspects
An aspect is a unit of modularization of a crosscutting concern with respect to another concerns
Aspect Oriented Programming (AOP)• Has now pervaded software architecture and development.
• Dedicated language features (ex. Traits in Scala)
• Intrusive (ex. AspectJ in Java) or not (ex. Spring proxies).
The benefits:• Separation of features (logging, security, transactions..)
• Improve the readability and maintenance of code
The concept of Aspect transcends programming and has echoes in a lot of other areas, as e.g. in modeling.
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 4
Aspect-Oriented Programming and Modeling
Composition points are defined in a join pointmodel
A set of composition points is selected throughPointcut expressions
Composing is done by an aspect weaver (duringdesign / load / runtime).
Distinction of aspects:• Homogeneous aspects: Same aspect used at several places
• Heterogeneous aspects: Different aspects at these places.
About Workflows, distinction of join points:• Activity join points (or process-level join points)
• Internal join points (interpretation-level join points)
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 5
Introduction – Extending Models
Idea and Requirement: Extending models
With additional metamodel elements With additional properties
Why?
Store information that shall not be visible at runtime Enrich the meta model with data required by applications
Example: in Bonita 4 Workflow Engine, code execution “Hooks”
Allow support for custom actions
Examples: Logging, send emails on specific actions
but also development time information, like UI
A generic solution for such problems is needed!
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 6
Example: Different views on a workflow 1/2
UML View
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 7
Example: Different views on a workflow 2/2
Event-DrivenProcess Chain (EPC) View
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 8
Simple EMF technique : EMF Annotations
Classified by Source, contains a key-value map
Example: STP BPMN
Simple and all-purpose However, not typed, not appropriate to business &
domain modeling
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 9
Simple EMF technique : any* slot
i.e. “untyped” multiple containment reference
Can be used for domain specific modeling
Example: Implementations in STP SCA
Disadvantages : •The model is encumbered by extensions•Extension definitions must always be present•Version management is difficult
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 10
Further exploring EMF Modeling techniques
A common way to do it : EMF modeling !i.e. creating a « single shot » specific EMF extension
Usually extensibility is defined according to needs• Adding custom information to an element requires subclassing it
• In EMF: support through Child Creation Extenders feature
Problem: what happens with many optional extensions that the user can enable “on demand”?
• Having several such custom extensions (e.g. from different vendors) would mean to create a new node type that inherits from all of them
• Neither flexible nor open to the end user
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 11
Adding Inversion of Control
The extension model references the enriched model
Example: JWT‟s genmodel vs ecore model
Enables domain specific modeling, but…
Still no way to manage extensions coming from several different providers enriching the same model
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 12
Managing model extensions : JWT Conf Model
Our solution: the JWT Conf model and framework
Example: Logging
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 13
How does the JWT Conf Model work ?
Aspect-oriented extensions of the Workflow Editor EMF models are enriched through a Configuration (ConfModel)
consisting of Profiles (features)
Typed Aspects are defined in Profiles
Aspects are instantiated on elements of the decorated model
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 14
Towards an AOM framework
Governance
For now, processes (in our case, documented on the wiki)
Going further, envisioning a repository of compatible types and extensions
Additions to the UI emf.edit extensions (display Aspects in Outline and Property Sheet) emf.editor-based default editor And also custom property tabs
Sample Aspects Custom Properties : all purpose
key-value Semantic annotations (in SemPro) SCA, RMI Actions (in OW2 Scarbo)
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 15
AOM Beyond EMF: OMG proposal
One of the first submissions for the OMG RFP « MOF Support for Semantic Structures » (SMOF)
included the concept of Facets to representinformation about different views on one object in possibly different contexts.
«A facet is a MOF element that describessomething identified in the world. Multiple facets may contribute to the understanding of that thing in the world. »
NB. The latest version of the joint submission does not include this idea anymore.
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 16
AOM Beyond EMF: BPMN 2.0
In its current draft version, BPMN 2.0 will alsoprovide the possibility to extend the metamodel with definitions from the outside
Only attributesthough
Could be modeledby a dedicatedAspect
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 17
Conclusion
AO principles were applied on modeling through AOM specific techniques in EMF
Supported by a generic AOM framework
Benefits of Aspects in our use case Provide additional nodes that don„t exist in the original
metamodel
Call vendor specific custom actions for specific model elements
Have additional properties on already existing metamodelelements
Next steps Improve Conf model editor, wizards…
Making it fully independent of JWT
Eclipse Foundation, Inc. | © 2009 by the Open Wide and University of Augsburg. Made available under the EPL v1.0 18
Thanks for your attention !
We thank for his assistance:
Christian Saad – University of Augsburg, Committer on JWT
Any questions???Contact us at [email protected]
JWT Conf Framework Documentation : http://wiki.eclipse.org/JWT_Metamodel_Extension
& Have a look at the latest Eclipse Magazin !