Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Q about UML Distilled: transient relationship?

 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Martin Fowler says the following:

Whether a property is implemented as a field or as calculated value, it represents something an object can always provide. You shouldn�t use a property to model a transient relationship, such as an object that is passed as a parameter during a method call and used only within the confiness of that interaction.


I can�t really understand what he wants to say in the second sentence: what is the problem with transient relationships?

Cheers,

Gian Franco
 
Edwin Keeton
Ranch Hand
Posts: 214
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think he's saying there's anything bad about transient relationships. What he means is you don't try to model them (transient relationships) with a property. (He gives the example of an object parameter to a method.) It might look something like this:



Hope this helps.

Ed
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A class diagram is a static view on the interfaces, classes and the relationships among them (association, implementation and inheritance).
If you put transient relationships in the model, reader of model is overwhelmed with information.
Also transient stuff is inherently dynamic. An instance member is allways "there" as long as the class does exist, though it might be null. A transient variable has a much shorter life-cycle.

Transient stuff gets focus in types of uml models which show dynamic behaviour like interaction diagrams.
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Ed and Axel, the combination
of your replies makes it all clear

Cheers,

Gian Franco Casula
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic