I am working on a composite object which have 2 sub levels underneath. I mean for example, Customer-CustomerAccount-CustomeAccountDetail.
I'd like to add additional CustomerAccountDetails to the Customer.
How can I show this in a sequence diagram?
In Cade's 2nd edition book, all the examples are for the first level objects where he just new()s the objec and persist. Does this represantation also work for composites?
I appreciate your help
posted 5 years ago
A sequence diagram is not the main diagram type to show static relations between classes.
Instead it shows interactions between objects in a chain of events triggered by some certain action or invocation.
If you, in a sequence diagram, want to show that invoking method foo() on a Customer object will trigger the invocation of the method bar() on CustomerAccount and the method fooBar() on CustomerAccountDetail, then you draw two lines from the "bar" being the result of foo() being invoked on a Customer object.
The first line goes to a CustomerAccount object and the second to the CustomerAccountDetail object, with the labels on the lines being bar() and fooBar().
With that said, one can question the gain of showing this amount of detail in a sequence diagram.
Are you showing something that is difficult to understand if you had not showed it?
Can you still understand the principles of the operation you want to describe if you omit the detail information?