Re: UML inner/nested class associations




"H. S. Lahman" <h.lahman@xxxxxxxxxxx> wrote in message
news:N%N1g.11433$MU4.6250@xxxxxxxxxxx


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.


Your three examples are all closely tied to 3GL context. At the OOA/D
level in UML one doesn't really care which solution is used in the 3GL
implementation. The fundamental logic of the solution will be the same
regardless of which implementation is chosen. Choosing a specific
implementation will depend upon things like language syntax, referential
integrity context, programmer convenience, dependency management, and a
bunch of other pure OOP issues.

So my answer is: solve the problem abstractly at the OOA/D level using
natural problem space abstractions and don't worry about how it will be
implemented at the 3GL level. So...

What about for the purposes of maintenance documentation?

An association might have design merit but may be misleading if it isn't
actually implemented as such eg it is just used in method scope.

--
Mike W


.