From: Tim Klinger (email@example.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: firstname.lastname@example.org Phone: (914)784-7114; Fax: (914)784-6401; Tie line 863. "Edward Sattari" <email@example.com> Sent by: firstname.lastname@example.org 09/12/2003 10:37 PM Please respond to puml-list To: email@example.com 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 firstname.lastname@example.org with a message containing the word "unsubscribe".