Reusable and interactive classes: a new way of object composition

Reusable and interactive classes: a new way of object composition

Separating object features from base classes is one of the popular ways of software development. Somepopular programming approaches like object-oriented programming, feature-oriented programming, and aspect-orientedprogramming follow this approach. There are four advantages of using features: 1) Instantiability: the ability to createinstances of a feature, 2) Reusability: the quality of a feature being reusable in many compositions, 3) Loosely coupledcomposability: the ability to compose/decompose features easily at object instantiation time (not offering new datatypes for compositions), and 4) Interactability: the ability of a feature to crosscut (interact with) other features insidethe object. Existing approaches do not find strong evidence to support these advantages altogether. In this paper, wepropose a new approach that provides all the advantages mentioned above. In our approach, each feature is developedas a class that can be instantiated or reused. A new composition method is also proposed to compose features of anobject where it is instantiated. In such a way, a feature can be either a complete object or part of a big object. In fact,composing different reusable features yields object variations, since features can be easily added/removed in a looselycoupled manner. To make features interactive, we augment them with events. Events provide the interactions among thedifferent features of an object. We show that events are soft dependencies that do not affect the reusability of featureswhile method callings in inheritance-based models do.

___

  • [1] Abilio R, Vale G, Figueiredo E, Costa H. Metrics for feature-oriented programming. In: Proceedings of the 7th International Workshop on Emerging Trends in Software Metrics, WETSoM ’16; New York, NY, USA; 2016. pp. 36-42.
  • [2] Batory D, Sarvela J N, Rauschmayer A. Scaling step-wise refinement. IEEE Transactions on Software Engineering 2004; 30 (6): 355-371. doi: 10.1109/TSE.2004.23
  • [3] Batory D, O’Malley S. The design and implementation of hierarchical software systems with reusable components. ACM Transactions on Software Engineering and Methodology (TOSEM) 1992; 1 (4): 355-398. doi: 10.1145/136586.13658
  • [4] Bracha G, Cook W. Mixin-based inheritance. SIGPLAN Not. 1990; 25 (10): 303-311. doi: 10.1145/97946.97982
  • [5] Duggan D, Techaubol CC. Modular mixin-based inheritance for application frameworks. SIGPLAN Not. 2001; 36 (11): 223-240. doi: 10.1145/504311.504299
  • [6] Flatt M, Krishnamurthi S, Felleisen M. Classes and mixins. In: Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’98; New York, NY, USA; 1998. pp. 171-183.
  • [7] Gamma E, Helm R, Johnson R, Vlissides J. Design Patterns: Elements of Reusable Object-oriented Software. Boston, MA, USA: Addison-Wesley, 1995.
  • [8] Herrmann S. A precise model for contextual roles: the programming language ObjectTeams/Java. Applied Ontology 2007; 2 (2): 181-207.
  • [9] Jackson M, Zave P. Distributed feature composition: a virtual architecture for telecommunications services. IEEE Transactions on Software Engineering 1998; 24 (10): 831-847. DOI: 10.1109/32.729683
  • [10] Keene SE. A Programmer’s Guide to Object-oriented Programming in Common LISP. Boston, MA, USA: AddisonWesley Longman Publishing Co., 1988.
  • [11] Kiczales G, Lamping J, Mendhekar A, Maeda C, Lopes C et al. Aspect-oriented programming. In: ECOOP’97 — Object-Oriented Programming; Berlin, Heidelberg; 1997. pp. 220-242.
  • [12] Maniyath J. Design patterns generic models. In: Proceedings of the 18th Conference on Pattern Languages of Programs, PLoP ’11; New York, NY, USA; 2011, pp. 14:1-14:5.
  • [13] Mertgen A. Decoupling context: Introducing quantification in object teams. In: Proceedings of the 2012 Workshop on Modularity in Systems Software, MISS ’12; New York, NY, USA; 2012. pp. 45-50.
  • [14] Moon DA. Object-oriented programming with flavors. In: Conference Proceedings on Object-oriented Programming Systems, Languages and Applications, OOPSLA ’86; New York, NY, USA; 1986. pp. 1-8.
  • [15] Niculescu V. Mixdecorator: An enhanced version of decorator pattern. In: Proceedings of the 20th European Conference on Pattern Languages of Programs, EuroPLoP ’15; Kaufbeuren, Germany; 2015. pp. 36:1-36:12.
  • [16] Nystrom N, Qi X, Myers AC. J&: Nested intersection for scalable software composition. SIGPLAN Not. 2006; 41 (10): 21-36. doi: 10.1145/1167515.1167476
  • [17] Ossher H, Tarr P. Using multidimensional separation of concerns to (re)shape evolving software. Communications of the ACM 2001; 44 (10): 43-50. doi: 10.1145/383845.383856
  • [18] Prehofer C. From inheritance to feature interaction or composing monads. In: Informatik ’97 Informatik als Innovationsmotor; Berlin, Heidelberg; 1997. pp. 562-571.
  • [19] Prehofer C. Feature-oriented programming: A fresh look at objects. In: ECOOP’97— Object-Oriented Programming; Berlin, Heidelberg; 1997. pp. 419-443.
  • [20] Prehofer C. An object-oriented approach to feature interaction. In: Fourth IEEE Workshop on Feature Interactions in Telecommunications Networks and Distributed Systems; Hyderabad, India; 1997. pp. 313-325.
  • [21] Prehofer C. Feature-oriented programming: a new way of object composition. Concurrency and Computation: Practice and Experience 2001; 13 (6): 465-501. doi: 10.1002/cpe.583
  • [22] Smaragdakis Y, Batory D. Mixin layers: an object-oriented implementation technique for refinements and collaboration-based designs. ACM Transactions on Software Engineering and Methodology (TOSEM) 2002; 11 (2): 215-255. doi: 10.1145/505145.505148
  • [23] Smaragdakis Y, Batory DS. Implementing layered designs with mixin layers. In: Proceedings of the 12th European Conference on Object-Oriented Programming, ECCOP ’98; Berlin, Heidelberg; 1998. pp. 550-570.
  • [24] Tarr P, Ossher H, Harrison W, Sutton, Jr. SM. N degrees of separation: Multi-dimensional separation of concerns. In: Proceedings of the 21st International Conference on Software Engineering, ICSE ’99; New York, NY, USA; 1999. pp. 107-119.
  • [25] Thüm T, Apel S, Zelend A, Schröter R, Möller B. Subclack: feature-oriented programming with behavioral feature interfaces. In: Proceedings of the 5th Workshop on MechAnisms for Specialization, Generalization and inHerItance, MASPEGHI ’13; New York, NY, USA; 2013. pp. 1-8.
  • [26] VanHilst M, Notkin D. Using role components in implement collaboration-based designs. SIGPLAN Not. 1996; 31 (10): 359-369. doi: 10.1145/236338.236375
  • [27] Zave P. Feature interactions and formal specifications in telecommunications. IEEE Computer 1993; 26 (8): 20-30. doi: 10.1109/2.223539
  • [28] Zave P. An experiment in feature engineering. In: McIver A and Morgan C (editors). Programming Methodology. New York, NY, USA: Springer New York, 2003, pp. 353-377.OI: 10.1109/32.729683