RE: Time in OCL



RE: Time in OCL

From: Waldin, Earl ^lt;Earl.Waldin@paranor.ch>
Date: Mon 31 Oct 2005 - 09:49:17 GMT
Message-ID: <1DE41A26EA92CA4FB831A9449AB0841E52F224@srv-par2.paranor.ch>
Hi

The problem with the TimeX metaclasses of UML 2.0 is that they do not define a standard concrete syntax for actually specifying time expressions. The closest you get is in the notation section for TimeExpression:

  "A TimeExpression is a value of absolute time given in an implementation specific textual format. 
  Often a TimeExpression is a non-negative integer expression representing the number of "time ticks"
  after some given starting point."

All the other metaclasses for time are defined in terms of TimeExpression. So TimeExpression is the key metaclass.

These metaclasses won't help you if you want to express time using OCL. And if you want to use them to express time precisely, then you will have to either borrow a time language or invent one of your own. The UML Profile for Schedulability, Performance, and Time may help you here, but it is not simple!

If you want to stick with OCL then the technique outlined by Richard Mitchell is relatively straightforward. After looking at various options it is the solution we adopted.

	-Earl Waldin

----------------------------------------------------------------------
Earl Waldin				tel: +41 31 828 9222
Paranor AG				fax: +41 31 828 9299
Juraweg 14				email: earl.waldin@paranor.ch
CH-3046 Wahlendorf
Switzerland
----------------------------------------------------------------------


> -----Original Message-----
> From: puml-list-request@cs.york.ac.uk 
> [mailto:puml-list-request@cs.york.ac.uk] On Behalf Of Aline 
> Lķcia Baroni
> Sent: Friday, 28 October, 2005 16:37
> To: puml-list@cs.york.ac.uk
> Subject: Re: Time in OCL
> 
> 
> Dear Irfan,
> 
> Sequence diagrams enable the representation of time and duration 
> constraints. These concepts are in the metaclasses TimeConstraint, 
> TimeInterval, TimeEvent, TimeExpression and TimeObservationAction for 
> constraints on time. There are equivalent metaclasses for 
> constraints on 
> duration. See the package CommonBehaviors - Simple Time.
> 
> Regards,
> Aline L. Baroni
> 
> ----- Original Message ----- 
> From: "Steffen Zschaler" <sz9@inf.tu-dresden.de>
> To: <puml-list@cs.york.ac.uk>
> Sent: Friday, October 28, 2005 1:20 PM
> Subject: Re: Time in OCL
> 
> 
> > Dear Irfan,
> >
> > OCL per se does not support such constraints. There is some limited 
> > support for timing constraints in the UML, though (I think 
> in the area of 
> > sequence diagrams). Other than that, you may want to check 
> out the "UML 
> > Profile for Scheduling, Performance, and Time 
> Specification" if your 
> > interest is mainly in performance engineering, or languages 
> like QML or 
> > CQML (and CQML+) if your interest lies more in the area of 
> guaranteed 
> > real-time properties.
> >
> > Best wishes,
> >
> > Steffen
> >
> > Irfan Hamid wrote:
> >
> >> Hi,
> >>
> >> Is there a way to use time expressions in OCL? Like in the 
> postcondition 
> >> can I use an expression such as
> >>
> >> time@pre or time( )@pre
> >>
> >> I need this to be able to express real-time constraints on 
> operations.
> >>
> >> Regards,
> >> Irfan.
> >>
> >
> > -- 
> > Dipl.-Inf. Steffen Zschaler
> > Research Assistant
> >
> > Technische Universitšt Dresden
> > Department of Computer Science
> >
> > Phone +49 351 463 38555
> > Fax   +49 351 463 38459
> > Email Steffen.Zschaler@inf.tu-dresden.de
> > WWW   http://www.steffen-zschaler.de.vu/
> >
> >
> >
> >
> > To remove yourself from this list please mail 
> > puml-list-request@cs.york.ac.uk
> > with a message containing the word "unsubscribe".
> >
> >
> >
> > -- 
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.1.362 / Virus Database: 267.12.5/150 - Release 
> Date: 27-10-2005
> > 
> 
> 
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.12.5/150 - Release 
> Date: 27-10-2005
> 
> 
> 
> 
> To remove yourself from this list please mail 
> puml-list-request@cs.york.ac.uk
> with a message containing the word "unsubscribe".
> 
> 
Received on Mon Oct 31 09:49:26 2005