"Oswaldfig" <Os*******@discussions.microsoft.coma écrit dans le message de
news:
A3**********************************@microsoft.com...
| I'm a newbie in C# and i am looking for a simple yet clearly code
example
| of an association between two classes (a multiciplity association for
| example) to help me understand a bit more of UML.
|
| [class1] <- 0..1 --------- 0..* -[class2]
The ordinality of this example relationship is not really very useful. It
states that 0 or 1 instances of class1 can be related to 0 or more instances
of class2.
IMO, it would be more normal to fix the class1 end at 1 and then you have a
classic one-to-many relationship; whereas, if you change class 2 to have an
ordinality of 1..*, then you have a "lookup" relationship where an optional
class1 can be related to any number of class2.
Having 0 in either end signifies optionality, 1 signifies "compulsarity".
HTH
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer