Re: Constraints on associations



Date view Thread view Subject view Author view Attachment view

From: Adrian CARCU (adi1302@yahoo.com)
Date: Sat 21 Jun 2003 - 10:01:46 BST


Edward,

Here is the code:

package Foundation::Core
   context ModelElement
      def: let is(s:String):Boolean=self.stereotype->exists(name=s)

   context Association
      inv: self.is("S") implies 
              self.connection.participant->
                 forAll(a,b|(a.is("A") and b.is("B")) or 
                            (a.is("B") and b.is("is")))
endpackage

Best regards,
Adrian

--- Edward Sattari <edw_s@mail.com> wrote:
> Hello,
> 
> Suppose we have defined a stereotype S for associations, and stereotypes A
> and B for classes.
> 
> How can we express the following constraint by OCL?
> 
> Associations that are stereotyped S are only permitted between two classes
> that one of them is stereotyped A and the other is stereotyped B.
> 
> Thanks,
> Edward
> -- 
> __________________________________________________________
> Sign-up for your own FREE 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".
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

Date view Thread view Subject view Author view Attachment view