UML inner/nested class associations



If you have an inner class that creates stateless objects then you can do
this in a number of ways.

1/ A nested class, Objects of the class can be composed attributes of outer
object.
2/ A nested class, Objects of the class are just instantiated in method
scope.
3/ An inner class declared in a method. Objects are just instantiated in
method scope.

In UML only 1/ can be shown as a composisition (?) association although the
designed effect is the same.

How can I legally show relationships in the other cases? At the moment I'm
using notes & note anchors. I was using the dotted instantiates/dependency
relationship, but I now realise that is misuse.
Can you show relationships for method local objects at all?

I expect the answer might be, 'this is what sequence diagrams are for'.

Also when naming associations, does the naming direction go in the direction
of a one way association by default? I believe you can have it in either
direction, but there is no visual way to indicate direction? How can you
read direction in 2 way associations? Also my names seem a bit over-long eg
'connects to database via'.

example here:
http://img126.imageshack.us/img126/5078/dao4bv.gif

Nested class is RowHandler, a locally used object is DAOException.

TIA,
Mike W



.



Relevant Pages

  • Re: Inner classes use
    ... I would suggest making the attributes of EmpInfo final. ... Second, when you make an inner class (i.e., ... Parser and the contained class is a Token, a nested class would be more ... Another reason is that if your outer class has static methods they will ...
    (comp.lang.java)
  • Re: Access outer class members from a nested class
    ... the JAVA syntax of Outer.this.m_OuterValue does not exist apparently. ... The type of nested class you appear to be thinking of is an "inner class". ... An inner class has an implicit reference to an instance of the outer class, determined at the time of instantiation, based on the instance of the outer class that created the inner class. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: get attribute from a parent class
    ... > # end def ... > nested class B. For example, I want to be able to do something like: ... > instance variable but still be viewable by the inner class B. Is this ...
    (comp.lang.python)
  • Re: static inner classes
    ... A nested class can be declared static. ... is called just that: a static nested class. ... To help further differentiate the terms nested class and inner class, ... class reflects the syntactic relationship between two classes; ...
    (comp.lang.java.programmer)
  • Re: Linked List in Java
    ... So as I understand if You have an "inner class" or nested class in Java, ... calling constructor from contructor - that is the answer, ...
    (comp.lang.cpp)