Reputation: 320
How can I visualize that a class only holds a reference to a interface of a specific class? Can i use associations between classes and interfaces ?
For example:
class A implements aInterface{
...
}
class B {
aInterface interfaceOfA;
...
}
Upvotes: 1
Views: 2050
Reputation: 1498
yes, exactly like that.
Use the association aInterface interfaceOfA
or use association A a
because A
implements aInterface
and the class A
has the methods written out
To visualize, draw an interface aInterface, and 2 classes, A
and B
.
A implements aInterface
, so there has to be an "implementline" from aInterface to A
. B
has association interfaceOfA
, so there has to be an "associationline" from B
to aInterface
.
Clear?
Upvotes: 1