Abstract
A considerable amount of research, especially within the OO and AOSD communities, has focused on understanding the potential and limitations of various composition techniques. This has led to a large number of proposals for alternative composition techniques, including many variations of message dispatch, inheritance, and aspect mechanisms. This paper makes the case that there is no single perfect composition technique that suits every situation, since different techniques incur different tradeoffs. The proper composition technique to use depends on the particular design problem and its requirements (such as the required adaptability, reusability, understandability and robustness). However, most programming languages limit the available composition techniques to a very few. To address this, we propose a novel composition model, called Co-op. The model provides dedicated abstractions that can be used to express a wide variety of object composition techniques (“composition operators”). Examples include various forms of inheritance, delegation, and aspects. The proposed model unifies objects (with encapsulated state and a message interface) and composition operators; composition operators are specified as first-class citizens. Multiple composition operators can be combined within the same application, and composition operators can even be used to compose new composition operators from existing ones. This opens new possibilities for developing domain-specific composition operators, taxonomies of composition operators, and for reuse and refinement of composition operators. To validate and experiment with the proposed model, we have designed and implemented a simple language, Co-op/I, that we also use in this paper to show concrete examples.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
The Miranda Programming Language, http://miranda.org.uk/
Java Aspect Metamodel Interpreter (2007), http://jami.sf.net/
Co-op Sourceforge homepage (2010), http://co-op.sourceforge.net
Akşit, M., Wakita, K., Bosch, J., Bergmans, L., Yonezawa, A.: Abstracting Object Interactions Using Composition Filters. In: Guerraoui, R., Nierstrasz, O., Riveill, M. (eds.) ECOOP-WS 1993. LNCS, vol. 791, pp. 152–184. Springer, Heidelberg (1994)
Avgustinov, P., Christensen, A.S., Hendren, L., Kuzins, S., Lhoták, J., Lhoták, O., de Moor, O., Sereni, D., Sittampalam, G., Tibble, J.: abc: An Extensible AspectJ Compiler. In: Rashid, A., Aksit, M. (eds.) Transactions on AOSD I. LNCS, vol. 3880, pp. 293–334. Springer, Heidelberg (2006)
Banavar, G., Lindstrom, G.: An Application Framework for Module Composition Tools. In: Cointe, P. (ed.) ECOOP 1996. LNCS, vol. 1098, pp. 91–113. Springer, Heidelberg (1996)
Bergmans, L., Akşit, M.: Composing crosscutting concerns using composition filters. Comm. ACM 44(10), 51–57 (2001)
Bockisch, C.: An Efficient and Flexible Implementation of Aspect-Oriented Languages. PhD thesis, Technische Universität Darmstadt (2009)
Bosch, J.: Design patterns as language constructs. Journal of Object-Oriented Programming 11, 18–32 (1998)
Bouraqadi, N., Seriai, A., Leblanc, G.: Towards unified aspect-oriented programming. In: Proceedings of ESUG 2005 (13th International Smalltalk Conference) (2005)
Bracha, G., Cook, W.: Mixin-based inheritance. In: Conf. Object-Oriented Programming: Systems, Languages, and Applications; European Conf. Object-Oriented Programming, pp. 303–311. ACM (1990)
Bracha, G., von der Ahé, P., Bykov, V., Kashai, Y., Maddox, W., Miranda, E.: Modules as Objects in Newspeak. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 405–428. Springer, Heidelberg (2010)
Brichau, J., Mezini, M., Noyé, J., Havinga, W., Bergmans, L., Gasiunas, V., Bockisch, C., Fabry, J., D’Hondt, T.: An Initial Metamodel for Aspect-Oriented Programming Languages. Technical Report AOSD-Europe Deliverable D39, Vrije Universiteit Brussel (February 27, 2006)
Brinke, S.t.: First-order function dispatch in a java-like programming language. Master’s thesis, University of Twente, Faculty of Electrical Engineering, Mathematics and Computer Science (2010)
Chambers, C., Ungar, D., Lee, E.: An efficient implementation of self a dynamically-typed object-oriented language based on prototypes. SIGPLAN Not. 24(10), 49–70 (1989)
Clifton, C., Millstein, T., Leavens, G.T., Chambers, C.: MultiJava: Design rationale, compiler implementation, and applications. ACM Transactions on Programming Languages and Systems 28(3), 517–575 (2006)
Cointe, P.: Reflective languages and metalevel architectures. ACM Comput. Surv., 151 (1996)
Oliveira, B.C.d.S.: Modular Visitor Components. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 269–293. Springer, Heidelberg (2009)
de Roo, A.J., Hendriks, M.F.H., Havinga, W.K., Durr, P.E.A., Bergmans, L.M.J.: Compose*: a language- and platform-independent aspect compiler for composition filters. In: Mens, K., van den Brand, M., Kuhn, A., Kienle, H., Wuyts, R. (eds.) First International Workshop on Academic Software Development Tools and Techniques, Cyprus (July 2008)
Douence, R., Fradet, P., Südholt, M.: Composition, reuse and interaction analysis of stateful aspects. In: Lieberherr, K. (ed.) Proc. 3rd Int’ Conf. on Aspect-Oriented Software Development (AOSD 2004), pp. 141–150. ACM Press, New York (2004)
Ducasse, S., Nierstrasz, O., Schärli, N., Wuyts, R., Black, A.: Traits: A mechanism for fine-grained reuse. ACM Transactions on Programming Languages and Systems (TOPLAS) 28(2), 331–388 (2006)
Dyer, R., Rajan, H.: Nu: a dynamic aspect-oriented intermediate language model and virtual machine for flexible runtime adaptation. In: AOSD 2008: Proceedings of the 7th International Conference on Aspect-Oriented Software Development. ACM, New York (2008)
van Engelen, R., Voeten, J. (eds.): Ideals: evolvability of software-intensive high-tech systems. Embedded Systems Institute, Eindhoven (2007)
Ernst, M., Kaplan, C., Chambers, C.: Predicate Dispatching: A Unified Theory of Dispatch. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 186–211. Springer, Heidelberg (1998)
Filman, R.E., Barrett, S., Lee, D.D., Linden, T.: Inserting ilities by controlling communications. Comm. ACM 45(1), 116–122 (2002)
Findler, R.B., Flatt, M.: Modular object-oriented programming with units and mixins. In: Proceedings of the ACM SIGPLAN International Conference on Functional Programming, pp. 94–104. ACM, New York (1998)
Finkel, R.: Advanced programming language design. Addison-Wesley (1996)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley, Reading (1994)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design patterns: elements of reusable object-oriented software. Addison-Wesley, Reading (1995)
Goldberg, A., Robson, D.: Smalltalk-80: the language and its implementation. Addison-Wesley Longman Publishing Co., Inc., Boston (1983)
Goldberg, D.S., Findler, R.B., Flatt, M.: Super and inner: together at last! In: OOPSLA 2004: Proceedings of the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 116–129. ACM, New York (2004)
Guy, J., Steele, L.: Growing a language. Higher Order Symbol. Comput. 12(3), 221–236 (1999)
Hannemann, J., Kiczales, G.: Design pattern implementation in Java and AspectJ. In: Proceedings of the 17th ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 161–173. ACM Press (2002)
Haupt, M., Schippers, H.: A Machine Model for Aspect-Oriented Programming. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 501–524. Springer, Heidelberg (2007)
Havinga, W.K.: On the Design of Software Composition Mechanisms and the Analysis of Composition Conflicts. PhD thesis, University of Twente, Enschede (June 2009)
Havinga, W., Bergmans, L., Aksit, M.: Prototyping and Composing Aspect Languages Using an Aspect Interpreter Framework. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 180–206. Springer, Heidelberg (2008)
Havinga, W.K., Bergmans, L.M.J., Akşit, M.: A model for composable composition operators: Expressing object and aspect compositions with first-class operators. In: Proceedings of the 9th International Conference on Aspect-Oriented Software Development, Rennes and Saint-Malo, pp. 145–156. ACM, New York (2010)
Havinga, W.K., Bockisch, C.M., Bergmans, L.M.J.: A case for custom, composable composition operators. In: Proceedings of the 1st International Workshop on Composition: Objects, Aspects, Components, Services and Product Lines, Rennes, France. Workshop Proceedings, vol. 564, pp. 45–50. CEUR-WS (March 2010)
Hirschfeld, R.: Aspect-oriented programming with AspectS. In: Akşit, M., Mezini, M. (eds.) Net.Object Days 2002 (October 2002)
Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: A minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems (TOPLAS) 23(3), 396–450 (2001)
Johnson, R.: Design patterns and language design, http://www.cincomsmalltalk.com/userblogs/ralph/blogview?entry=3335803396
Kiczales, G.: It’s not metaprogramming. Software Development Magazine (10) (2004)
Kiczales, G., des Rivieres, J., Bobrow, D.G.: The Art of the Metaobject Protocol. MIT Press, Cambridge (1991)
Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., Irwin, J.: Aspect-oriented programming. Technical Report SPL97-008 P9710042, Xerox PARC (February 1997)
Kojarski, S., Lorenz, D.H.: Awesome: an aspect co-weaving system for composing multiple aspect-oriented extensions. SIGPLAN Notices 42(10), 515–534 (2007)
Lieberman, H.: Using prototypical objects to implement shared behavior in object-oriented systems. SIGPLAN Not. 21(11), 214–223 (1986)
Madsen, O.L., Mø-Pedersen, B., Nygaard, K.: Object-oriented programming in the BETA programming language. ACM Press/Addison-Wesley Publishing Co., New York, NY, USA (1993)
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)
Millstein, T.: Practical predicate dispatch. ACM SIGPLAN Notices 39(10), 345–364 (2004)
Nagy, I., Bergmans, L., Havinga, W., Aksit, M.: Utilizing design information in aspect-oriented programming. In: Hirschfeld, R., Kowalczyk, R., Polze, A., Weske, M. (eds.) Proceedings of International Conference NetObjectDays, NODe 2005, Erfurt, Germany. Lecture Notes in Informatics, vol. P-69, Gesellschaft für Informatik, GI (September 2005)
Notkin, D., Garlan, D., Griswold, W.G., Sullivan, K.J.: Adding Implicit Invocation to Languages: Three Approaches. In: Nishio, S. (ed.) ISOTAS 1993. LNCS, vol. 742, pp. 489–510. Springer, Heidelberg (1993)
Ostermann, K., Mezini, M.: Object-oriented composition untangled. In: Proc. OOPSLA 2001 Conf. Object Oriented Programming Systems Languages and Applications, pp. 283–299. ACM Press (2001)
Piumarta, I., Warth, A.: Open, extensible object models. In: Self-Sustaining Systems. Springer (2008)
Rajan, H., Sullivan, K.J.: Classpects: unifying aspect- and object-oriented language design. In: ICSE 2005: Proceedings of the 27th International Conference on Software Engineering, pp. 59–68. ACM Press, New York (2005)
Riehle, D., Gross, T.: Role model based framework design and integration. SIGPLAN Not. 33(10), 117–133 (1998)
Taivalsaari, A.: On the notion of inheritance. ACM Comput. Surv. 28(3), 438–479 (1996)
Tanter, É., Noyé, J.: A Versatile Kernel for Multi-language AOP. In: Glück, R., Lowry, M. (eds.) GPCE 2005. LNCS, vol. 3676, pp. 173–188. Springer, Heidelberg (2005)
Tarr, P., Ossher, H., Harrison, W., Sutton Jr., S.M.: N degrees of separation: Multi-dimensional separation of concerns. In: Proc. 21st Int’l Conf. Software Engineering (ICSE 1999), pp. 107–119. IEEE Computer Society Press (May 1999)
Thompson, S.: Programming Language Semantics using Miranda. Technical Report 9-95, University of Kent, Computing Laboratory, University of Kent, Canterbury, UK (May 1995)
Turner, D.: Miranda: A non-strict functional language with polymorphic types. In: Functional Programming Languages and Computer Architecture, vol. 201, pp. 1–16. Springer (1985)
Ungar, D., Smith, R.B.: Self: The power of simplicity. SIGPLAN Not. 22, 227–242 (1987)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Bergmans, L., Havinga, W., Aksit, M. (2012). First-Class Compositions. In: Leavens, G.T., Chiba, S., Haupt, M., Ostermann, K., Wohlstadter, E. (eds) Transactions on Aspect-Oriented Software Development IX. Lecture Notes in Computer Science, vol 7271. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-35551-6_6
Download citation
DOI: https://doi.org/10.1007/978-3-642-35551-6_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-35550-9
Online ISBN: 978-3-642-35551-6
eBook Packages: Computer ScienceComputer Science (R0)