Re: Re: OCL Question



Date view Thread view Subject view Author view

Les Munday (baldrick@ureach.com)
Tue, 30 Oct 2001 17:22:24 -0500


Let me try to reply to all responses in one shot. My comments are embedded below: ---- On Sun, 28, Jos Warmer (J.Warmer@klasse.nl) wrote: > > At 06:46 PM 26/10/01 -0400, Les Munday wrote: > >I'm trying to demonstrate how to represent class operations in > >UML. > > Do you mean "class operations" which are performed by the class instead > of the instance (like static operations in C++ or Java)? This doesn't > show in > your exaples. > [Les]No, I mean operations that are part of an instantiated class instance. > >I have a template I use that is of the format: > > > >Precondition -> Stimulus -> {Action} -> Postcondition -> Time. > > > >The precondition describes the state the system must be in > >prior to the operation occuring. > > > >The stimulus is an event that triggers the operation. > > > >The action describes the process that occurs a result of the > >event occuring {and is optional}. > > > >The postcondition is the state that the system is in at the > >completion of the operation. > > > >Time is the maximum time for the operation to complete. > > > >So far I have: > > > >context ClassName::OPerationName::ReturnResult > >pre olcInState() > >post ActionResult and oclInState() > > > >Any ideas how to reference an event from my model and how to > >specify time to execute in OCL? > > If the event is the cause of the operations, should the operation get > the event as one of its parameters? If not, UML doesn't define how > to "access" an event. > [Les]I'm not sure about UML, but I use Rose and this allows events to initiate operations through state diagrams. > In UML an event can be many things, e.g an operation call or a receipt > of a signal. What kind of event do you want to refer to? > [Les]I refer to the anaysis type of event, where the system recognises a change to the state of the external world and generates an internal event to take appropriate action in response to this change of state. > >Any references to OCL examples would be helpful. > > > >Thanks, > > > >Leslie. > > Regards, Jos Warmer ---- On Mon, 29 Oct 2001, Shane Sendall (Shane.Sendall@epfl.ch) wrote: > Hi Les, > I think what you need first of all is a (UML) statemachine. It gives you > > Event -> Guard -> Action. [Les]Yes, I am modeling with state machines. You can then describe the action as an > operation with pre- and postconditions written in OCL. [Les]That's exactly what I am doing. We (myself and > Alfred Strohmeier) in fact have done some work on this area, e.g., we > proposed a small extension to UML statemachines to model timing > constraints, e.g., the duration of a fired transition must be between a > certain interval, and various other related stuff. > We had a paper at the UML conference that discusses this (and other > stuff). If you're interested, it can be found here: > http://lglwww.epfl.ch/cgi- bin/htgrep/file=bibliographies/lgl.ref&style=&refer=plain&max=2 50&query=&qry_footer=footer.html&ftpstyle=file&grab=&linemode=& hdr=hdr_publ.html&abstract=yes?Send01a > > I would be most interested in your feedback or questions. > [Les] I've got a copy and will send you feedback. > Cheers, > Shane > ---- On Sun, 28 Oct 2001, ahmad Gaafar (ahmad_gaafar@hotmail.com) wrote: > the OCL DOcument , or Any papers > didn't mention how to refer to an event in an OCL expresion > this is (I think brcause of) the type Heirarchy of the OCL does not > contain > any type of something like Event or stimulus, so > I suggest the Following by modifying the Class model metamodel!: [Les]Woh!, slow down, I'm just starting to experiment with the predefined OCL. I don't want to be touching no meta-models yet. > * You Can add a new property to the operation and call it maxTime, so > when > you defien an operation within a class you can specify its max time and > it > will be accessible from the OCL expression. > * You can model your events in model with dynamic features (State > Transition), any way to express an event in an OCL expression it must be > one > of Two Ways (Modify the metamodel of the corresopnding moded and > introduce > what are you interested in about models), or you need to define this > type in > the OCL , and I think the first solution is better. > If Any comments I would to exchange experiences, > Thanks for youyr time > A.HAni [Les]In the absence of direct references to events in OCL, I think what I need to do is reference the data that is used by the system to recognise the change of state. Taking the above example, I can recognise a timeout as : if Time>MaxTime then eventHasOccurred AND My original example becomes : context ClassName::OPerationName::ReturnResult pre olcInState() and variableValueChanges post ActionResult and oclInState() I think there is a common comcensus that events and transitions could be given more consideration by the OCL. Les. ________________________________________________ Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag


Date view Thread view Subject view Author view