Re: OCL Question: Containing Package



Date view Thread view Subject view Author view Attachment view

From: Tim Klinger (tklinger@us.ibm.com)
Date: Sat 13 Sep 2003 - 13:19:34 BST


Edward,

Assuming your model has a class named "Class" and a class named "Package" 
both with a "name" attribute; and Class also has an association to Package 
called "package", you can write:

context Class 
inv: name = 'C' implies package.name = 'P'

This will constrain every instance of Class whose name is "C" to have a 
Package named "P".

--Tim

Tim Klinger, Ph.D.
Center for Software Engineering, 
IBM T. J. Watson Research Center
e-mail: tklinger@us.ibm.com
Phone: (914)784-7114;  Fax: (914)784-6401; Tie line 863.




"Edward Sattari" <edw_s@mail.com>
Sent by: puml-list-request@cs.york.ac.uk
09/12/2003 10:37 PM
Please respond to puml-list
 
        To:     puml-list@cs.york.ac.uk
        cc: 
        Subject:        OCL Question: Containing Package


Hello,

Is it possible to express the follwing consatraint by OCL? (How?)

If a Class name is 'C', it must be in a package named 'P'.

Thanks,
Edward

-- 
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers




To remove yourself from this list please mail 
puml-list-request@cs.york.ac.uk
with a message containing the word "unsubscribe".

Date view Thread view Subject view Author view Attachment view