Constraints in a Class Diagram
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Kieron_McGuire
Posted On:   Wednesday, April 28, 2004 09:15 PM

I am developing a domain model and am having trouble representing constraints upon the associations between related business entities. Specifically, I wish to represent the following: * We have multiple (legacy) coding schemes for Items. * Within each coding scheme, an Item is represented by only one code. * An Item can be represented by multiple codes (on for each coding scheme). * Within a coding scheme, the same code can represent multiple Items (as our legacy coding schemes are not as specific as our current Items) I can represent this as follows: Scheme (1) -------- (0..n) Code (0..n) ---------- (0..n) Item    More>>

I am developing a domain model and am having trouble representing constraints upon the associations between related business entities. Specifically, I wish to represent the following:


* We have multiple (legacy) coding schemes for Items.

* Within each coding scheme, an Item is represented by only one code.

* An Item can be represented by multiple codes (on for each coding scheme).

* Within a coding scheme, the same code can represent multiple Items (as our legacy coding schemes are not as specific as our current Items)


I can represent this as follows:


Scheme (1) -------- (0..n) Code (0..n) ---------- (0..n) Item


This shows that a scheme contains many codes. It shows that a code belongs to one scheme. It shows that a code can represent multiple items. It shows that an item can be represented by multiple codes. However, it does not show that an item can only have one code PER SCHEME. How can I represent this on a class diagram?


Thanks,

Kieron

   <<Less

Re: Constraints in a Class Diagram

Posted By:   Anonymous  
Posted On:   Sunday, May 2, 2004 05:50 AM

The only thing that comes to my mind is using a natural language constraint on the association:


Scheme (1) -------- (0..n) Code (0..n) ------------------------------------ (0..n) Item
[max. 1 per Scheme]
About | Sitemap | Contact