Separating object features from base classes is one of the popular ways of software development. Some popular programming approaches like object-oriented programming, feature-oriented programming, and aspect-oriented programming follow this approach. There are four advantages of using features: 1) Instantiability: the ability to create instances of a feature, 2) Reusability: the quality of a feature being reusable in many compositions, 3) Loosely coupled composability: the ability to compose/decompose features easily at object instantiation time (not offering new data types for compositions), and 4) Interactability: the ability of a feature to crosscut (interact with) other features inside the object. Existing approaches do not find strong evidence to support these advantages altogether. In this paper, we propose a new approach that provides all the advantages mentioned above. In our approach, each feature is developed as a class that can be instantiated or reused. A new composition method is also proposed to compose features of an object 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 loosely coupled manner. To make features interactive, we augment them with events. Events provide the interactions among the different features of an object. We show that events are soft dependencies that do not affect the reusability of features while method callings in inheritance-based models do.
MASOUMI, SAEID and MAHJUR, ALI
"Reusable and interactive classes: a new way of object composition,"
Turkish Journal of Electrical Engineering and Computer Sciences: Vol. 27:
5, Article 25.
Available at: https://journals.tubitak.gov.tr/elektrik/vol27/iss5/25