Ramy Al Zuhouri
Ramy Al Zuhouri

Reputation: 22006

"Depends on" relationship for subclasses

I have a few questions about UML:

  1. If a class (let's call it B) is derived from A, and the class A uses some other other classes (has relationship), do I have to draw the arrows also from B to all used classes?
  2. If a class uses an ArrayList<myclass>, is correct to say that this class uses myclass?
  3. If a method uses generics (or templates), what syntax do I adopt for them?

Upvotes: 0

Views: 145

Answers (1)

Christian
Christian

Reputation: 14111

  1. No. The properties are inherited implicitly, no need to model them explicitly again.

  2. Yes, if you mean that the ArrayList contains only member of myclass - just draw an to-n association to myclass.

  3. You can use UML templates for parameterization. It looks like this. But don't use it for collections - using to-n associations (like in 2) is better.

Upvotes: 1

Related Questions