Book a Demo

Author Topic: Redesign classes - best practicies  (Read 6387 times)

Michel777

  • EA User
  • **
  • Posts: 228
  • Karma: +0/-0
    • View Profile
Redesign classes - best practicies
« on: October 06, 2015, 12:23:53 am »
Hi,

our project changes an existing application and so also the underlying classes.
The differences between the two classes ("old" and "new")

should be marked on the diagram and
should be exported (word document)

Remarks: the most differences are:

(90%) attribute has been

a) removed
b) added
c) changed

(10%) operation has been

a) removed
b) added
c) changed

Questions:

1) How to model the classes ?
2) How to mark the differences ?
3) Is there a tool to compare 2 classes ?
4) Is it possible to create relationships on the attribute / operation level That means to bind the corresponding attributes ?

Thanks a lot in advance,

Michel



Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Redesign classes - best practicies
« Reply #1 on: October 06, 2015, 12:54:28 am »
Michel,

Don't try to maintain two version in your model.
Make a backup if you must, and copy/paste the old diagram in your document. Then work on the new (and only) version in your model and generate a document from there.
Then add the "old" parts to the document.

Geert

Michel777

  • EA User
  • **
  • Posts: 228
  • Karma: +0/-0
    • View Profile
Re: Redesign classes - best practicies
« Reply #2 on: October 06, 2015, 01:02:42 am »
Geert,

thanks a lot.

Left questions:

1) is there a way to mark attributes / operations ?
2) The question: " Is it possible to create relationships on the attribute / operation level That means to bind the corresponding attributes ?" meet other modeling techniques (e.g. bind some attributes between two whole different classes)

Tanks,

Michel

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Redesign classes - best practicies
« Reply #3 on: October 06, 2015, 02:11:47 am »
1) What do you mean by mark? Bookmark? No. Only for elements.

2) Linking is only possible on diagrams (Link to Element Feature).

q.
« Last Edit: October 06, 2015, 02:12:58 am by qwerty »

Michel777

  • EA User
  • **
  • Posts: 228
  • Karma: +0/-0
    • View Profile
Re: Redesign classes - best practicies
« Reply #4 on: October 06, 2015, 03:26:01 am »
1) mark = indicate, that the attribute was changed / added. E.g. with checkbox, colour,...
2) yes on the diagram: but I can not find any references on the attribute / class level...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Redesign classes - best practicies
« Reply #5 on: October 06, 2015, 03:45:52 am »
1) so my answer stays valid
2) because there is none.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Redesign classes - best practicies
« Reply #6 on: October 06, 2015, 07:30:17 pm »
Hi Michel,


First off, Geert is right in saying that maintaining two versions of the same model in the same project is essentially impossible. EA is not built that way.

If you only want to see differences between old and new, baselines work well -- but only if you will never be making any changes to the old version. With baselines, the old versions are stored in XML format, not as regular models, so they're essentially frozen in carbonite. You can compare the current model to a baseline, but you can't change what's been baselined.

If you want to actively maintain two different versions, work in two projects instead. If you want to see differences between versions in different projects, again baselines work (you can move baselines between projects), but you have to set the structure up to support this before you begin modelling (GUIDs for the baselined elements must be the same in the two projects in order for EA to compare them).

Quote
1) is there a way to mark attributes / operations ?
A simple way is to set a stereotype "new" / "old" / "deleted". Note that EA will by default sort attributes/operations first in order of stereotype. You can change this behavior in the options.

(Of course, keeping "deleted" attributes in the model means you can't do things like code generation from the model without modifying the code generation templates, but I'm assuming you're not doing that.)

If you create your own UML profile, you can write a shape script which displays the attributes/operations differently depending on tagged values. I don't think you can set text colours, but you could get something like
Code: [Select]
+ [N] myAttr: Integer
+ [O] myOtherAttr: Boolean
But I wouldn't recommend this for a small model or if you're new to MDG Technologies; classes are complex beasts and overriding their default shape script isn't easy.

Quote
2) The question: " Is it possible to create relationships on the attribute / operation level That means to bind the corresponding attributes ?" meet other modeling techniques (e.g. bind some attributes between two whole different classes)
Yes, by using the "link to element feature" function (right-click the connector near the class where you want the connector to tie to a particular attribute/operation).

Note that this is an EA-specific feature not supported by UML. Thus the attributes and operations themselves cannot have relationships; EA just displays them in the diagrams in a way that makes it look as if they do.

In addition to all that, EA has a function called Gap Analysis Matrix. This works on two parallel model structures and identifies / records gaps, ie differences between them. It might be worth a look in your case.

Cheers,


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

Michel777

  • EA User
  • **
  • Posts: 228
  • Karma: +0/-0
    • View Profile
Re: Redesign classes - best practicies
« Reply #7 on: October 07, 2015, 10:47:43 pm »
Thanks a lot, Uffe !

Some additional questions:

1) Linking attributes: it is only possible to link
    an Element to
    an Attribute

but never an attribute to an attribute. Right ?

2) The GAP analysis shows differences only an class level, never on attribute level. That means changes of attributes remain hidden. Right ?

Thanks a lot in advance,

Michel

Michel777

  • EA User
  • **
  • Posts: 228
  • Karma: +0/-0
    • View Profile
Re: Redesign classes - best practicies
« Reply #8 on: October 07, 2015, 11:19:54 pm »
1) it is possible. see attached screenshot.  
« Last Edit: October 07, 2015, 11:22:31 pm by michel777 »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Redesign classes - best practicies
« Reply #9 on: October 07, 2015, 11:50:16 pm »
Hi again,

1) Yes, it's possible. You just need to "link to element feature" twice, once at either end of the connector.

2) No, it finds attribute and operation changes as well, but only added / deleted. Changed type etc doesn't show up (although operation parameter types are shown).

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

Michel777

  • EA User
  • **
  • Posts: 228
  • Karma: +0/-0
    • View Profile
Re: Redesign classes - best practicies
« Reply #10 on: October 08, 2015, 01:37:04 am »
Hi,

does anyone know, how to find the endpoints (class.attribute) in the database ?

Thanks a lot,

Michel

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Redesign classes - best practicies
« Reply #11 on: October 08, 2015, 02:02:03 am »
t_attribute.

There are some topics on this forum on how to find the attribute in a "link to element feature" scenario.

Use top left search button

Geert