-1

I have 4 class in my diagram. These are appointment, dentist, patient and seat classes.

In any clinic, dentists use the seats right?. My question begins here.

This is part of my diagram. UML Diagram

the dentist is using the chairs while doing the examination, which type of oop connection should I use when the link seat and dentist classes or should I link dentist and seat classes?

should connection be association, aggregation or something like that? Which connection should I use?

Just a human
  • 17
  • 1
  • 7
  • "oop connection" what is oop ? "I have 4 class in my diagram..." : there are 3 – bruno Nov 23 '20 at 08:23
  • I know there are three in diagram because Seat class is not linking with any class and OOP is Object Oriented Programming – Just a human Nov 23 '20 at 08:27
  • a class can be in a diagram not linked to other(s), anyway having 3 in you cannot say you have 4, is just a problem of logic, may be you wanted to say you have 4 classes in general (without specifying 'diagram') – bruno Nov 23 '20 at 08:30
  • oop : what was I supposed but your question is not about oop in general but about UML so if you want a specifier replace oop by UML ;-) – bruno Nov 23 '20 at 08:32
  • Your question is absolutely unclear since you don't explain the context well enough. – qwerty_so Nov 23 '20 at 10:43

1 Answers1

0

Warning you put an unexpected S at the end of Seat, this is very probably not what you wanted.

By seat you probably mean all the resources used by a dentist to operate/examine a patient.

If a dentist always use the same seat and associated instruments and is the alone to use them the association can be between the dentist and the seat, and that link can be an association, but not an aggregation because the dentist is not composed by a seat nor the reverse.

If the seat and associated instruments is not always the same for a given dentist we can link it with the appointment, again through an association, allowing to reserve it for the operation/examination done by the dentist to the patient

bruno
  • 32,421
  • 7
  • 25
  • 37
  • 1
    Perfect answer! Thank you. – Just a human Nov 23 '20 at 08:56
  • If I have a 3 different seat class (ASeat, BSeat, CSeat) and what if I have a parent class which name is seat. what should I do? – Just a human Nov 23 '20 at 08:59
  • @Justahuman the association is still between dentist/appointment and seat, and your 3 new classes inherits Seat, so `ASeat ----|> Seat` etc . If Seat become an interface your new 3 classes realize it so `ASeat - - - -|> Seat`etc – bruno Nov 23 '20 at 09:09