Book a Demo

Author Topic: Can one omit the container prefix?  (Read 4511 times)

mmo

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Can one omit the container prefix?
« on: November 06, 2010, 01:54:06 am »
Since the thread where I posed that question as a side remark seems gone dead I am asking this question explicitly again:
Can one teach EA to not prefix object names with the names of their containers (e.g. in Deployment diagrams)? I.e. to label a contained object just "bar" instead of "foo::bar"?

IMHO this prefixing makes absolutely no sense, since a diagram already provides enough and precise visual information, in which element an object is contained in (so there is no need to repeat that information in textual form).

Furthermore, this prefixing has the stupid side-effect, that objects contained in other objects get longer and longer labels and thus need more and more space in a diagram the deeper they are nested. But since nested objects have to fit inside other objects there is less and less space to draw them.

One can only escape that by either making the wrapping objects unnaturally big so they provide enough space to hold all the contained levels including the prefixed names or to stop the display of nested elements at some trivial level, thus omitting much the info that one wanted to show.

At the very least, this prefixing should be selectable by some preference setting! IMHO it makes EA so much less useful than it could be.

Michael
« Last Edit: November 06, 2010, 01:56:40 am by mmo »

Paul Lotz

  • EA User
  • **
  • Posts: 248
  • Karma: +1/-0
    • View Profile
Re: Can one omit the container prefix?
« Reply #1 on: November 06, 2010, 04:09:54 am »
Michael,

1) EA does make the display of the namespace optional.  See the Diagram Properties...Diagram tab...Show Namespace checkbox.
2) I'm guessing most of us enable this option.  A modeler can (and frequently does) use an element from one package (namespace) in a model in a diagram in another package.  In that event, it is quite helpful to indicate visually in which package the element actually lives.  (In my experience I pretty much never have a long namespace hierarchy anyway--I either am within the current namespace or indicate one namespace, but that really depends on how you design your system.)

Paul

mmo

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Can one omit the container prefix?
« Reply #2 on: November 07, 2010, 05:06:59 am »
Quote
1) EA does make the display of the namespace optional.  See the Diagram Properties...Diagram tab...Show Namespace checkbox.
Nope - this does not work for Component diagrams! The prefix(es) is/are still displayed, even though the "Show namespace" option is ticked off.

Can one attach images to appends in this forum? I could provide a screenshot with a component diagram showing a component containing a class and the prefix of the class shows, even though that option is off!

Quote
2) I'm guessing most of us enable this option.  A modeler can (and frequently does) use an element from one package (namespace) in a model in a diagram in another package.  In that event, it is quite helpful to indicate visually in which package the element actually lives. ...
I agree that this may be helpful in diagrams that can contain elements from different packages, like object diagrams. But for component diagrams, where an object's "physical location" also implies an implicit "containment relation" IMHO this is most superfluous.

Michael

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can one omit the container prefix?
« Reply #3 on: November 07, 2010, 10:01:05 am »
Quote
[size=18]...[/size]
I agree that this may be helpful in diagrams that can contain elements from different packages, like object diagrams. But for component diagrams, where an object's "physical location" also implies an implicit "containment relation" IMHO this is most superfluous.

Michael
Hi Michael,

you may be conflating, Composite Aggregation (Compositiion - a meronymy) with Nesting (the addressing/accessing of one element solely via another).

If you have placed the sub-components of the component within the component in the EA browser, you are Nesting them; and under UML rules the parent's prefix MUST be shown.

Given your observed behaviour following Paul's suggestion, this is likely to be the case.

If, however, they are not "under" the container but are sub-components by virtue of a composite aggregation relationship (the meronymy) between the component (whole) and the sub-component (part) then the prefix may or may not be shown, depending upon whether they are in the same package or not - and the EA settings.

The important point is that nesting in the UML sense doesn't actually imply containment of the instances (meronymy), but containment of the classifier (for addressing or identification purposes).

If you have nested subcomponents, if you move one "out from under" the component the prefix should vanish.  You will, however, need to add the appropriate aggregation relationship between the two vertices.

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can one omit the container prefix?
« Reply #4 on: November 08, 2010, 05:10:45 pm »
I've said it before, and I'll say it again.

If the the "owner-prefix" bothers you then you're doing it wrong, and the elements should not be nested at all.

Geert

mmo

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Can one omit the container prefix?
« Reply #5 on: November 08, 2010, 08:58:23 pm »
> Does that help any?

Yes - it did. I moved the class into the Class Model (where they would have belonged from the start) and that made the prefixes go away.

Thanks,
Michael