Multiple to single inheritance transformation June 15th, 2004
-
Upload
abbot-sanders -
Category
Documents
-
view
34 -
download
2
description
Transcript of Multiple to single inheritance transformation June 15th, 2004
D1 - 19/04/23
The present document contains information that remains the property of France Telecom. The recipient’s acceptance of this document implies his or her acknowledgement of the confidential nature of its contents and his or her obligation not to reproduce, transmit to a third party, disclose or use for commercial purposes any of its contents whatsoever without France Telecom’s prior written agreement.
confidential
Multiple to singleinheritancetransformation
June 15th, 2004
M. Dao, M. Huchard, T. Libourel,
A. Pons, J. Villerd
France Telecom R&D Distribution of this document is subject to France Telecom’s authorization D2 - 19/04/23
confidential
Multiple inheritance: a new birth?
s OO programming languages and MI:Q"good" implementation in not so popular languages: Eiffel, CLOS, …Q"bad" implementation in once popular languages: C++, …?Q"no" implementation in today popular languages: Java (MI interfaces though), C#, …?
s Not much excitement about MI lately, but…
s …the modelling era has begun!QWhen you model, for instance in UML, you can use MI (almost) without moderation
France Telecom R&D Distribution of this document is subject to France Telecom’s authorization D3 - 19/04/23
confidential
MI to SI transformation
s High-level MI models may eventually need to be transformed into SI models ("popular" OO languages, for instance)
s Two possible approaches (among others?)Q"combinatorial": cut inheritance links to obtain SI
–need to duplicate class properties–how to choose those inheritance links
–based on inheritance metrics (Roume 02)
Q"semantic": classify MI situations and transform MI into SI
–use UML annotations to precise different MI situations–apply the "most appropriate" inheritance transformation
France Telecom R&D Distribution of this document is subject to France Telecom’s authorization D4 - 19/04/23
confidential
UML inheritance annotations
s Discriminators allow to group inheritance links that share a same semantic
s Constraints on subsets of instances of a class: complete, disjoint, incomplete, overlapping
s We propose new constraints:Qconcurrent (special case of overlapping)Qsuccessive, exclusive (special case of disjoint)QcombinedQalternative
France Telecom R&D Distribution of this document is subject to France Telecom’s authorization D5 - 19/04/23
confidential
UML inheritance annotations
Employee
SalariedEmployee
ExemptEmployee
HourlyEmployee
VestedEmployee
UnvestedEmployee
:pension:status
VestedExemptEmployee
{disjoint,incomplete} {disjoint,complete}
DiscriminatorsConstraints
France Telecom R&D Distribution of this document is subject to France Telecom’s authorization D6 - 19/04/23
confidential
MI transformations
s DuplicationQcut one inheritance link and duplicate formerly inherited properties in the subclass
s Nested generalizationsQcreate a class for each possible MI situation
s Direct linkQmake the leaf class directly inherit from root class
s Role aggregationQreplace one MI link by an aggregation
s Class mergeQreplace all classes with one
France Telecom R&D Distribution of this document is subject to France Telecom’s authorization D7 - 19/04/23
confidential
Example of transformation
Employee
SalariedEmployee
ExemptEmployee
HourlyEmployee
VestedEmployee
UnvestedEmployee
:pension:status
VestedExemptEmployee
{disjoint,incomplete} {disjoint,complete}
France Telecom R&D Distribution of this document is subject to France Telecom’s authorization D8 - 19/04/23
confidential
The right transformation for the right inheritance situation
s Our proposition:Qelaborate a list of possible MI "situations" based on UML extended annotations and other criteria (size, symmetry, etc.)Qfor each situation, propose a suitable MI transformation
s ExamplesQrole aggregation transformation might be used with complete constraint: the structure will not evolveQdirect link transformation might be used when symmetry is important for example in the case of the alternative constraint
France Telecom R&D Distribution of this document is subject to France Telecom’s authorization D9 - 19/04/23
confidential
Perspectives
s elaborate a list of MI situations as complete as possibleQa situation might be a subsituation of another: classification
s try and find a most appropriate MI transformation for each situation
s difficulties:–be able to automatically detect MI situations–different MI situations may overlap–order of transformations?
s use of a model transformation language?
s study an "hybrid" approach (combinatorial and semantic)?