Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » how to add a custom property to a stereotype attribute?(i want to mark certain stereotype fields as, e.g. translatable)
how to add a custom property to a stereotype attribute? [message #786357] Mon, 30 January 2012 05:13 Go to next message
B Simpson is currently offline B Simpson
Messages: 25
Registered: January 2012
Junior Member
hello,
i'd like to give some stereotype's attributes special fields.
how can i do that? first i tried applying another stereotype to a stereotype's field but i don't think that is the right solution...
thanks..
Re: how to add a custom property to a stereotype attribute? [message #786701 is a reply to message #786357] Mon, 30 January 2012 13:32 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
Can you expand on the need you have to "give some stereotype's attributes special fields" (from an application point of view)? May make it easier to come up with alternatives knowing what the requirements are.


Re: how to add a custom property to a stereotype attribute? [message #787208 is a reply to message #786701] Tue, 31 January 2012 04:27 Go to previous messageGo to next message
B Simpson is currently offline B Simpson
Messages: 25
Registered: January 2012
Junior Member
hello rafael and others,
i am trying to come up with a Database schema that could be used in a C# application.
i would have UML2 diagram with Property stereotypes such as ('stringfield','timefield', 'numericfield') that would convert into DB types later on (during importing into PostgreSQL)
an example:
i have a class/table called 'users' with properties like:
- 'email' (no need for translation)
- 'job_title' (translatable feature)
Re: how to add a custom property to a stereotype attribute? [message #787583 is a reply to message #787208] Tue, 31 January 2012 13:54 Go to previous message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
I see, thanks for clarifying.

So depending on the kind of field, you would like to have additional type-specific properties, Is that it?

Would this work?

1) have a 'field' stereotype (with any properties that apply to all fields, regardless of type)
2) have a substereotype for each type of field that requires additional information, declaring in each of those substereotypes any properties required (max_length for stringfield, lower/upper limit for numericfield etc)
3) apply the concrete stereotypes only, not the base one

But before you go down that route, I'd advise looking for a better way of customizing code/schema generation that didn't require setting properties for each class' attribute.

Better to have a general mapping (say, based on type), and only exceptionally (if at all) tweaking things on a class basis.

Cheers,

Rafael
http://abstratt.com/blog

Previous Topic:override stereotype value
Next Topic:Experiences with model size and performance
Goto Forum:
  


Current Time: Sat Aug 23 09:40:45 EDT 2014

Powered by FUDForum. Page generated in 0.01774 seconds