Search code examples
classumlassociationsdiagramsystem-analysis

Association class attributes in Domain Model Class Diagram


Hi, I have recently started to learn system analysis and design and am having some trouble understanding domain model class diagram (DMCD) association class.

As per image, when drawing the DMCD, I'd like to understand if an association class is allowed to contain attributes of the classes it derives from. The Invoice needs to contain the attributes apptNo and svcName.

Association class inquiry image: Association class inquiry

Do I include the attributes as shown in the image? Or do I assume that the Invoice would already have these attributes because it is derived from Appointment and Service and that it is not necessary to include them as they can be referred back to the keys apptNo and svcID?

I am confused about the concept. How should I present the association class? Can someone please provide some guidance?

Thank you.


Solution

  • As already pointed out by Geert Bellekens in his comment above, you don't repeat any of the attributes of the classes involved in an association class in the association class. You only include attributes that specifically characterize the links classified by the association class.

    In your example, you should only include attributes that are specific for Invoice links, such as invNo, invDate and totalPrice.

    This rule holds independently of the kind of class diagram (domain/design/implementation model).

    However, your model is only good for invoices refering to one appointment and one service. It does not account for invoices concerning one appointment, no matter how many services it includes. In a model for this business logic, Invoice would no longer be an association class, but an ordinary class associated with Appointment. This would allow it to access each service included in an appointment and turn it into an invoice line.