Understanding Design Patterns Density with Aspects

A Case Study in JHotDraw Using AspectJ
  • Simon Denier
  • Pierre Cointe
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4089)


Design patterns offer solutions to common engineering problems in programs [1]. In particular, they shape the evolution of program elements. However, their implementations tend to vanish in the code: thus it is hard to spot them and to understand their impact. The problem becomes even more difficult with a “high density of pattern”: then the program becomes easy to evolve in the direction allowed by patterns but hard to change [2]. Aspect languages offer new means to modularize elements. Implementations of object-oriented design patterns with AspectJ have been proposed [3]. We aim at testing the scalability of such solutions in the JHotDraw framework. We first explore the impact of density on pattern implementation. We show how AspectJ helps to reduce this impact. This unveils the principles of aspects and AspectJ to control pattern density.


Design Pattern Pattern Density Subject Role Observer Pattern Server Pattern 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley, Massachusetts (1994)Google Scholar
  2. 2.
    Gamma, E., Beck, K.: JUnit: A Cook’s Tour (2002),
  3. 3.
    Hannemann, J., Kiczales, G.: Design pattern implementation in Java and AspectJ. In: Proc. of OOPSLA 2002, pp. 161–173. ACM Press, New York (2002)CrossRefGoogle Scholar
  4. 4.
    Soukup, J.: Implementing patterns. In: Pattern languages of program design. ACM Press/Addison-Wesley Publishing Co., USA, pp. 395–412 (1995)Google Scholar
  5. 5.
    Zimmer, W.: Relationships between design patterns. In: Coplien, J.O., Shmidt, D.C. (eds.) Pattern Languages of Program Design. Addison-Wesley, Reading (1994)Google Scholar
  6. 6.
    Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–353. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  7. 7.
    Colyer, A., Clement, A., Harley, G., Webster, M.: Eclipse AspectJ. The eclipse series. Addison-Wesley, Reading (2005)Google Scholar
  8. 8.
    Douence, R., Teboul, L.: A crosscut language for control-flow. In: Karsai, G., Visser, E. (eds.) GPCE 2004. LNCS, vol. 3286. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  9. 9.
    Denier, S.: Traits programming with AspectJ. RSTI - L’objet 11(3), 69–86 (2005)Google Scholar
  10. 10.
    Bosch, J.: Design patterns as language constructs. Journal of Object-Oriented Programming 11(2), 18–32 (1998)Google Scholar
  11. 11.
    Ostermann, K., Mezini, M.: Conquering aspects with Caesar. In: Akşit, M. (ed.) Proc. of AOSD 2003, pp. 90–99. ACM Press, New York (2003)Google Scholar
  12. 12.
    Tanter, É., Noyé, J., Caromel, D., Cointe, P.: Partial behavioral reflection: Spatial and temporal selection of reification. In: Crocker, R., Steele, Jr.G.L. (eds.) Proc. of OOPSLA 2003, pp. 27–46. ACM Press, New York (2003)CrossRefGoogle Scholar
  13. 13.
    Clarke, S., Walker, R.J.: Composition patterns: An approach to designing reusable aspects. In: Proc. of ICSE 2001, pp. 5–14. IEEE Computer Society Press, Los Alamitos (2001)Google Scholar
  14. 14.
    Lieberherr, K., Lorenz, D.H., Ovlinger, J.: Aspectual collaborations: Combining modules and aspects. Computer Journal of the British Computer Society 46(5), 542–565 (2003)zbMATHGoogle Scholar
  15. 15.
    Marin, M.: Refactoring JHotDraw’s undo concern to AspectJ. In: Proceedings of the 1st Workshop on Aspect Reverse Engineering (WARE 2004) (2004)Google Scholar
  16. 16.
    Isberg, W.: Aop pointcut patterns in the JUnit Cook’s Tour (2005),
  17. 17.
    Douence, R., Fradet, P., Südholt, M.: A framework for the detection and resolution of aspect interactions. In: Batory, D., Consel, C., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 173–188. Springer, Heidelberg (2002)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Simon Denier
    • 1
  • Pierre Cointe
    • 1
  1. 1.École des Mines de Nantes, INRIA, LINAOBASCONantesFrance

Personalised recommendations