Book a Demo

Author Topic: Stereotype Properties  (Read 2718 times)

julie w

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Stereotype Properties
« on: April 13, 2006, 07:27:59 am »
Hi - my first posting so a complete newbie!  
I want to create a new stereotype which behaves the same way as the XSDsimpleType stereotype, i.e. when you right click and select properties for an XSDsimpleType stereotyped class in the project view you get a dialog box with information on the class.  I have successfully added a new stereotype using the Settings/UML/Stereotypes dialog but can't see how to define the properties (I've selected a base class of Class, as per XSDsimpleType).  When I try to view the properties of one of my new stereotyped classes nothing comes up.

Ultimately what I'm aiming to do is set up a package of in-house created xml data types and distinguish these from the standard XSD data types so if anyone has any thoughts on a better approach than a new stereotype then I'd welcome ideas.

Thanks
Julie

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Stereotype Properties
« Reply #1 on: April 13, 2006, 09:16:02 am »
Hi Julie,

First posting seems OK, so now you're (I guess) an 'incomplete' newbie.

Let's see if I have this right. You have a stereotype on either: an 'ordinary' class that you want to act like the XSDsimpleType entity, or you want to stereotype the XSDsimpleType entity itself but retain much of its behavior. You'll have to tell me which.

When you right-click your stereotyped entity (of whichever sort) you want to have the Properties dialog appear (or be available from the context menu). I also suspect that you would like the dialog to be similar to that of the XSDsimpleType entity, but please correct me if I'm wrong.

This does not seem like a problem, so I suspect it is either completely impossible the way you are trying to do it, in which case there is probably a different way that works, or a simple matter of tweaking how you are doing it now.

Please let me know which of my assumptions above apply. I'll look at this a bit when I get a moment today and see if I can get you going.

In the meantime check here in case somebody has the solution handy.

David
No, you can't have it!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Stereotype Properties
« Reply #2 on: April 13, 2006, 09:32:47 am »
Hi again,

I see more of what you are saying now. My guess is that this is a bit like the data modelling functionality. When you stereotype a class as a <<table>> EA treats it differently, and brings up a different dialog than with 'ordinary' classes. Thus, you can create columns without having to stereotype them by hand, and enter meaningful values into them.

This capability is beyond the basic UML functionality (although perfectly 'legal' of course). EA handles the situation by invoking an alternate dialog directly. Unfortunately, at this time (or last time the Sparx folks answered a question about this, not too long ago) the function resides entirely inside EA, and is not accessible to the user.

If the way they've approached the XML stereotypes is anything similar then you are probably out of luck.

If you really need this, and are willing to do a bit of work, you can achieve much or all of what you want with an add-in, captuing events and handling the dialogs yourself. It does mean some front-end work, but you would have very fine-grained control, and you could also extend the basic EA functionality.

David
No, you can't have it!

julie w

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Stereotype Properties
« Reply #3 on: April 14, 2006, 01:52:03 am »
Hi David,
Thanks for the information.  Having ploughed through all the help information I reckoned if there was a way to define properties for a new stereotype it would have jumped out at me.  I knew it was something that would have to be defined to the EA metamodel somehow so I guess if that's not possible I'll just need to stick with the existing XSD stereotype (it does rather beg the question though, why can you create new stereotypes if you can't easily define properties?).  One of our prime uses of EA is going to be schema generation so it may be that what I was considering would have screwed it all up anyway, I just haven't got that far with my newbie playing with toys stage....

I'll bear in mind the idea of plug ins, a bit beyond me right now though!

Julie

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Stereotype Properties
« Reply #4 on: April 14, 2006, 04:15:47 am »
You can however apply tagged values to stereotypes. Personnally I have not done this with EA, but I believe it works here too.

These would be one or more tagged values that would apply to any element with the stereotype. As I understand it (UML, but without experience in EA here, once again) these could be: tags that might apply to the element, tags that always apply to the element, or tags that have a default or (forced) specific value for the element.

Using these tags you could define quite a few properties. EA allows you some interesting flexibility with tagged values - look into the tagged value types in the EA help.

When it comes time to generate code, for example, EA has scripting time functions such as HasTag("tvName") which allow you to test whether a given tag applies, as well as the ability to retrieve the value.

The above functions are also available within shape scripts, although the documentation is not up to date. Look at the BPMN plug-in (you can download it from Sparx) to see how testing tagged values can drive shape generation based on a stereotype.
No, you can't have it!