Author Topic: Is it possible to merge two classes into one?  (Read 2245 times)

AndyJ

  • EA User
  • **
  • Posts: 332
  • Karma: +5/-2
  • It's only a model
    • View Profile
Is it possible to merge two classes into one?
« on: May 26, 2011, 08:41:47 am »
Good morning everyone...

The current project involves a number of Business Analysts who are working on separate parts of the problem definition phase...

We're currently creating domain models (class diagrams) and will often be in a position where a single entity will be "discovered" by more than one BA.

Where we later find two classes (on multiple diagrams) which should be a single class...

Is there a method for merging two classes into one?

Andy
Sun Tzu: "If you sit by the river long enough, eventually the body of MS Visio floats past."

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8623
  • Karma: +211/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Is it possible to merge two classes into one?
« Reply #1 on: May 26, 2011, 06:19:28 pm »
Andy,

Because of a mess-up with a shared part of our models, and the option "Strip GUIDs" (before we introduced version control) I had the same challenge to "merge" different versions of the same elements.
I ended up writing a tool in C# to fix up all references.
I remember having to change
- connectors
- attribute types
- parameter types
- diagramObjects
- objects (using an element to merge as classifier)

Geert

(unfortunately I'm unable to share the code as it belongs to my client)

AndyJ

  • EA User
  • **
  • Posts: 332
  • Karma: +5/-2
  • It's only a model
    • View Profile
Re: Is it possible to merge two classes into one?
« Reply #2 on: May 27, 2011, 08:39:49 am »
Thanks Geert,

So far we've managed to avoid having to do any coding associated with EA...

I think I'll stress to the team, the difficulty of manually rounding up all occurrences of a duplicated class, and the required analysis to make sure that they are indeed identical "things" and the manual steps required to replace all instances of one class with another class on all models.

Andy
Sun Tzu: "If you sit by the river long enough, eventually the body of MS Visio floats past."