Questions regarding oclAny.oclType



Date view Thread view Subject view Author view

Gruebsch, Michael (Michael.Gruebsch@ibykus.de)
Fri, 2 Feb 2001 14:13:26 +0100


In my project I want to describe the post condition for an override of the JAVA core function: boolean java.lang.Object.equals(java.lang.Object) Description available under http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html For that reason I need to do the following a) compare the type of self and the type of the argument (type must be equal) in a generic way (the type itself is unknown) b) compare all attributes and associations of self and the argument in a generic way (all members must be equal) Unfortunately oclAny.oclType has been dropped since UML 1.3 because it has been defined as operation resulting in a unique value (property) before. My questions are: 1st) Regarding my project: How can I solve a) and b) above by means of OCL? 2nd) If oclType is self-containing it is possible to define an operation: oclAny::oclTypes() : Set{oclType} post: result = oclType.allInstances()->select (T : oclType | self.oclIsKindOf/TypeOf(T)) Any remarks about that? Is there already a proposal for such an construct? 3rd) If oclType is not self-containing then both expressions "Set{oclType}" as well as "oclType.allInstances()" are undefined. In this case what were the solution to get on the meta level? In either way the definition is complex (IMHO): has oclType a type and what is it? OclType having a type implies that it (oclType or its type?) is a subtype of oclAny and that ocl- Type is self-containing. It would exclude the set-theoretical definition oclType = Set{oclAny} because collection-types do not belong to oclAny since UML 1.3. 4th) I read only the statement that a certain object may be- long to more than one type. What was the exact objection against oclAny::oclType() : oclType Is it founded in multi-inheritence? Thank you! -- michael.gruebsch@ibykus.de --------------------------------- >8 --


Date view Thread view Subject view Author view