Reputation: 1470
I have three object :object1
,objectA
,objectB
.
and also have an interface
How can I model as the following:
an object1
provides an interface from objectA
to objectB
Upvotes: 2
Views: 745
Reputation: 6373
If I understand your question correctly, that is you want to create an UML diagram in where one class implements interface (Producer) and another uses it (Consumer) then I would say you'd have few choices:
1) Denote inteface explicitely, and use realization relationship to indicate implementation of interface, and dependency relationship to indicate usage:
2) Use lollipop notation to denote exposed interface, and dependency to indicate usage.
3) Use ball and socket notation (UML 2.0)
Upvotes: 1
Reputation: 555
There are two immediate interpretations of what you want. Either you have an interface ("Interface1") that acts as a shared interface implemented by ClassA and ClassB OR you want the interface to be the way that ClassA and ClassB interact. I'm not sure which you mean.
In any case, the first option, where the interface is implemented by both is modelled like this:
The second option, where the interface is used to allow interaction is modelled like this:
Upvotes: 1