Author Topic: Using an element more than once on a diagram  (Read 4575 times)

beginner

  • Guest
Using an element more than once on a diagram
« on: November 02, 2009, 08:12:07 pm »
Hi there,
I have a quite simple question. EA does not permit the use of an element more than once on a diagram. This is (AFAIR) in contrast to RR. Now I wonder which is correct. So I browsed Superstructures (2.1.1 07-02-03). I was not able to find a specific location telling what would be correct. However, right in the beginning I found a couple of diagrams (7.8 and following class diagrams) where elements where obviously re-used. Now, is this because they are using RR to create the docu for Superstructures?

From my perspective EA behaves the "right" way. Having an element more than once on a diagram may mislead the reader to take it as the identical element. On the other hand diagrams may be structured more easily as connectors can be organized in a better way.

What do you think?

b.

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Using an element more than once on a diagram
« Reply #1 on: November 02, 2009, 09:03:01 pm »
Hi,

I also think that it's not correct to have the same element appearing more than once on a diagram. Even if the connectors could be disentangled, appearance of the same element confuses more than it helps.
I personally prefer to use another diagram to show further relations of an element, as if they wouldn't fit into a single diagram well.
Example: I have used two separate diagrams for showing a complex composite tree model, where one shows the class (inheritance) hierarchy, and the other shows the class relations (composition and aggregation).

Just my 0.02 EUR

GŁnther

beginner

  • Guest
Re: Using an element more than once on a diagram
« Reply #2 on: November 02, 2009, 09:23:43 pm »
Quick reply, thanks :-)

That's also what I do, but... Does someone know why OMG is doing it the "wrong" way?

b.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6265
  • Karma: +104/-89
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Using an element more than once on a diagram
« Reply #3 on: November 02, 2009, 10:04:59 pm »
Quote
Quick reply, thanks :-)

That's also what I do, but... Does someone know why OMG is doing it the "wrong" way?

b.
The only way that there is a wrong way is if there is no indication that there are multiple renderings on the same diagram.  It's not a trivial issue to sort out which relationships go to which rendering, but it's not rocket science.  You just need to show the user that this rendering isn't the only one  on the diagram (by some means other than placing two renderings on the diagram - indistinguishable from those rendering for which there is only one copy).

Overall, given the other issues with EA, as Gunther says, it's much easier (and often more appropriate) to have multiple diagrams - each showing some particular aspect of the element and it's relationships.

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

beginner

  • Guest
Re: Using an element more than once on a diagram
« Reply #4 on: November 02, 2009, 10:53:42 pm »
Unluckily there does not seem to be any mentioning in Superstructures :-( In fact it would be helpful to have some distinguishable rendering for that purpose (whatever it might be).

A similar issue seems to be source and target role of connectors which (in my view) are just different renderings of the same thing. I haven't read Superstructures (maybe Dan Brown should participate in the writing to make it more readable?) but only used it for reference. So I never can tell whether I'm right or wrong unless proven by someone else. Could it be that Superstructures itself has some flaws inside?

b.
« Last Edit: November 02, 2009, 10:55:17 pm by beginner »

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Using an element more than once on a diagram
« Reply #5 on: November 02, 2009, 11:00:10 pm »
Quote
A similar issue seems to be source and target role of connectors ... Could it be that Superstructures itself has some flaws inside?

Ouch, this discussion seems to come up in recurring cycles here. I never would assume that the UML superstructures are 100% bug and flaw free, as they're man made and not divine laws.

WBR
GŁnther

son-of-sargasso

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: Using an element more than once on a diagram
« Reply #6 on: November 03, 2009, 08:01:04 am »
What's confusing?  ;)


1. Can anyone see the EA bug in this diagram? *
2. The "problem" is that each of these C1's is a different classifier.  Where Sparx has it wrong, IMO, is that according to UML any classifier in the same namespace with the same name is the same thing.  As I've said before, there is no UML "law" that says you cannot have more than one representation of the same classifier in a diagram.  However, as pointed out by Paolo, UML does not offer a convenient rendering to say that there is more than one of this classifier in this diagram.  
3. This problem has existed in EA since, oh I dunno, version 5?, and the message still says "Currently, only one instance is supported..."  grrrr  >:(

bruce

* The bug is that EA validates this diagram as 100% correct, ignoring the fact that C1 is its own parent.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6265
  • Karma: +104/-89
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Using an element more than once on a diagram
« Reply #7 on: November 03, 2009, 09:14:25 am »
Quote
[size=18]...[/size]
Could this be where EAUI comes from?   ;)

bruce is, of course, right!   The REAL EA bug is allowing two items of the same type in the same namespace with the same name to be different items!

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

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Using an element more than once on a diagram
« Reply #8 on: November 03, 2009, 09:46:48 am »
Quote
The REAL EA bug is allowing two items of the same type in the same namespace with the same name to be different items!

Ouch, never thought that far, that s.o. could have the idea doing such stupid thing ...
One should see in the project tree, that there's s.th. wrong. But I agree Paolo, EA shouldn't even allow it (CCC)!

WBR
GŁnther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2529
  • Karma: +33/-2
    • View Profile
Re: Using an element more than once on a diagram
« Reply #9 on: November 03, 2009, 10:53:46 am »
Quote
1. Can anyone see the EA bug in this diagram?

Assuming the diagram is UML, the only construct that is definitely illegal is the self-generalization which gets picked up by model validation though I think it should also be disallowed when you have the "Strict UML Syntax" option switched on. Regarding the rest of the diagram, my advice is "don't do that".
« Last Edit: November 03, 2009, 11:15:00 am by KP »
The Sparx Team
support@sparxsystems.com

beginner

  • Guest
Re: Using an element more than once on a diagram
« Reply #10 on: November 03, 2009, 01:09:04 pm »
Quote
What's confusing? †;)


1. Can anyone see the EA bug in this diagram? ...
Agreeing with the rest of your statements s-o-s I just see one "error": the italic C1 in the right top C1. I thought this should only be displayed if the parent is NOT present in the diagram. Or it's just there to confuse us Germans. Do you have a non-displaying fifth C1 somewhere which is another parent of the child-of-itself?

b.

son-of-sargasso

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: Using an element more than once on a diagram
« Reply #11 on: November 03, 2009, 01:30:15 pm »
OK, I'll fess up. †:) †The parent name in the upper right corner is an alias for an unshown class and I turned on "Use alias when available".

That C1 in fact has two generalizations, one to the unshown class and the shown self generalization.

@KP : Yep, strict was turned on. Using the diagram context menu item "Add new item or connector" †I selected generalize, then clicked on the TRC "C1" and bang it created the self generalization. †As for don't do that, the fact still remains that you can create more than one classifier in a namespace with the same name. †That is, IMO, against the "law".

bruce

P.S. Toodle-oo. Back tomorrow, I'm off to donate my hard earned to the TAB. † ( I presume Sparxians are about to suffer an unexpected overall communication falure of phones and email too! † ::);) )

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6453
  • Karma: +55/-6
    • View Profile
Re: Using an element more than once on a diagram
« Reply #12 on: November 03, 2009, 03:37:43 pm »
Quote
P.S. Toodle-oo. Back tomorrow, I'm off to donate my hard earned to the TAB.   ( I presume Sparxians are about to suffer an unexpected overall communication falure of phones and email too!   ::)   ;) )

Nah, we're still running today. †;)
« Last Edit: November 03, 2009, 03:38:45 pm by simonm »
Simon

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6265
  • Karma: +104/-89
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Using an element more than once on a diagram
« Reply #13 on: November 03, 2009, 05:38:02 pm »
Quote
Quote
P.S. Toodle-oo. Back tomorrow, I'm off to donate my hard earned to the TAB. † ( I presume Sparxians are about to suffer an unexpected overall communication falure of phones and email too! † ::);) )

Nah, we're still running today. †;)
So are we, but I DID manage to win the Office Sweep!  I think I'll make AU$50!  Not bad for a $5 investment...

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: 8482
  • Karma: +207/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Using an element more than once on a diagram
« Reply #14 on: November 03, 2009, 06:53:33 pm »
Oh, this issue again ;D

Well, my point of view is that EA is not fully UML compliant because it doesn't allow multiple representations of the same element on a diagram.

For those of you who consider it a bug in the specs to show multiple representations of the same element in a diagram. Remember that a diagram is ONLY there for communication with Humans, because they cannot understand a purely hierarchical model without diagrams.
Semantically a diagram means NOTHING.
That is the reason why there are no rules for diagrams. There might be "best-practices" that tell us not to represent an element twice on a diagram, but no rules.
Remove the diagrams from a model and you have not lost anything (except for a convenient way to communicate its contents to Humans)

Geert