问题
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.
来源:https://stackoverflow.com/questions/4488481/how-to-show-dependency-injection-on-a-uml-class-diagram