Comparing White-Box, Black-Box, and Glass-Box Composition of Aspect Mechanisms

  • Sergei Kojarski
  • David H. Lorenz
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4039)


The manifestation of miscellaneous aspect-oriented extensions raises the question of how these extensions can be used together to combine their aspectual capabilities or reuse aspect code across extensions. While white-box composition of aspect mechanisms can produce an optimal compound mechanism, as exemplified by the merger of AspectJ and AspectWerkz into AspectJ 5, it comes with a high integration cost. Meanwhile, generic black-box composition can compose arbitrary aspect mechanisms, but may result in a compound mechanism that is suboptimal in comparison to white-box composition. For a particular family of aspect extensions, e.g.,AspectJ-like mechanisms, glass-box composition offers the best of two worlds. Glass-box may rely on the internal structure of, e.g., a pointcut-and-advice mechanism, without requiring a change to the code of the individual mechanisms. In this paper we compare white-, black-, and glass-box composition of aspect mechanisms. We explain subtle composition issues using an example drawn from the domain of secure and dependable computing, deploying a fault-tolerance aspect written in AspectWerkz together with an access-control aspect written in AspectJ. To compare the three composition methods, we integrate a TinyAJ extension with a TinyAW extension, and compare the results of running the aspects in a black-box framework and in a glass-box framework to the result of running these aspects in AspectJ 5.


Aspect Mechanism Main Database Composition Semantic Public Class Regular Client 
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.
    Kersten, M.: AOP@Work: AOP tools comparison, part 1, developerWorks (2005),
  2. 2.
    Kersten, M.: AOP@Work: AOP tools comparison, part 2, developerWorks (2005),
  3. 3.
    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
  4. 4.
    Masuhara, H., Kiczales, G.: Modeling crosscutting in aspect-oriented mechanisms. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 2–28. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  5. 5.
    Colyer, A.: AOP@Work: Introducing AspectJ 5. developerWorks (2005),
  6. 6.
    Bonér, J.: What are the key issues for commercial AOP use: how does AspectWerkz address them? In: Lieberherr, K. (ed.) Proceedings of the 3rd International Conference on Aspect-Oriented Software Development, AOSD 2004, Mancaster, UK, pp. 5–6. ACM Press, New York (2004)CrossRefGoogle Scholar
  7. 7.
    Colyer, A.: Joining interface21. The Aspect Blog (2005),
  8. 8.
    Colyer, A.: The new holy trinity. The Aspect Blog (2005),
  9. 9.
    Kojarski, S., Lorenz, D.H.: Pluggable AOP: Designing aspect mechanisms for third-party composition. In: Johnson, R., Gabriel, R.P. (eds.) Proceedings of the 20th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 2005, San Diego, CA, USA, pp. 247–263. ACM Press, New York (2005)CrossRefGoogle Scholar
  10. 10.
    Courbis, C., Finkelstein, A.: Towards aspect weaving applications. In: Proceedings of the 27th International Conference on Software Engineering, ICSE 2005, St. Louis, Missouri, USA. ACM Press, New York (2005)Google Scholar
  11. 11.
    Czarnecki, K., Eisenecker, U.: Generative Programming: Methods, Tools, and Applications, 1st edn. Addison-Wesley, Reading (2000)Google Scholar
  12. 12.
    Hugunin, J.: The next steps for aspect-oriented programming languages (in Java). In: NSF Workshop on New Visions for Software Design & Productivity: Research & Applications, Vanderbilt University, Nashville, TN, National Coordination Office for Information Technology Research and Development (NCO/IT R&D), White Paper (2001)Google Scholar
  13. 13.
    Lopes, C.V., Dourish, P., Lorenz, D.H., Lieberherr, K.: Beyond AOP: Toward Naturalistic Programming. ACM SIGPLAN Notices 38(12), 34–43 (2003); OOPSLA 2003 Special Track on Onward! Seeking New Paradigms & New ThinkingGoogle Scholar
  14. 14.
    Wand, M.: Understanding aspects (extended abstract). In: Proceedings of the 7th ACM SIGPLAN International Conference on Functional Programming, Uppsala, Sweden. ACM Press, New York (2003) (invited talk)Google Scholar
  15. 15.
    Szyperski, C.: Component Software, Beyond Object-Oriented Programming, 2nd edn. Addison-Wesley, Reading (2002) (with Gruntz, D., Murer, S.)Google Scholar
  16. 16.
    Lopes, C.V.: D: A Language Framework for Distributed Programming. Ph.D thesis, Northeastern University (1997)Google Scholar
  17. 17.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. In: Professional Computing. Addison-Wesley, Reading (1995)Google Scholar
  18. 18.
    Shaw, M., Garlan, D.: Software Architecture, Perspectives on an Emerging Discipline. Prentice-Hall, Englewood Cliffs (1996)Google Scholar
  19. 19.
    Kojarski, S., Lorenz, D.: Modeling aspect mechanisms: A top-down approach. In: Proceedings of the 28th International Conference on Software Engineering, ICSE 2006, Shanghai, China (2006)Google Scholar
  20. 20.
    Lorenz, D.H., Kojarski, S.: Parallel composition of aspect mechanisms: Design and evaluation. In: Brichau, J., Chiba, S., Volder, K.D., Haupt, M., Hirschfeld, R., Lorenz, D.H., Masuhara, H., Tanter, E. (eds.) AOSD 2006 Workshop on Open and Dynamic Aspect Languages (ODAL), Bonn, Germany (2006)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Sergei Kojarski
    • 1
  • David H. Lorenz
    • 1
  1. 1.University of VirginiaCharlottesvilleUSA

Personalised recommendations