Author Topic: how to extend the class diagram using Add-ins?  (Read 3003 times)

Xuxin

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
how to extend the class diagram using Add-ins?
« on: May 29, 2013, 11:58:10 pm »
Hello,

I'm the beginner for EA add-ins development. I read Greert's study EA addins in 10 minutes. I would like to add new properties for each class in the class diagram of EA. And store or query these properties into the SQL database.

Could anyone help me to suggest any tutorial about this question, please?  :-?

Best Regards,
Xuxin

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: how to extend the class diagram using Add-ins?
« Reply #1 on: May 30, 2013, 12:02:58 am »
IMHO it's a better approach to setup UML profiles and add your additional properties using stereotypes and tagged values (look for MDG technologies). If needed you can additionally add an AddIn that conforms with your MDG technology and manages your tagged value properties (integrity checks, automatic value selection, etc.).

HTH
Günther

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13241
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: how to extend the class diagram using Add-ins?
« Reply #2 on: May 30, 2013, 03:56:27 pm »
I can confirm that, the best solution would be to define a profile, with a new stereotype, and add properties to this new stereotype.
These properties will then be translated to tagged values on each class that has your stereotype.

You can then deploy this stereotype using an mdg technology.

If needed you can also add your own dialogs specific for your stereotype (to allow users to fill these in without having to go into the tagged values dialog), but then you'll need to combine an add-in with an MDG technology (MDG addin).

Unless of course you don't want to use a stereotype, and you want to add these properties to standard UML classes or other elements.
In that case don't want MDG, and you'll have to use plain old code to add the required properties.

I would suggest anyways to use tagged values to store the properties.

There are a number of EAOnNew... events that you can use to add the tagged values to newly created elements.

As a one time event you may want to loop all elements in the model and add the tagged values to each of them.

Geert