Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA Composite Entities in Sequence Diagrams

 
Murat Balkan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Regards,
Murat
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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?
Best wishes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic