250 likes | 391 Views
Towards Executable Aspect-Oriented UML Models. Lidia Fuentes and Pablo Sánchez Dpto. Lenguajes y Ciencias de la Computación Universidad de Málaga, (Spain) {lff, pablo }@lcc.uma.es. 10th Int. Workshop on Aspect-Oriented Modeling (AOM),
E N D
Towards Executable Aspect-Oriented UML Models Lidia Fuentes and Pablo Sánchez Dpto. Lenguajes y Ciencias de la Computación Universidad de Málaga, (Spain) {lff,pablo}@lcc.uma.es 10th Int. Workshop on Aspect-Oriented Modeling (AOM), 6th Int. Conf. on Aspect-Oriented Software Development (AOSD) March 12th, 2007. Vancouver British Columbia (Canada)
AOSD for improving modularization I would like to separate my crosscutting concerns
AOSD for improving modularization I would like to separate my crosscutting concerns !! !! AOSD
Base Models Reasoning about AO Models
Base Models Aspect Models Reasoning about AO Models
Base Models Aspect Models Pointcut Models *:* Bank Reasoning about AO Models pay(..) {hook=BEFORE_SEND}
Base Models Aspect Models Pointcut Models *:* Bank Reasoning about AO Models pay(..) {hook=BEFORE_SEND} ?
Simple solution • If I want to know what my model does, the quickest way is to execute it. • UML models can be executed (UML Action Semantics). • There are tools that execute UML models (e.g. Telelogic Rhapsody, KC iUML).
Simple solution • If I want to know what my model does, the quickest way is to execute it. • UML models can be executed (UML Action Semantics). • There are tools that execute UML models (e.g. Telelogic Rhapsody, KC iUML).
Base Models Aspect Models Woven Models Pointcut Models *:* Bank Simple solution • If I want to know what my model does, the quickest way is to execute it. • UML models can be executed (UML Action Semantics). • There are tools that execute UML models (e.g. Telelogic Rhapsody, KC iUML). pay(..) {hook=BEFORE_SEND} XMI XMI XMI Weaver
The Online Book Store System • The Online Book Store has to provide a way for customers to place orders for books. • A customer will start a new order by selecting a book and specifying the required quantity. • The customer can continue adding more books to the order. • Once the customer is satisfied with his/her selections, the order goes to the check out stage. • Each time a new book is added to the order, the order must be persisted. • Persistence is a crosscutting concern !! => AO modeling
Base model (plain Executable UML) (1) Decompose the system into a set of interconnected components
Base model (plain Executable UML) (2) Model internals of each component (OBS System in the figure)
Base model (plain Executable UML) (3) Construct a state machine by each class (ShoppingCart in the figure) Behaviors are associated to transition events => modeled as activity diagrams
Base model (plain Executable UML) (3) Specify each behavior (UpdateItems in the diagram) using activity diagrams and actions This does not have Persistence.
Aspect model (AOEM Profile) • Joinpoint model • Object creation and destruction; • The sending and reception of a message/method; • The throwing of an event; • The raising of an exception. • Suitable for being used with black-box components, services or legacy • systems
Aspect model (AOEM Profile) (1) We create the Persistence aspect.
Aspect model (AOEM Profile) (2) We specify the advice behaviour.
Aspect model (AOEM Profile) (3) We model the pointcuts.
Aspect weaving • As the final behavior of base classes and aspects is expressed by means of activity diagrams, the weaving problem can be reduced to weaving activity diagrams. • Two phases: joinpoint selection and aspect injection. • Joinpoint selection • Pointcuts are processed to generate XPath expressions that are used to search selected joinpoints (UML models are serialized into XMI). • Information required by the weaver is added to each selected joinpoint (e.g., advice to be injected).
Aspect weaving • Advice injection • Select the place where the advice must be injected. • Translate special AO actions into UML plain actions. • Reroute control and object flows to ensure correctness of the composition
Aspect weaving • Advice injection • Select the place where the advice must be injected. • Translate special AO actions into UML plain actions. • Reroute control and object flows to ensure correctness of the composition
Aspect weaving • Advice injection • Select the place where the advice must be injected. • Translate special AO actions into UML plain actions. • Reroute control and object flows to ensure correctness of the composition
Experiments and Future Work • Lack of UML tools that • Execute models • Export/Import to XMI, including actions, adequately. • UML2 de Eclipse for UML modeling • Telelogic Rhapsody for UML execution • Solution: Use UML2 and import manually the woven in Rhapsody for validating the results. • As future work: • Develop an academic UML execution engine for our own experimentation. • Replace the current pointcut model by JPDD’s or similar.
Questions ? Have I explained it clearly ? Any question or suggestion ? Thanks for your attention