0

I have a UDM (Universal Data Model) taken out of LEN SILVESTON’s book which I would like to implement as an object oriented design in C Sharp to model PARTIES, PERSONS & ORGANIZATIONS.

Although moving from the logical model SUPERTYPES and SUBTYPES is easily done via a class hierarchy, I am not sure how to deal with relationships. A many-to-many relationship in the relational world (physical database) world would typically be implemented into a separate association table. I have a feeling following this paradigm and implementing M-M relations as a separate ‘association” class in the object oriented world may not be the way to go…. Or is it?

Also, is anyone aware if any articles have been written on implementing these UDMs in an object oriented way?

Thanks for any pointers.

underwater
  • 191
  • 1
  • 11

1 Answers1

1

I have a feeling following this paradigm and implementing M-M relations as a separate "association" class in the object oriented world may not be the way to go.

Your feeling is right, in object-oriented world you don't have to have a separate association class to model many-to-many reliationships. The most common way to implement this is to use collections in each side of the association, resulting in a many-to-many association. Take a look at the following C# example of a many-to-many relationship:

class A {
    List<B> bs;
}

class B {
    List<A> as;
}
buc
  • 6,268
  • 1
  • 34
  • 51