How to show Dependency Injection on a UML class di

2020-05-20 08:26发布

问题:

How do I show Dependency Injection of an object or class in a UML class diagram?

回答1:

Martin Fowler shows it like this:



回答2:

You display class dependencies by using a dashed line with a pointed arrow that points from the client model element to the supplier model element.

I think that how you provide the dependencies to the client is irrelevent at the UML level.