Book a Demo

Author Topic: Shalow copy does not work for object elements  (Read 6947 times)

AlexY

  • EA User
  • **
  • Posts: 60
  • Karma: +3/-0
    • View Profile
Shalow copy does not work for object elements
« on: September 21, 2009, 03:22:23 pm »
Dear All,

When I copy a diagram in "Shallow" mode, EA copies Class elements correctly in the "Shallow" mode(links class images in the new diagram to existing elements in the model), but all object elements EA copies in "Deep" mode (creates duplicate elements).

Does anyone experience the same problem?
Is there maybe some "hidden" option I am missing?

Thanks,
Alex.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shalow copy does not work for object elements
« Reply #1 on: September 21, 2009, 03:41:40 pm »
I don't think you are missing some sort of hidden option.
I've just tested it and it does the same here.
You better report it as a bug to Sparx (use the link http://www.sparxsystems.com/support/bug_report.html on the bottom of the page)

Geert

AlexY

  • EA User
  • **
  • Posts: 60
  • Karma: +3/-0
    • View Profile
Re: Shalow copy does not work for object elements
« Reply #2 on: September 21, 2009, 08:55:35 pm »
I have just submitted a bug report.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Shalow copy does not work for object elements
« Reply #3 on: September 22, 2009, 08:15:13 am »
I haven't seen the bug report (yet) but just so you know, I have come across this before and it is intentional behavior.

The objects are copied because an object is an instance in a particular situation.  On the new diagram the situation is different so a new object is created.
« Last Edit: September 22, 2009, 08:16:17 am by simonm »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shallow copy does not work for object elements
« Reply #4 on: September 22, 2009, 02:05:24 pm »
Quote
I haven't seen the bug report (yet) but just so you know, I have come across this before and it is intentional behavior.

The objects are copied because an object is an instance in a particular situation.  On the new diagram the situation is different so a new object is created.
Hi Simon,

I guessed this was the reason.  However, the final assertion is NOT correct.

It is not always the case that the new diagram is a new situation. Just as often it is the case that the new diagram is a different view of the same situation and the old diagram is a good starting point for the new view.  This is, in fact, my usual use case when copying between diagrams.

EA needs to provide support for both use cases.

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

AlexY

  • EA User
  • **
  • Posts: 60
  • Karma: +3/-0
    • View Profile
Re: Shalow copy does not work for object elements
« Reply #5 on: September 22, 2009, 09:06:18 pm »
I agree with Paolo.

Simon, your premise about "objects having only one digram scope" makes sense within frames of conventional use of objects in software design - to clarify a class diagram, if necessary (usually not), making object elements relevant only within a scope of one diagram.
As such, the conventional understanding of a role of UML objects in software design effectively makes objects and object diagrams second class citizens in UML requiring such "special treatment" like the "Deep" copy mode for objects, when all other elements are copied in "Shallow" mode.

I use objects as basic construct in bottom up reverse-engineering of exiting IT systems - a task far more common today than top down software design. I use classes and objects exactly as they were invented - classes to represent classes of physical and software objects and objects to represent concrete instances of physical/software objects/components/things.
The same objects appear across many diagrams and represent the same instances of physical/software objects/components/things. A Shallow copy mode is required to copy such objects.

I would suggest to expand the "diagram coping" function with one more mode - "Mixed" mode.
In this case it would have 3 modes:
- Shallow - copy all elements in Shallow mode
- Deep - copy all elements in Deep mode
- Mixed - copy classifiers in Shallow mode, instances in Deep (this is the current Shallow mode).

Regards,
Alex.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shalow copy does not work for object elements
« Reply #6 on: September 22, 2009, 10:50:18 pm »
That seems like a very good solution.
Gets my vote!

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shalow copy does not work for object elements
« Reply #7 on: September 23, 2009, 08:35:59 am »
And, obviously, mine...  ;D

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

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Shalow copy does not work for object elements
« Reply #8 on: September 27, 2009, 06:19:03 am »
Me too.

This viewpoint on objects (instances in general) is particularly relevant to organizational modeling. Even more so as you move beyond structural models.
No, you can't have it!