1 / 9

Multiple to single inheritance transformation June 15th, 2004

Multiple to single inheritance transformation June 15th, 2004. M. Dao , M. Huchard, T. Libourel, A. Pons, J. Villerd. Multiple inheritance: a new birth?. OO programming languages and MI: "good" implementation in not so popular languages: Eiffel, CLOS, …

Download Presentation

Multiple to single inheritance transformation June 15th, 2004

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Multiple to singleinheritancetransformationJune 15th, 2004 M. Dao, M. Huchard, T. Libourel, A. Pons, J. Villerd

  2. Multiple inheritance: a new birth? • OO programming languages and MI: • "good" implementation in not so popular languages: Eiffel, CLOS, … • "bad" implementation in once popular languages: C++, …? • "no" implementation in today popular languages: Java (MI interfaces though), C#, …? • Not much excitement about MI lately, but… • …the modelling era has begun! • When you model, for instance in UML, you can use MI (almost) without moderation

  3. MI to SI transformation • High-level MI models may eventually need to be transformed into SI models ("popular" OO languages, for instance) • Two possible approaches (among others?) • "combinatorial": cut inheritance links to obtain SI • need to duplicate class properties • how to choose those inheritance links • based on inheritance metrics (Roume 02) • "semantic": classify MI situations and transform MI into SI • use UML annotations to precise different MI situations • apply the "most appropriate" inheritance transformation

  4. UML inheritance annotations • Discriminators allow to group inheritance links that share a same semantic • Constraints on subsets of instances of a class: complete, disjoint, incomplete, overlapping • We propose new constraints: • concurrent (special case of overlapping) • successive, exclusive (special case of disjoint) • combined • alternative

  5. UML inheritance annotations Discriminators Constraints Employee {disjoint,complete} {disjoint,incomplete} :status :pension UnvestedEmployee SalariedEmployee HourlyEmployee VestedEmployee ExemptEmployee VestedExemptEmployee

  6. MI transformations • Duplication • cut one inheritance link and duplicate formerly inherited properties in the subclass • Nested generalizations • create a class for each possible MI situation • Direct link • make the leaf class directly inherit from root class • Role aggregation • replace one MI link by an aggregation • Class merge • replace all classes with one

  7. Example of transformation Employee {disjoint,complete} {disjoint,incomplete} :status :pension UnvestedEmployee HourlyEmployee SalariedEmployee VestedEmployee ExemptEmployee VestedExemptEmployee

  8. The right transformation for the right inheritance situation • Our proposition: • elaborate a list of possible MI "situations" based on UML extended annotations and other criteria (size, symmetry, etc.) • for each situation, propose a suitable MI transformation • Examples • role aggregation transformation might be used with complete constraint: the structure will not evolve • direct link transformation might be used when symmetry is important for example in the case of the alternative constraint

  9. Perspectives • elaborate a list of MI situations as complete as possible • a situation might be a subsituation of another: classification • try and find a most appropriate MI transformation for each situation • difficulties: • be able to automatically detect MI situations • different MI situations may overlap • order of transformations? • use of a model transformation language? • study an "hybrid" approach (combinatorial and semantic)?

More Related