Book a Demo

Author Topic: Composite element/diagram weirdness  (Read 4244 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Composite element/diagram weirdness
« on: January 02, 2012, 08:50:51 pm »
Hi all,


I've got some issues with Composite elements and diagrams in EA. I would call this behaviour buggy, but I'd like to hear your thoughts.
My premise is that the Composite element/diagram relationship should be strictly one-to-one and that the diagram should always be contained in its parent element, but in certain circumstances EA violates both these principles.

Weirdness #1: EA allows you to move a Composite diagram out of its parent element.
When you do, the Composite relationship is retained, so that if you then double-click the element in a different diagram, you navigate to the composite diagram -- which is now located somewhere else.

Weirdness #2: multiple Composite elements can share the same diagram. Here's how:
1. Create an Activity diagram "Blarg". Put some simple stuff in it.
2. Create a second Activity diagram "Honk", preferably in a different package.
3. Into the "Honk" diagram, drag the "Blarg" diagram from the browser and select to create a Hyperlink.
4. EA creates a Composite Activity named "Blarg" whose composite diagram is the "Blarg" diagram.
5. Repeat 3 a few times. You now have several Composite Activities which share the same diagram (which is not actually contained in any of the Activities).


I would suggest the following behaviour instead.

#1: If you try to move a Composite diagram out of its parent element, EA either refuses while the element is marked as Composite (forcing you to un-Compositeify the element first), or automatically breaks the Composite relationship.

#2: In drop-diagram-on-diagram situations where EA would create a Composite element, extend the "Drop Diagram As" dialog to include both Hyperlink and Composite Element.
A Composite element should be created in the package where the dragged diagram ("Blarg" above) is located, not in the package where the dropped-onto ("Honk") diagram is located, and the diagram should be moved into the new element.
The Composite Element option should only be available if the diagram is not already a composite diagram.


Thoughts?


/Uffe
My theories are always correct, just apply them to the right reality.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Composite element/diagram weirdness
« Reply #1 on: January 02, 2012, 11:14:41 pm »
Uffe,

The problem here is that "composite" is actually the wrong term for this feature.
If you see it as "linked diagram" (as in the diagram that will open when the item is double clicked) then it's not that weir at all.
In fact I'm sure a lot of us depend on the weirdness of this linked diagram feature for all kinds of drill trough scenario's.

What they should do is allow an easy way to see/change the linked diagram in the GUI.

Geert

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Composite element/diagram weirdness
« Reply #2 on: January 03, 2012, 04:34:21 am »
Hmm, yes -- I can see where you're coming from. I'm still not convinced, though.

Consider the Make Composite function. This creates a diagram (unless the element already contains one), but does not provide the option of linking to an existing one.
This would imply that the intended semantics are closer to strict containment than a softer link.

In fact, AFAIK the many-elements-to-single-diagram behaviour only applies to Activities: switch off the Automatic SubActivities option, and EA creates Diagram Hyperlinks instead.
This would also seem to weaken the case for the current behaviour: why Activities, specifically? Especially considering that an InvocationAction which is an instance of a Composite Activity will, when double-clicked, open its classifier's diagram.

I wouldn't be kicking up a fuss except this has caused some consternation with my current client. I'm quite prepared to lump it (don't have to like it  ;D), but I wouldn't mind hearing from a Sparx rep on this issue.

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Composite element/diagram weirdness
« Reply #3 on: January 03, 2012, 09:30:10 pm »
I think that the Composite Diagram should be renamed to Linked Diagram and there should be a more clear indicator to detect that a diagram is linked to an element. Further there should be a real Composite Diagram which is one singular diagram clearly indicated as such inside an element and which can not be moved outside. The current way is typical EAUI. You (need to) get used to it. But it smells.

q.