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

Inner Class

 
Gustavo Adolpho Bonesso
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !
How can i represent an inner class in an UML diagram ?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm quite sure this has been asked before multiple times. Maybe you should do a search.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is mentioned in UML for Java by Robert c Martin (a book that I won )
 
Matt R. Hansen
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UML diagrams preferably should not be language specific. However, inner classes are java specific. Also, inner classes are usually private. In which case, you would not want to display your inner class at all.
If you do need to display this inner class, you can extend the standard. The recommended way of doing this is to have a legend.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Matt R. Hansen:
UML diagrams preferably should not be language specific.

Unless you want to depict an imagined or existing implementation.
Also, inner classes are usually private. In which case, you would not want to display your inner class at all.

You can't think of a case where you would want to depict a private inner class?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic