Re: Questions regarding oclAny.oclType



Date view Thread view Subject view Author view

Jos Warmer (J.Warmer@klasse.nl)
Sat, 24 Mar 2001 16:55:19 +0100


Michael, my feedback in intertwened with your questions, Regards, Jos At 02:13 PM 2/2/01 +0100, Gruebsch, Michael wrote: >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? It seems to me you can't. >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? I take the above as a proposal and put it forward to the OCL 2.0 submission team. >3rd) If oclType is not self-containing then both expressions > "Set{oclType}" as well as "oclType.allInstances()" are > undefined. Set(OclType) isn't a problem, but the 'allInstances' is. > In this case what were the solution to get on the meta > level? In OCL we want to restrict the meta-level facilities as much as possible. Typechecking as tou request should be possible however. I do not know how we can solve this in OCL 2.0 >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. Right. >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? No, in UML an objectb may have multiple types, without having multiple inheritance. This is not implemented in most OO langauges, but UML is more generic with respect to this. >Thank you! > I hope this helps. >-- michael.gruebsch@ibykus.de --------------------------------- >8 -- > > > >To remove yourself from this list please mail puml-list-request@cs.york.ac.uk >with a message containing the word "unsubscribe". _____________________________________________________ Klasse Objecten tel : +31 (0)35 6037646 Chalonhof 153 fax : +31 (0)35 6037647 3762 CT Soest email : J.Warmer@klasse.nl The Netherlands internet: http://www.klasse.nl


Date view Thread view Subject view Author view