RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Explore Model Driven Architecture and Aspect-oriented Programming, Birds of a Feather : Page 3

In recent years, two new trends in software engineering have been established—Aspect-oriented Programming (AOP) was developed to extend and ease programming, and the Model Driven Architecture (MDA) was introduced to take full advantage of the power of modeling. Many people are confused when confronted with both AOP and MDA. This article provides a crash-course on both topics and explains the differences and similarities between the two.

Bringing AOP and MDA Together
Current developments make it even harder to distinguish between MDA and AOP. Both trends influence each other in such a way that they come closer and closer.

Aspects as Models, or Modeling Aspects
Transformations are defined in transformation definitions, which in turn are executed by a transformation engine. Because writing transformation is a lot of work, developers have started to parameterize transformation definitions so that they can be tuned and more widely used. Going further, many developers are now using complete models to parameterize transformation definitions. Models of persistence architecture and models of security architecture have been developed this way. MDA is used to combine such models with the application model, resulting in a combined model of the application plus persistence or security. In effect, the MDA transformation takes two input models and, in AOP terms, weaves those models together. (See Figure 3). Although this happens at the model level, it is conceptually very close to aspect weaving within the AOP approach.

Figure 3. Model Weaving: A representation of how MDA weaves the various models together.
Aspect-orientation has also been taken up directly by the modeling community. There is even an aspect-oriented modeling language, Theme/UML, which is defined as an extension to UML. Using this approach, aspects may be modeled directly using UML diagrams. The weaving of the aspects now becomes the weaving of models, which is what MDA is all about.

There is an ongoing discussion in the AOP community regarding whether there is even a need for a dominant "base" program. If all parts of the application can be defined by aspects, the base program can no longer be identified. Once this is the case, AOP looks more and more like MDA.

Choice of Concerns
The choice of concerns that should be put in an aspect or a different input model of an MDA transformation is, in many cases, the same for AOP and MDA. From the point of view of AOP, aspects can be used to add technological details to a model. This is exactly what the PIM to PSM transformations are supposed to do. The case of defining persistence is a very good example of this. A specific persistence technology (e.g. direct JDBC access to a database, XML file storage, etc.) is defined using either an aspect or a different input model, while the main application code/model is completely independent from the persistence technology being used.

Generation of Aspect Code
Some MDA approaches not only generate ordinary code, but also generate aspect code. The MDA generation becomes simpler and AOP techniques are then getting used to weave the aspects with the main application. This combines the two techniques directly.

Models as Programs
Another interesting development is the advance of model compilers and UML virtual machines. Using a UML virtual machine, it's possible for an MDA approach to be more dynamic, just as AOP systems already are.

In AOP systems, access to the metalevel is limited. However, nothing in the AOP philosophy stops us from defining more types of pointcuts, thus opening up the metalevel of the source language to allow more expression.

Anneke Kleppe is a consultant and adviser at Klasse Objecten, which she founded in 1995 to train and coach companies on the use of object technology, modeling, and MDA. She was intensively involved in the development of the Unified Modeling Language (UML) and the new UML 2.0 standard. The author of several books, Anneke started a knowledge center for object technology at KPN Research in Leidschendam, Netherlands. She is a member of the authoring team of the OCL 2 standard, where she has a special focus on the definition of the semantics of the OCL.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date