2

This may sounds stupid but I am confused with the multiplicity between two classed in UML class diagram.

The classes are admin and payment.

It is very clear that

1 admin can accept 0..* payment,

but I'm not sure about can 0..* payment accepted by 1 admin or 1..* admin?

If were talking about that particular payment at that moment, the payment is only handling by 1 admin(of course) but in a bigger picture many different payments can be accepted by many different admins right?

I already tried to search through Google for many examples but can't relate them to my case. My question is the same as: 1 house can has many rooms, and so many rooms is having by 1 house, but in bigger picture many different houses can have many rooms also. (right?)

I expect someone could explain more detail for me, thanks in advance..

1 Answers1

0

The multiplicity refers to the number for the instances of the model. Do in your examples for an insurance of a payment it is handled by 1 admin or a specific window has 1 house. So 1 is the correct value in both cases.

The total number of any of these things is irrelevant as almost always it would be more than 1 and 0 would make no sense.

Iain Duncan
  • 3,139
  • 2
  • 17
  • 28
  • what if **student** and **subject**? At school, 1..* student can take 1..* subject, 1..* subject can be taken by 1..* student is that correct? –  Apr 20 '19 at 06:14
  • Yes, that is an example of a many to many relationship and is valid – Iain Duncan Apr 20 '19 at 06:27
  • But why can't this applied to the cases of admin&payment and house&room? Is it because when adminA is accepting paymentA, there is no need for adminB to accept paymentA? Thus, only 1 admin handling 1 payment at 1 time,while adminA can accept paymentA, paymentB, and etc. –  Apr 20 '19 at 06:32
  • Yes, that is it. One student might take maths and English (many subjects) and there might be 30 students in the maths class (many students) but for paymentA there is only one admin although that admin may then deal with many payments (one to many relationship). – Iain Duncan Apr 20 '19 at 06:50