A colleague asked me if OCL had a getType function in the standard library that could be used to get the type of an object.

The answer, AFAIK, is no. There are the oclIsKindOf(Type) and oclIsTypeOf(Type) functions to test whether an object is instance of a given type and the oclAsType to do type conversions but I don´t think there is one to get the type of the object.

Anyone knows whether this function exist? (even if it´s not as part of the standard but provided in OCL implementations). If it doesn´t, any idea why?

Want to build better software faster?

Want to build better software faster?

Read about the latest trends on software modeling and low-code development

You have Successfully Subscribed!

Pin It on Pinterest

Share This