RE: the constraint {xor}



Date view Thread view Subject view Author view

Jos Warmer (J.Warmer@klasse.nl)
Wed, 09 Feb 2000 12:15:50 +0100


Sebastien, >>1) If one considers the following class model, what does really mean that >>both associations are connected through the constraint {xor}? >>My interpretation is : >>There are no instances of A which share with an instance of B the use of an >>instance of C. >>Is it right? >> +---+ +------+ | A |-----------| | +---+ /|\ | | | | {xor}| | C | | | +---+ \|/ | | | B |-----------| | +---+ +------+ UML defines this as follows: a C instance has either a link to a B instance or(exclusive) a link to an A instance. >From this you can deduce that an A and a B instance cannot have a link to the same C instance. Therefore you are right. >> <<...>> >> >>2) My second question is about the specification of an OCL statement I have >>some trouble to write. I would like to express >>that the instance a of A and the instance b of B may share the use of the >>instance c of C. >>I know I can use collaboration diagram to express this feature. But I would >>rather specify a constraint within the class diagram. As Mark already answered, this is the default meaning in UML. Regards, Jos _____________________________________________________ Klasse Objecten tel : +31 (0)35 6037646 Chalonhof 153 fax : +31 (0)35 6037647 3762 CT Soest email : J.Warmer@klasse.nl The Netherlands internet: http://www.klasse.nl


Date view Thread view Subject view Author view