|
Re: Modelling Attribute Dependencies [message #1734247 is a reply to message #1734202] |
Mon, 06 June 2016 14:20 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi
You don't say which tool you are using.
With tools that only support static modeling tough, you cannot impose
your semantics, but you can add validation rules to warn of the
inconsistency.
Others tools offer an opportunity to filter the selections and so impose
the semantics.
Since prohibition of blue paper is not a fundamental limitation, I think
that you would be over-modeling to impose a limit on the input. Just
check it with today's validation rules.
Regards
Ed Willink
On 06/06/2016 15:04, Xi Ng wrote:
> Hello,
> I am new to EMF. I have a modeling question. I have already read a
> some papers and post, but I am not finding a proper solution. What I
> would like to model ist the following in my meta-modell:
>
> The class "Features" has two attributes "material" and "color".
> When the user creates an Instance of this class "Features", he should
> first select "material". The eType of this attribute is EEnum and the
> user can select, lets say "plastic" or "paper".
>
> I am able to model it up to here. But now I don't know how to model
> the following:
>
> If the user selects "plastic", it then should be able to choose for
> the "color" attribute between "pink" and "blue". Whereas when the user
> selects "paper", he should only be able to select for the "color"
> attribute from "black" or "white".
> Does anybody have a suggestion how to model this nicely? I have
> thought and read about generics or dynamic modeling. But as I am new
> to EMF, maybe there is a nice / easy / clean way how to do it. I am
> happy for any suggestions.
|
|
|
|
|
Re: Modelling Attribute Dependencies [message #1734441 is a reply to message #1734423] |
Wed, 08 June 2016 11:44 |
Xi Ng Messages: 26 Registered: June 2016 |
Junior Member |
|
|
Hello,
thank you for your reply.
I have two more questions:
1. Which tools only support static modeling? Or better: Does Eclipse Modeling Mars support only static modeling?
2. Where exactly (which package/class) do I implement (and find today's) validation rules?
Thank you for your help!
[Updated on: Wed, 08 June 2016 11:45] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04980 seconds