Reputation: 5557
I have a complex hierarchy of objects that we can represent, for illustration purpose, like that:
class Base {
public handle() {
//base handling code
onHandlingDone()
}
public onHandlingDone() {
//base onHandlingDone code
}
}
//--------------------------------------
class Regular extends Base {
public handle() {
super.handle();
//regular handling code
}
public onHandlingDone() {
//regular onHandlingDone code
super.onHandlingDone()
}
//--------------------------------------
}
class Special extends Regular {
public handle() {
super.handle();
//special handling code
}
public onHandlingDone() {
//special onHandlingDone code
super.onHandlingDone()
}
}
Note: this is not my Design, I'm doing maintenance on a huge project. There are a lots of 'Special' implementation. Refactoring is not an option.
There is a lot of interleaved code: method are calling super class methods that are also super class method, and some call are to other methods are done at each level.
Now I want to draw some sequence diagram to help me understand what is going on.
How should I represent these calls across the hierarchy ?
- Unrolling the hierarchy would add lots of noise in the diagram, but will be accurate.
- Masking the hierarchy will result in a simpler diagram, but it is confusing (where is that damn method again, where in the hierarchy am I when I send this message ?)
Is there any usual way to deal with this kind of complex class hierarchy in sequence digram ?
Upvotes: 2
Views: 2319
Reputation: 5585
You could do this if you unroll the hierarchy and have swim lanes for the Super->Regular->Base. However one way to minimise the noise would be to make a super stereotype instead of using self calls.
Upvotes: 1