Author Topic: UML Profiles / extending base set of attributes  (Read 4001 times)

Dave_Bullet

  • EA User
  • **
  • Posts: 295
  • Karma: +0/-0
    • View Profile
UML Profiles / extending base set of attributes
« on: April 27, 2006, 08:28:26 pm »
I want to force a base set of metadata to be captured for every UML element (at a minimum classes, components, nodes and associations).

For example, when an EA user adds a node to a deployment diagram, the need to set values for the following:
- Technical owner (char type) mandatory
- Physical location (char type) mandatory

I want the above to be generic and apply to many other elements (ie. the above equally applies to classes, where the tech owner is the developer and location is a URL etc...)

Can someone kindly explain how I can configure EA to do the above?

Thanks,
David.
« Last Edit: April 27, 2006, 08:29:38 pm by Dave_Bullet »
"I know I'm close to a good design, but it's like the balloon animals, squeeze in one spot and the problem moves down the line"

thomaskilian

  • Guest
Re: UML Profiles / extending base set of attribute
« Reply #1 on: April 28, 2006, 01:25:15 am »
David,
you can't force EA to do this automatically for you. Checks for mandatory fields can be forced only by using the automation interface. You might run a self-made consistency check to produce an error report where data are missing.
« Last Edit: April 28, 2006, 01:25:46 am by thomaskilian »

Dave_Bullet

  • EA User
  • **
  • Posts: 295
  • Karma: +0/-0
    • View Profile
Re: UML Profiles / extending base set of attribute
« Reply #2 on: April 30, 2006, 02:18:38 pm »
Thanks Thomas,

I don't think I've made myself very clear.  The mandatory is a nice to have....

What I want to know is - where do I start?  How would I add a simple string called say TechnicalOwner as a default (optional or mandatory - doesn't matter) - to the base metamodel / profile that EA uses - to the base clase in the UML hierarchy (if that makes sense).  This is so all elements, associations etc... will have a TechnicalOwner "property" that can be set a value for every class, node, component, association etc... created in an EA model.

The on-line help is useful in telling me how to add new stereotypes / metaclasses etc... but not how to change the base types used by EA.

Thanks,
David.
"I know I'm close to a good design, but it's like the balloon animals, squeeze in one spot and the problem moves down the line"

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: UML Profiles / extending base set of attribute
« Reply #3 on: April 30, 2006, 03:32:15 pm »
Quote
Thanks Thomas,

I don't think I've made myself very clear.  The mandatory is a nice to have....

What I want to know is - where do I start?  How would I add a simple string called say TechnicalOwner as a default (optional or mandatory - doesn't matter) - to the base metamodel / profile that EA uses - to the base clase in the UML hierarchy (if that makes sense).  This is so all elements, associations etc... will have a TechnicalOwner "property" that can be set a value for every class, node, component, association etc... created in an EA model.

The on-line help is useful in telling me how to add new stereotypes / metaclasses etc... but not how to change the base types used by EA.

Thanks,
David.


UML says you can extend its base classes by using a stereotype to apply tagged values and/or constraints. If you don't use a stereotype, you can't extend. EA follows UML in this regard.

However, what you might be able to do is to write an add-in to intercept the EA_OnPreNewElement broadcast event and create a tagged value. Search the help file for "EA_OnPreNewElement" for more information, and come back here with any questions.

Neil  :)
The Sparx Team
[email protected]

abcoates

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: UML Profiles / extending base set of attribute
« Reply #4 on: June 06, 2006, 02:35:46 am »
What UML 2.0 says is that you need a stereotype to get tagged values, but that you can define a stereotype to be 'required' so that it is applied to all classes (or all UML 2.0 elements of a particular kind) automatically.  UML applications are free to use this mechanism to simulate global tagged values.

So, EA needs to support 'required' stereotypes, and to support hiding of certain stereotypes (so that global required stereotypes can be hidden).  I'm pretty sure EA doesn't support required stereotypes yet, don't know about hiding particular stereotypes in diagrams.

Cheers, Tony.

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
Re: UML Profiles / extending base set of attribute
« Reply #5 on: June 07, 2006, 02:46:20 pm »
Quote
What UML 2.0 says is that you need a stereotype to get tagged values, but that you can define a stereotype to be 'required' so that it is applied to all classes (or all UML 2.0 elements of a particular kind) automatically.


true, true... when using such particular UML profile

registertm  ;D -> register as enhancement (bug?)
registertm everything to SparX

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: UML Profiles / extending base set of attribute
« Reply #6 on: June 07, 2006, 10:28:39 pm »
Quote
I'm pretty sure EA doesn't support required stereotypes yet


No, not yet. EA doesn't yet have the concept of applying profiles to whole packages; it just allows you to load the profile and use it to apply stereotypes to elements in an ad hoc manner. Required stereotypes are on our wish list, but still some way in the future.

Quote
don't know about hiding particular stereotypes in diagrams.


Well you need to be able to show them before you can hide them. Currently, elements have a primary plus an unordered list of secondary stereotypes, but only the primary stereotype is shown on diagrams. For the next major version of EA, we are working on showing them all as an ordered list. It'll be some time before we can work on hiding some of them again.

« Last Edit: June 07, 2006, 10:53:41 pm by KP »
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: UML Profiles / extending base set of attribute
« Reply #7 on: June 08, 2006, 12:32:37 am »
Quote
[size=13][SNIP][/size]
Currently, elements have a primary plus an unordered list of secondary stereotypes, but only the primary stereotype is shown on diagrams.
[size=13][SNIP][/size]
Does the "secondary" list also include the primary?  It does on the UI - the primary is included on the check boxes.

Paolo


Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: UML Profiles / extending base set of attribute
« Reply #8 on: June 08, 2006, 06:03:57 am »
I think the gist of it is that the 'group' of stereotypes comprises the primary stereotype, followed by the "list" of secondary stereotypes.

Depending on what you ask for and what you are looking at, you will either get the first element of the 'group' - the primary stereotype - or the entire set - the primary followed by the rest.

I think that the primary appears at the top of the check boxes; is that correct? [Given the method Sparx has used to assign stereotypes, this would be CCC within that scope.]
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: UML Profiles / extending base set of attribute
« Reply #9 on: June 08, 2006, 06:11:22 am »
Quote
I think the gist of it is that the 'group' of stereotypes comprises the primary stereotype, followed by the "list" of secondary stereotypes.

Depending on what you ask for and what you are looking at, you will either get the first element of the 'group' - the primary stereotype - or the entire set - the primary followed by the rest.

I think that the primary appears at the top of the check boxes; is that correct? [Given the method Sparx has used to assign stereotypes, this would be CCC within that scope.]
No, the stereotypes are in alphabetical order.

If you have multiple stereotypes and remove the "primary", interesting things happen...  If you then add the primary back (via the check boxes) then more interesting thongs happen...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: UML Profiles / extending base set of attribute
« Reply #10 on: June 08, 2006, 06:17:08 am »
Sigh...

However the "interesting thongs" sound like a fun feature!
No, you can't have it!