mercredi 6 janvier 2021

UML Class Diagram - Show Interface and Implementation dependencies on the same object?

When designing a UML Class Diagram, should interfaces and their implementations show dependencies on the same object? Or can just the interface show the dependency since it will be implied that the implementation has that dependency as well?

For instance, lets say I have a User object. I have a UserController interface and a UserControllerImpl implementation of the interface.

Would this diagram be correct? Do you need to show the aggregation relationship from the User/Implemenation and the User/Interface?

UML Class Diagram

It almost feels unnecessary in my opinion to show the aggregation relationship from the User and Controller Implementation. Since there is already an aggregation relationship from the User and Interface, it seems as though the reader would be able to infer that this relationship would apply to the implementation as well.

Any answers on this and whether this is a correct diagram? I've researched prior questions that are similar to mine, but they have been unclear and contradicting answers.

Aucun commentaire:

Enregistrer un commentaire