Reputation: 1514
Would it be acceptable to reduce this to the following?
My logic would be: SomeClassA
and SomeClassB
inherit BaseSomeClass
(and it's dependencies) therefore we can deduce SomeClassA
and SomeClassB
will depend on SomeObject
.
Is this (my final UML) technically correct?
Is it reasonable (Whether or not technically correct)?
Would it be different if DoSomething
on BaseSomeClass
was an abstract method?
I have a feeling the answer will be similar to my question on showing interface dependencies in UML but I feel this is different enough to merit its own question.
Upvotes: 1
Views: 1012
Reputation: 36313
Inheritance means, that you make some kind of "abstract clone". In other words, it has not only the general class' attributes/operations, but also its dependencies. In that way your second diagram is preferred. The first is not wrong, but the two dependencies from the specialized classes are already present and must not be repeated.
To cite Einstein: Everything Should Be Made as Simple as Possible, But Not Simpler
Upvotes: 2
Reputation: 1789
For me your second diagram with one dependency only is the good one.
Looking at your diagram, I have some questions: - why do you want to show dependencies so precisely ? As already commented on your other question, that's possible, that's make sense but, for me, in most of UML class diagram all dependencies are not shown (even if they are modeled).
Upvotes: -1