user997112
user997112

Reputation: 30615

UML Sequence Diagram Showing creation of a sub class?

In a UML diagram when you create an instance of a subclass do you usually include the implicit construction of the superclass prior to the sub class constructor?

Upvotes: 2

Views: 2137

Answers (2)

O. R. Mapper
O. R. Mapper

Reputation: 20731

I usually wouldn't include it. The purpose of the UML sequence diagram is to show what happens between components. It shouldn't be read isolated from other parts of a design, so if a reader is unsure about what any of the components is (i.e. an instance of the subclass and the superclass), he or she should look into the - hopefully - accompanying class diagram.

Upvotes: 2

Fahad
Fahad

Reputation: 118

sequence just shows the sequence of the logic of the module in question. Do you feel there is need to identify which method is truly being called? Also I would guess that the purpose of having a parent clas have a reference to a subclass is that until runtime you won't know which subclass is actually being referred to. If this is not the case, then should the concrete subclass be referred to explictly? does the method being called whether on the subclass or parent class alter the sequence in some way?

Upvotes: 1

Related Questions