• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner Class

 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I represent inner class in class diagram
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't. I mean, there is no standard notation for an inner class, a concept which is very much language specific. (unless UML 2.0 has introduced such a thing)
Here's what I suggest:
1) Represent inner classes as regular classes if they're public
2) Don't represent inner classes if they're private
3) Represent even private inner classes as regular classes if the scope of the particular diagram is just to visualize the internals of the top-level class
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UML in java book uses circle with a plus symbol to represent inner class. Is it a standard?
[ November 14, 2003: Message edited by: Pradeep Bhat ]
 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lasse Koskela:
You don't. I mean, there is no standard notation for an inner class, a concept which is very much language specific. (unless UML 2.0 has introduced such a thing)
Here's what I suggest:
1) Represent inner classes as regular classes if they're public
2) Don't represent inner classes if they're private
3) Represent even private inner classes as regular classes if the scope of the particular diagram is just to visualize the internals of the top-level class

Yes if your inner class is public you can name it outerclass$inner to state the fact that its an inner class of class "outer".
http://www.flex-compiler.csail.mit.edu/jdk/guide/innerclasses/spec/innerclasses.doc7.html
But again that wont be a standard
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic