Journals / Turkish Journal of Electrical Engineering and Computer Sciences / 2019 / Cilt: 27 - Sayı: 5

Reusable and interactive classes: a new way of object composition

Pages
3615–3632
DOI
—

Abstract

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.