Re: question on OCL



Date view Thread view Subject view Author view

Jos Warmer (J.Warmer@klasse.nl)
Mon, 03 Apr 2000 14:53:06 +0200


Hi Gerard, At 03:31 PM 31-03-00 +0200, GERARD Sebastien 166342 wrote: >Hy, > >I would like to express that the trigger event of a transition is always of >type CallEvent. >Is it right to write : > >Transiton: >self.trigger.oclAsType(CallEvent) > The operation 'oclAsType()' is a typecast and results in an object of the argument type. The statemanet above results in an object of type CallEvent. If you want to state that an object must be of a certain type you should use oclIsTypeOf() or oclIsKindOf(). The above expression becvomes: context Transition inv: self.trigger.isTypeOf(CallEvent) This results in true of the 'self.trigger' object is an instance of CallEvent. Jos _____________________________________________________ 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