Book a Demo

Author Topic: Nesting Assemblies in UML 2.0  (Read 7144 times)

fcaporal

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • Stop "Winchester Mystery House" like applications!
    • View Profile
Nesting Assemblies in UML 2.0
« on: December 16, 2004, 01:49:11 pm »
Using UML 2.0 notation and EA, since I can't combine the Nesting and Assembly connectors, how would I represent the following relationship:

ClassA contains Objects of ClassB (nesting) that implement InterfaceC?

This could be represented with one connector Assembly connector showing the Nesting sign (+) on the interface side...

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Nesting Assemblies in UML 2.0
« Reply #1 on: December 16, 2004, 02:21:54 pm »
Could you give us a bit more of a concrete example, I'm having trouble trying to see what the concept is that you are trying to communicate.
Bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

fcaporal

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • Stop "Winchester Mystery House" like applications!
    • View Profile
Re: Nesting Assemblies in UML 2.0
« Reply #2 on: December 28, 2004, 10:48:51 am »
Sorry for the delay in the response... Let me try to clarify my previous statement.

Let's say that we have a Neighborhood class that contains an inner class called NeighborhoodState which implement the Memento interface.

How would I model this using EA?

UML 2.0 would suggest to draw a connector like:

|Neighborhood |(+)------(O--------|NeighborhoodState|
                                                                                                                                                    Memento

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Nesting Assemblies in UML 2.0
« Reply #3 on: December 28, 2004, 09:11:54 pm »
Hmmm.

From my understanding "nesting", i.e. (+)----,  is a dependency link of a structural nature.  I am actually d**ned if I can find it in the UML 2 specs,  but having considered the application of the assoication to the way you are thinking, its along the lines of "you can't instantiate a NeigborhoodState object unless you instantiate a Neighborhood object"  or if you like, since the visibiliity of the Neighborhood classifier defines (constrains) the visibility of the NeighborhoodState (from definition of nested classifiers in the Infrastructure) then the nesting link defines the visibility constraint dependency (and nothing more !??).  

This is very different from the pseudo-structural (my term)   assembly link which is of the ilk "when the system is working, these two things are connected (somehow)".  (you can search this forum for a rather long and unfinished  story about assembly links).

The way I would draw what you are trying to show (I think) is to make the Neighorhood class a "big" box and put the NeighborhoodState class inside it.  Then use a realize relationship between NeighborhoodState and Memento.


[ Neighborhood  [NeighborhoodState] -- ]----|> [<<interface>> Memento]

hth
bruce  
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

fcaporal

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • Stop &quot;Winchester Mystery House&quot; like applications!
    • View Profile
Re: Nesting Assemblies in UML 2.0
« Reply #4 on: December 29, 2004, 10:43:27 am »
Thank you for the suggestion.
To be frank with you I didn't come up with the notation I mentioned in my example. I pulled it out from some diagrams that Allen Holub used in his "Holub on Patterns: Learning Design Patterns by Looking at Code" book. I liked the density of information that these conectors bring to the diagram. It allows to significantly reduce the clutter for complex systems. I was hoping to be able to reproduce these type of connectors for my own diagrams. Other extension that this author is using are:

---------|>(+)

and

--------->(+)


Thank you,

Fabrice

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Nesting Assemblies in UML 2.0
« Reply #5 on: April 10, 2005, 04:51:38 am »
The nesting connector is identified in the UML2 specification in
either the Superstructure or Infrastructure documents.  I don't
have the 1000+ pages with me at the present ;), but it is shown
as an alternate representation for package containment - see the
diagrams in the appropriate section.  Therefore it would seem to
be eminently suitable for the usage already discussed in this
thread.

I've been recently pondering the difference between containment
and compositional aggregation.  Another tool makes the
difference "visible".  When you nest (contain) one element
within another, the browser reflects this, but changing the
hierarchy appropriately!  If you change the browser, the
relationships are removed/added to the diagram.  It would be
great if EA could do the same!

Paolo

Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!