Author Topic: Profile modelling questions  (Read 4296 times)

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Profile modelling questions
« on: March 14, 2009, 01:14:59 am »
Hi everyone,

I already have developed simple UML-Profiles in EA, to support my own sets of tagged values for stereotyped elements.
Now I am trying to do some more sophisticated stuff, but the EA help isn't very elaborate how to do such constructs.
I'am trying to model kind of a class element, that (similar as a table) may contain only attributes, no operations. Also those attributes should be restricted to have a particular stereotype, because I need some tagged values for them, that aren't supported by the standard attribute element. I have defined stereotypes for the class and the attribute, and just using those from the imported profile works fine. But I don't know how to link them together, to achieve the restrictions I want, also didn't find an obvious way how to restrict the class stereotype to contain attributes only.
Can anyone give me a hint where to find some good WhitePaper or other documentation about UML profile modelling in general, or even better, tailored for the use with EA.
Anyway, I also appreciate to get suggestions from you, how to model the detail problems I have described above in the UML profile.

Thanx in advance,
Günther
« Last Edit: March 14, 2009, 01:17:16 am by Makulik »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Profile modelling questions
« Reply #1 on: March 16, 2009, 09:37:00 am »
There is no way in EA to enforce the constraints "A class with stereotype X cannot have operations" or "A class with stereotype X can only have attributes with stereotype Y". However, you can write an add-in to perform model validation and report on violations of the constraints. Search the help for "Model Validation Broadcasts"...
The Sparx Team
[email protected]

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Profile modelling questions
« Reply #2 on: March 18, 2009, 07:58:41 am »
Thanks for the reply KP, I was afraid it turns out to be like this. What I am actually trying to do, is to setup a new supported language (Google protobuf message definitions) for use with EA. Besides validation, the more interesting feature to override its behavior, would be the standard 'Add Attribute' operation for my stereotyped class. But I am afraid there's no easy way to achieve this, even with an add-in ...

WBR
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Profile modelling questions
« Reply #3 on: March 18, 2009, 09:07:02 am »
With an add-in, you can get something working. Search the EA help for 'EA_OnPreNewAttribute'. If you implement this broadcast handler, you can examine the element an attribute is being added to and the stereotype of the attribute being added and either allow or disallow the creation of the attribute.
« Last Edit: March 18, 2009, 02:30:36 pm by KP »
The Sparx Team
[email protected]