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

UML for Generalization/Realization

 
scott Tung
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to Sun Certified Enterprise Architect for J2EE Technology Study Guide,
Generalization is visually represented as a line with a open arrow on the end,
Realization is visually represented as a dashed-line with a solid arrow on the end.
But from some other materials, Generalization is represented as a line with an open triangle on the end and Realization is represented as a dashed-line with an open triangle on the end.
Can somebody tell me representing Generalization/Realization (in the exam) shoud use ARROW or TRIANGLE in the end? is it solid or open?
Thanks
 
Sanjay Raghavan
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The arrow is used for association, not generalization.
So just an arrow is "Association"
Open rhombus on one end and arrow on the other is "Aggregation"
Filled Rhombus on one end and arrow on the other is "Composition"
Solid line with an open triangle is generalization
Dashed line with open triangle is realization.
Plain dashed line is dependency.
HTH.
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice post Mr. Raghavan. Here in the states we don't use the word rhombus too often. We call them diamonds.
 
Jack Coleman
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is how I understand it.
Some symbols...
<|-- open triangle head
<--- arrow head
<> open diamond
<<>> closed diamond
---- solid line
- - - dashed line

[c1]<|-------[c2] generalization (inheritence)
[c1]<|- - - -[c2] realization (implementation)
[c1]---------[c2] association
[c1]- - - - -[c2] dependency
[c1]<>-------[c2] aggregation
[c1]<<>>-----[c2] composition
Arrow heads are different from triangle heads. You use arrow heads <-- to denote navigability, whether something is uni-directional or bi-directional (or neither). You can use arrow heads with associations, dependencies, aggregations, and compositions. Example:
[c1]<------>[c2]
bi-directional navigatable association
[c1]<><----[c2]
uni-directional navigatable aggregation
etc...
In all the UML tools that I have used generalization/realization symbols have always been open triangles. I have the Cade/Roberts book, and I see where they say that realization is a solid triangle. I have not seen this anywhere else. Is this an error in this book, or is it just an alternate symbol that can be used?
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jack Coleman:
I have the Cade/Roberts book, and I see where they say that realization is a solid triangle. I have not seen this anywhere else.

Hi Jack,
I have not seen them anywhere else either. But from M.Cade's text there is a difference:
The solid triangle and dashed line is said to be used for _semantic_ realization, see page 41.
The open triangle and dashed line is used for a _structural_ realization (implementation) of an interface.
The open triangle and solid line is used for a (structural) generalization (inheritance).
The arrow head and dashed line is used for:
1 semantic (non-structural) _dependency_ (via method parameter...), (i.e. not a semantic realization)
- - between two UML-elemants in a class diagram
- - or in a component diagram
2 object flow in
- - Activity Diagrams
- - Events
3 messages between Statechart Diagrams
4 return (optional) in Sequence Diagrams.
About the "semantic (non-structural) _dependency_" I also found in M.Hintz, "UML@Work". Seite 50, that the following all are the same:
- open triangle plus dashed line
- open triangle plus dashed line plus <<realize>> stereotype
- arrow head plus dashed line plus <<realize>> stereotype
But:
- an "open triangle plus dashed line" is a _structural_ notation,
- an "arrow head plus dashed line" is said to be a semantic one.
So how could these both be the same?
Back to first problem: Because nobody told us that he accepts M.Cade's "solid triangle and dashed line", I would consider it to be an editor's bug too. Please, if anybody does not agree, reply your veto! (before I will ask the authors themselves).
Thomas.
 
Timber Lee
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a uni-directional navigation association can be expressed as that instance of a class has references to instance of another class.
what structure can express aggregation and composition in java program?
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Timber Lee:
a uni-directional navigation association can be expressed as that instance of a class has references to instance of another class.

Hi Timber,
could you please quote the text passus that is ment or concerned?
Thanks.
Thomas.
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Timber Lee:
What structure can express aggregation and composition in java program?

Hi Timber again,
sorry, I was not fair. I posted something I just had read, slept well then, awoke and drove crazy obout these differences myself then.
So I re-edit this reply and move the topic (and maybe your original intention too?) to a new topic, because it does not concern to the topic about Generalization/Realization.
Thomas.
[ February 13, 2003: Message edited by: Thomas Taeger ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic