This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Nested Classes in UML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Nested Classes in UML" Watch "Nested Classes in UML" New topic
Author

Nested Classes in UML

Gustavo Adolpho Bonesso
Ranch Hand

Joined: May 11, 2002
Posts: 103
How to represent a Nested Class in UML ?


Gustavo Adolpho Bonesso<br />SCJP1.4
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
The last time I needed to draw an inner class into a class diagram (which was a long time ago), I ended up using the same class notation for both inner and regular classes. If the inner class is non-static, you can associate it to the outer class using a composition. Otherwise, I would just rely on the name ("MyOuter.MyInner") to communicate my intention.
However, I would be interested to know what others think about this as I really didn't do much research on existing practices at the time.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Gustavo Adolpho Bonesso
Ranch Hand

Joined: May 11, 2002
Posts: 103
Thank you, Lasse, i like the composition aproach to do the job...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Does UML 2.0 talk about nested classes?


Groovy
 
jQuery in Action, 2nd edition
 
subject: Nested Classes in UML