Question

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;
...
}
Was it helpful?

Solution

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?

OTHER TIPS

UML Diagram can look like this:

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top