Roman
Roman

Reputation: 66226

How to show Dependency Injection on a UML class diagram?

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

Upvotes: 50

Views: 38648

Answers (2)

Jeremy
Jeremy

Reputation: 22435

Martin Fowler shows it like this:

DI UML

Upvotes: 52

Simone
Simone

Reputation: 11797

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.

Upvotes: 16

Related Questions