Chapter 7. Map to Implementation


In this chapter, we look at some different possibilities for implementing your Theme/UML designs. Up to now, we have focused on modularizing design models into themes and specifying how themes should be composed. Moving on to the coding phase, you have a number of options. You can use a standard object-oriented programming language such as Java or C++, but if you go this route, you must work with composed designs. This means, of course, that you will lose the separation of your code artifacts into base modules and crosscutting modules. Alternatively, a number of aspect-oriented programming (AOP) languages can be used. In general, most AOP languages support similar separations as manifest in the Theme/UML designs, which means that you can maintain some level of traceability between your designs and your code. In this chapter, we focus on using AOP languages and consider the steps required to map the Theme/UML designs to a selection of them. We work through the implementation task, using the Crystal Game themes as examples.

There are a growing number of AOP languages in existence. While some languages are based on different programming languages, such as Java, C++, and Smalltalk, the most mature of these, at the time of writing, are based on Java. We have selected three representative approaches to describe in this chapterAspectJ,[1] AspectWerkz,[2] and the Concern Manipulation Environment (CME).[3] AspectJ and AspectWerkz have similar philosophies in that they follow the asymmetric composition model in which aspects are separate from the core functionality. Theme/UML evolved more directly from the CME approach in which the focus is a more symmetric model and core functionality is further separated into concerns in addition to the aspects. See Chapter 1, "Introduction," for a discussion on the difference between the asymmetric and symmetric models. This chapter demonstrates that the Theme approach allows you to move to either approach in the implementation phase.

[1] http://www.eclipse.org/aspectj.

[2] http://aspectwerkz.codehaus.org/.

[3] http://www.eclipse.org/cme.

You should not consider this chapter a tutorial on any of the AOP languages discussedthere are more appropriate sources that provide detailed information on these languages. Our intent is to examine the mapping of Theme/UML constructs to corresponding code constructs and to illustrate how code can be derived. In addition, our intent is to describe mapping in such a way that if you are using a different AOP language than one discussed here, you will be able to relate our discussions to whatever other AOP language you are using.



Aspect-Oriented Analysis and Design(c) The Theme Approach
Aspect-Oriented Analysis and Design: The Theme Approach
ISBN: 0321246748
EAN: 2147483647
Year: 2006
Pages: 109

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net