Cardinality Class Diagram

4

When I make a Class Diagram or MER, the cardinality must be defined.

As an example: A doctor consults from 0 to n patients; a patient is consulted by 0 or 1 physician. Why 0?

    
asked by anonymous 24.09.2015 / 23:05

1 answer

3

It is always very difficult to talk about generic and abstract cases like this. The concrete case may be different.

As far as I understand there is no need for the doctor to have patients. Then it can be from 0 to N. Of course you can establish a business rule that is mandatory for him to have any related patient. And since you are setting a minimum of 1, who knows can set a minimum greater than 1. For me this rule does not make much sense, but it is as I said. Every business with your rule.

Even the patient need not be tied to a doctor. In this case there is a greater chance of having a doctor in certain situations. I also would not make this requirement, I see no reason to have it, but if someone is asking you to say that you need to justify some extra restriction, you do not have to do it.

What I would even think about is if the patient can not be tied up to N doctors. Why is there exclusivity? It may have, but I find it unlikely in a hospital or clinic. Even if the clinic only has a doctor, this is a circumstance.

Of course, if the system is controlling physician allocation these rules may be different. But I do not know if they would be. Nothing prevents the doctor from attending several patients simultaneously as a patient may be getting attention from several doctors, perhaps forming a joint.

    
24.09.2015 / 23:42