From: Ahmad Hani (email@example.com)
Date: Thu 24 Jun 2004 - 18:44:34 BST
Hello all, first I would like to thank who replied my last question titled "OCL equal (=) operator , comparing identities" I have reached the following way to solve the problem of comparing of different types I would like to know if it is correct let obj1:oclAny = c1.oclAsType(oclAny). let obj2:oclAny = b1.oclAsType(oclAny) obj1 = obj2 it is known that oclAny is the supertype of all types in OCL and UML. and the = operation is defined on the level of oclAny class. the question is the operation oclAsType is defined as following from the OCL 2.0 draft --The following part is copied from OCL 2.0 draft. oclAsType(typename : OclType) : T Evaluates to self, where self is of the type identified by typename. Typename may be in the format Package::sub-Package:: classifier. post: (result = self) and result.oclIsTypeOf( typeName ) --end of copy as we can see the oclAsType takes a parameter of type oclType or any of its decendants, this makes it not possible for example to compare an instance of type real to an instance for example of a user defined type student, am I right?