1

Currently I am working on a part of a bigger project, but I am not quite sure how to approach this part of the system.

UML class diagram made in PowerDesigner

Each individual can be married multiple times, each marriage needs to have an officiant, partner1, partner2 and witnesses. Individuals can represent these roles in multiple marriages.

I am wondering if there is a way to represent all of the necessary individuals with less associations, since the diagram quickly turns into a mess when looking at the whole system.

Updated class diagram

2 Answers2

2

Replace partner1 and partner2 by partner with multiplicity 2, and of course same for partnerWitness

individualId and marriageId are wrong because written underlined that mean they are static. Probably they are primary-key, but they are instance-member, not class-member. You can also name them id, useless to have a prefix

What is statusPartner ? is that can be supported by a class-association ?

The separated relation Individual -> Marriage is wrong because like that it can be for a marriage which not the same as the marriage the individual participate whatever its role, and this is not what you want. So remove it and use bidirectional relations

From your remark

statusPartner is simply status of the partner before marriage (divorced, widow and so on)

that enforce to manage it through a class-association :

  • With only partner you cannot know for who is statusPartner1 and statusPartner2, of course you do not have that problem in case of a class-association.
  • You can also move that attribute in Individual but in that case it exist not only for the partner and that has no lot of sense to have it

So for instance :

enter image description here

Note it is also possible to use only one relation for both the officiant and witness using a class-association :

enter image description here

with a constraint saying there are two Individuals with the role witness and one with the role officiant

The role can also be an enumeration or replaced by the isWitness being a boolean etc.

It is also possible to use only one class-association :

enter image description here

with a first constraint saying the role of a Partner is partner and a second saying at a marriage there are two Individuals with the role witness and one with the role officiant and two with the role partner

bruno
  • 32,421
  • 7
  • 25
  • 37
  • @bruno statusPartner is simply status of the partner before marriage (divorced, widow and so on). Thank you for your help! – bunnytechnician Jul 18 '20 at 10:24
  • @bunnytechnician that enforce the class-association, I edited my answer, please reread it – bruno Jul 18 '20 at 10:32
  • I added an updated image above, I hope that is what you had in mind. Again, thank you for your advice! – bunnytechnician Jul 18 '20 at 11:50
  • @bunnytechnician no, I edited my answer to put a first diagram corresponding to the first version of my answer, and 2 others for two other ways to do – bruno Jul 18 '20 at 13:12
  • The next step is to make `Mariage` a specialization of `Contract`, enlarge the enumeration of roles to add parties, generalise the associations with individuals by settling it at level of the contract, and leave the specific contraints to the mariage ;-) – Christophe Jul 18 '20 at 16:21
  • @bruno Your specialization of an association class is very inspiring, and lead me to asks this question: https://stackoverflow.com/q/62973692/3723423 for UML language-lawyers ;-) – Christophe Jul 18 '20 at 21:00
  • @Christophe yes there are lot of ways to model. It is probably the first time I specialize a class-association. I answer to your question https://stackoverflow.com/q/62973692/3723423 – bruno Jul 19 '20 at 09:39
0
  1. Perfectly! But notice that in the beginning there were partner1Witness and partner2Witness, that is, each partner has his own witness.
  2. first constraint saying the role of a Partner is partner and a second saying at a marriage there are two Individuals with the role witness and one with the role officiant and two with the role partner may be diagramming

Possible scheme in the picture enter image description here

bruno
  • 32,421
  • 7
  • 25
  • 37
  • The OP requested a way to *simplify* its model, why do you propose a more complex model ? Also why the dissymmetry between Partner and Partner Witness ? – bruno Jul 19 '20 at 15:35