Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: Paolo F Cantoni on August 31, 2007, 03:25:18 am

Title: Attaching diagrams to elements
Post by: Paolo F Cantoni on August 31, 2007, 03:25:18 am
Since less than a fortnight after a started using EA (over two years ago), I have consistently argued that [size=13]Composite Element[/size] (http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1113400132;start=2#2) is a misnomer for the functionality that is provided by being able to attach a diagram to an element.

Additional points were posted in: [size=13]Re: shape scripting/element properties[/size] (http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=suggestions;action=display;num=1165306969;start=3#3), [size=13]Double-Clicking for navigation[/size] (http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=suggestions;action=display;num=1120621193;start=0#0) and, perhaps most tellingly in: [size=13]Re: Default Diagram[/size] (http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1074479546;start=14#14) and [size=13]TIP: Adding Diagram to Interface element[/size] (http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=suggestions;action=display;num=1119599474;start=0#0)!  The latter one being the one I had recourse to this afternoon...  I wanted to add a linked diagram to an Artifact.

Here is yet another proposal...

To the <context Menu>Advanced> sub menu:

1) If the element is structural, add the Composite Element menu item and the Show Composite Diagram Contents (which, by the way, should be disabled is the element isn't composite).  Actioning the first option, will create a Composite Structure Diagram below the element.  Actioning the second, displays the contents of that diagram.
2) In addition, add a new menu item Attach Diagram to Element.  If this is actioned, a tabbed dialog displays.  One tab shows a browser to allow the user to browse for an existing diagram, the other tab displays the new diagram dialog will be opened asking for the type of diagram to create.  If a new diagram is requested, it is added below the element, otherwise the browsed for diagram is attached.  As with the Composite element menu options, an additional Show Attached Diagram Contents item (again, disabled if there is no attached diagram) allows the display of the diagram.
NOTE: If Composite Element is true, then Attach Diagram to Element is disabled (and vice versa).  That is, you can only set one of the options if none are currently set.
3) If the element is non-structural, then only the Attach Diagram to Element functionality is available.  This also applies to instances of structural elements.

I think this would allow the ability to move from arbitrary diagram element to related diagram.

It will not have escaped you that using the above functionality would allow more then one element to be attached to the same diagram.  Well, with a little "jiggery pokery" it is possible to do this with the current functionality!

Thoughts? Votes?
Paolo
[size=0]©2007 Paolo Cantoni, -Semantica-[/size]
Title: Re: Attaching diagrams to elements
Post by: Martin Terreni on August 31, 2007, 05:54:22 am
I think I didn't quite got it...
:-[
I change an element to be composite and lets assume it is indeed only composite := if you look at project tree it has its components but no diagram - how can you show content? just the plain graphic list of components?
And if it has an attach diagram why can't I just attach to it any diagram in tree? and if it has a diagram with elements in it (even element which are not under the original element in project tree) then it isn't a composite element?
How would you call such an element that if you drill into it you see how it is composed, but its parts do not belong to it?

I'm not sure you are wrong, I just don't see how this approach answers the above questions...
Title: Re: Attaching diagrams to elements
Post by: Paolo F Cantoni on August 31, 2007, 09:41:31 am
Hi Martin,

What [size=13]Composite Element[/size] (http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1113400132;start=2#2) tries to get across is that the [  ] Composite Element menu item's marking has NOTHING to do with whether the element has any subordinate elements in the browser, merely with whether the element has a reference to a diagram which (at one time) was immediately underneath the element in the browser.

If you experiment with a couple of temporary elements and diagrams you should see what I mean.  Further, if you change the type of the element, you will see that the diagram remains and can be opened by double-clicking the "composite" element, but (depending on the type you've changed to) the ability to access the diagram via the menu items has disappeared.

As Thomas said in his reply to your posting in the above link, once you get used to the misnomer, it doesn't sound too bad.  But it's still a misnomer - for the reasons I mentioned in that post.  NOTE: the functionality of the [  ] Composite Element menu item has actually changed slightly from that at the time of the original posting, but not sufficiently to substantively change the thrust of my proposal here.

HTH,
Paolo
Title: Re: Attaching diagrams to elements
Post by: «Midnight» on August 31, 2007, 10:49:16 am
And how!

Please also see (and vote for, mayhaps) the various bumps by Paolo.

David
Title: Re: Attaching diagrams to elements
Post by: Martin Terreni on August 31, 2007, 01:15:02 pm
Quote
Hi Martin,

What [size=13]Composite Element[/size] (http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1113400132;start=2#2) tries to get across is that the [  ] If you experiment with a couple of temporary elements and diagrams you should see what I mean.  Further, if you change the type of the element, you will see that the diagram remains and can be opened by double-clicking the "composite" element, but (depending on the type you've changed to) the ability to access the diagram via the menu items has disappeared.


This is an inconsistency I'm aware of and which should be fix, it seems I got so used to it I never though to report is as a bug (which it is). Yet I think it does not answer my questions, which were more conceptual.
Title: Re: Attaching diagrams to elements
Post by: Paolo F Cantoni on August 31, 2007, 02:03:01 pm
Quote

This is an inconsistency I'm aware of and which should be fix, it seems I got so used to it I never though to report is as a bug (which it is). Yet I think it does not answer my questions, which were more conceptual.
OK Martin, now that I'm clearer on what you were looking for, I'll have a think and make some proposals.  In the meantime, if anyone has anything to add at the conceptual level, jump in...

Paolo
Title: Re: A rose is a fish is an aardvaark
Post by: sargasso on August 31, 2007, 09:06:11 pm
TEMP POST!  This is a question

Paolo,

I'm not sure what you are asking for.  

Is is a clear and unabiguous differentiation between diagram links and structurally decomposable elements?

bruce

p.s. I'm only here now due to horse flu.  >:(
Title: Re: A rose is a fish is an aardvaark
Post by: Martin Terreni on August 31, 2007, 10:18:41 pm
Quote
p.s. I'm only here now due to horse flu.  >:(

What? Your horse got sick and you couldn't get to work? ;)
Title: Re: A rose is a fish is an aardvark
Post by: Paolo F Cantoni on September 01, 2007, 12:26:37 am
Quote
What? Your horse got sick and you couldn't get to work? ;)
No,  Here in OZ, we don't vaccinate horses against flu - because we don't normally have it.  However, a failure in quarantine precautions has allowed it to get in in NSW (where sagasso lives) so there is bedlam in the horse racing industry in the Australian Eastern States.

Perhaps bruce would have been in the bookies enclosure at the racecourse if he hadn't been posting  ;)

HTH,
Paolo
Title: Re: A rose is a fish is an aardvaark
Post by: Paolo F Cantoni on September 01, 2007, 12:32:44 am
Quote
I'm not sure what you are asking for.  

Is is a clear and unabiguous differentiation between diagram links and structurally decomposable elements?

Yes!  For those element types that can have a composite structure diagram created, then marking the Composite Element menu forces the creation of such a diagram.  However other diagram links are also possible if you don't want to use the CSD.  A separate menu item is available for that.  This menu item can be used genreally to create a diagramatic link - of some kind, even if the element can't have a CSD.

The quesiton of whether declaring an element to be composite should AUTOMATICALLY create a diagram is moot - hence (I think) Martin's conceptual level question.

Paolo
Title: Re: Attaching diagrams to elements
Post by: Martin Terreni on September 01, 2007, 12:47:10 am
OK, I think I got it.
A composite should have a digram of its parts, though having an attached diagram does not necessarily claim it is a composite element.
Did I get it right?
Title: Re: Attaching diagrams to elements
Post by: Paolo F Cantoni on September 01, 2007, 01:31:11 am
Quote
OK, I think I got it.
A composite should have a digram of its parts, though having an attached diagram does not necessarily claim it is a composite element.
Did I get it right?
Yes, Martin...  Just having an attached diagram does NOT a composite make.

In addition, I think you should be able to mark an element as composite without having to supply a diagram.  To me, isComposite is just a property of the element.  How the element is a composite can be shown in many ways - Class Diagram, Composite Structure Diagram etc...

To be a composite you have to be a holonym with a partOf meronymy with your components.  This could be done directly in the browser - without any diagrammatic form at all...

HTH,
Paolo
Title: Re: Attaching diagrams to elements
Post by: Martin Terreni on September 01, 2007, 03:05:25 am
OK, now it makes sense, or as we say in Hebrew "it makes brain"  8)
Title: Re: Attaching diagrams to elements
Post by: sargasso on September 01, 2007, 04:17:18 am
Quote
In addition, I think you should be able to mark an element as composite without having to supply a diagram.  To me, isComposite is just a property of the element.  How the element is a composite can be shown in many ways - Class Diagram, Composite Structure Diagram etc...

In that case 150 votes.

bruce

p.s. re horses, yes!!! For Gordsake its the spring carival.
Champaign, pretty girls, speedy horses, pretty girls, more champaign... and what did we get "OrseFlu".... ... ... ...
apparently at last count its taken about 36mill out of the industry.
Title: Re: Attaching diagrams to elements
Post by: jeshaw2 on September 01, 2007, 06:36:34 pm
Quote
To be a composite you have to be a holonym with a partOf meronymy with your components...

I should think the composite must also have ownership of its Meronyms.  Or, are you including aggregates in this discussion as well?
Title: Re: Attaching diagrams to elements
Post by: Martin Terreni on September 01, 2007, 07:51:31 pm
well..I guess we should also distinguish aggregation.
Title: Re: Attaching diagrams to elements
Post by: Paolo F Cantoni on September 01, 2007, 09:06:35 pm
Quote
I should think the composite must also have ownership of its Meronyms.  Or, are you including aggregates in this discussion as well?
Yes, Jim...  I forgot...  Ownership, in this case being the ability to destroy...

Paolo
Title: Re: Attaching diagrams to elements
Post by: jeshaw2 on September 02, 2007, 03:47:45 pm
Quote
Ownership, in this case being the ability to destroy...

And perhaps exclusive access to the Meronyms. Only by me may you access my parts.

However, Eric Evans (of DDD fame) does allow multiple root aggregates. Is that a factor also?

My apologies if I'm muddying up the water here.

Title: Re: Attaching diagrams to elements
Post by: KP on September 04, 2007, 03:00:48 pm
Quote
To the <context Menu>Advanced> sub menu:

1) If the element is structural, add the Composite Element menu item and the Show Composite Diagram Contents (which, by the way, should be disabled is the element isn't composite).  Actioning the first option, will create a Composite Structure Diagram below the element.  Actioning the second, displays the contents of that diagram.
2) In addition, add a new menu item Attach Diagram to Element.  If this is actioned, a tabbed dialog displays.  One tab shows a browser to allow the user to browse for an existing diagram, the other tab displays the new diagram dialog will be opened asking for the type of diagram to create.  If a new diagram is requested, it is added below the element, otherwise the browsed for diagram is attached.  As with the Composite element menu options, an additional Show Attached Diagram Contents item (again, disabled if there is no attached diagram) allows the display of the diagram.
NOTE: If Composite Element is true, then Attach Diagram to Element is disabled (and vice versa).  That is, you can only set one of the options if none are currently set.
3) If the element is non-structural, then only the Attach Diagram to Element functionality is available.  This also applies to instances of structural elements.


Paolo, I refactored your suggestion then refactored some more until I came up with a one-liner that is (IMO) a vast improvement:

All diagram objects should have "Add Diagram" and "Link to Diagram" commands on their context menu, making the "Composite Element" command redundant.

I think it maintains the spirit of your suggestion and addresses all the issues, so I have logged it as a feature request. It is not trivial to implement, so it will have to go through the approval process, of course.

I think the only issue not addressed is the fact that the "Show Composite Diagram Contents" command needs to be hidden when there's nothing to show. That's an easy fix.
Title: Re: Attaching diagrams to elements
Post by: sargasso on September 05, 2007, 04:37:51 am
Reflecting elsewhere  ;)
Quote
All diagram objects should have "Add Diagram" and "Link to Diagram" commands on their context menu, making the "Composite Element" command redundant.


All diagram objects clearly (and umbiguously ((?sp)) )includes the word [glb]edges[/glb]. ... ... ???

bruce
Title: Re: Attaching diagrams to elements
Post by: jeshaw2 on September 05, 2007, 07:28:53 am
And also extends to declared operations within class elements??
Title: Re: Attaching diagrams to elements
Post by: Martin Terreni on September 05, 2007, 07:51:36 am
What about elements actually being part of (destroyed with) the containing (composite) element?
Title: Re: Attaching diagrams to elements
Post by: KP on September 05, 2007, 01:31:57 pm
Quote
Reflecting elsewhere  ;)

All diagram objects clearly (and umbiguously ((?sp)) )includes the word [glb]edges[/glb]. ... ... ???

bruce

With EA the way it is, there's no way to add a child diagram to an element that doesn't appear in the Project Browser, so having an "Add Diagram" command for edges is impossible without a huge redesign. I can't think of any major obstacles to a "Link to Diagram" command for edges though (but where would you put the "0-0" link symbol?)

Quote
And also extends to declared operations within class elements??

Practical problem here is that, with the current schema, a diagram assumes its owner is in the t_object table which operations aren't - not insurmountable, just troublesome. I can't think of any major obstacles to a "Link to Diagram" command for operations.

Quote
What about elements actually being part of (destroyed with) the containing (composite) element?

My view is that is best handled by the user in the Project Browser and would add too much baggage to the suggested commands. If you want a composite or structured element (whatever your definition of those terms is), then the "Add Diagram" and "Link to Diagram" commands can help you create one but shouldn't actually define what one is (which is why the "Composite Element" command causes such confusion).