Book a Demo

Author Topic: Customizing UML Metamodel with Profile  (Read 4877 times)

tonySparx

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Customizing UML Metamodel with Profile
« on: January 15, 2010, 04:21:15 am »
Hi all, I'm developing an EA add-in which provides its own Metamodel, i.e there will be new stereotype <<A>>, <<B>>, <<C>>,..., applied to some metaclass, connector and so on. EA allows to add those new stereotypes (with tag values, new appareance, etc), but my question is: Is EA allows to set up any constraints (rules) over these new stereotype (for a new customized Metamodel): for example I want that  two requirements with stereotype <<A>> can be only related by a connector with stereotype <<B>>.
I read help's Profile Section, but I haven't found a thing like this... Is there another way that I have not checked to implement this kind of "rule" or, like I suppose, it can be realized "only" writing code based on "rules template" suggest in the help under "SDK for Enterprise Architect" ("Enterprise Architect Add-In Model" section) using an appropriate handler for EA_OnPreNewConnector event? In this last way I can check the client and supplier elements and return false if they don't match stereotypes contemplate by my custom metamodel.


Any help would be appreciated.
Many thanks in advance!!!  :D

Antonio
"everything is possible, but there are things more likely than others..." © all rights reserved

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Customizing UML Metamodel with Profile
« Reply #1 on: January 15, 2010, 05:42:12 pm »
Antonio,

I think indeed writing some validation code in the EA_OnPreNewConnector event handler is probably the best way to go.
I don't think you have to follow the rules template, but I could be a good idea as it would allow you to use those rules in the model validator as well.

Geert

tonySparx

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Customizing UML Metamodel with Profile
« Reply #2 on: January 15, 2010, 07:23:18 pm »
Quote
...but I could be a good idea as it would allow you to use those rules in the model validator as well.

Thanks a lot Geert!!
In fact, this is another feature I would implement... ::).

Any hint, instead, for consistence stuff?
I have established rules for what a connector may connect from and connect to, right? Thus, if the connector and the end objects change, they may invalidate themselves.

What could be the approach to address this issue?Should I apply these rules at connector creation time AND everytime the connector itself or a connector end changes?
I suppose this is the only (heavy) way to proceed with EA provided features. Am I wrong?  :-[

Thanks in advance

Antonio
"everything is possible, but there are things more likely than others..." © all rights reserved

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Customizing UML Metamodel with Profile
« Reply #3 on: January 15, 2010, 07:43:27 pm »
Yes, I guess so...

Or you could step off the "real time" validation and go to a "Model Validation" scheme where you validate (verify) the model as a whole afterwards.

With the current state of EA and the hooks it provides I think the latter will probably be your best option.

As for the model validation; I would seriously consider NOT using the built-in facility, but write your own from scratch. (that's how I did it anyway). I'm afraid the built-in validator will be too limited for your purposes.

I've recently written some articles about Modelling Quality and a Validation Tool that might interest you.

Geert

tonySparx

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Customizing UML Metamodel with Profile
« Reply #4 on: January 15, 2010, 08:36:49 pm »
Quote
I would seriously consider NOT using the built-in facility, but write your own from scratch. (that's how I did it anyway). I'm afraid the built-in validator will be too limited for your purposes.

I considered this opportunity, but one of my main goals is make the most EA and hooks it provides (EA capability-reuse) without reinventing the wheel, even if it's not the best model validation engine on the market.
However, I can always improve it through writing code, I guess...

P.S. I checked out your articles, they're really interesting! ;)

Thanks again for the help!

Antonio
"everything is possible, but there are things more likely than others..." © all rights reserved

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Customizing UML Metamodel with Profile
« Reply #5 on: January 15, 2010, 08:46:35 pm »
Quote
I considered this opportunity, but one of my main goals is make the most EA and hooks it provides (EA capability-reuse) without reinventing the wheel, even if it's not the best model validation engine on the market.
However, I can always improve it through writing code, I guess...

P.S. I checked out your articles, they're really interesting! ;)

Thanks,

I understand why you would think like that however be aware that:
  • The vendor lockin will increase when you write tools specific for EA.
  • You will probably get stuck at some time or another with the built-in features. You will then have to either live with the shortcomings, or write the whole thing from scratch after all.

You are not alone with these considerations, that is one of the reasons I started the Create Open source tooling framework topic.

I am working on something like this, at first only for my own EA <-> UmlCanvas needs.
Once it reaches a somewhat mature state I'll definitely share it via the community site.

Geert