|
Re: conditional constaints [message #723779 is a reply to message #723677] |
Fri, 09 September 2011 12:23 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Comments below.
On 08/09/2011 10:52 PM, exquisitus wrote:
> I want the lowerBound and the changeable constraints be more flexible.
It's not like that we can arbitrarily change how they work.
> They shall have different values for certain stages in the lifecycle
> of an eobject.
That sounds unworkable. The Ecore model is supposed to be static.
> While I could do this with the lowerBound constaint by overriding
> validate_MultiplicityConforms in the generated Validator class and
> then setting eStructuralFeature.setLowerBound() (and resetting to the
> old value in the finally block), I not managed to hook into the
> changeable implementation.
If you need to do something specific to your model, best you do it in
its derived validator via additional constraints.
> Any idea how to hook into it ?
It affects how the model is actually generated. If there's a setter, it
can be called. There's no hook to prevent it.
> I want a feature to be readonly in certain lifecycle stages.
Are you expecting some malicious attempt to change the objects?
> I do not want to add adapters to each eobject, because adding the
> adapters requires support by the application logic.
I don't understand this comment.
> E.g. a GMF-Editor will not add my adapters.
In the end someone is somehow turning something on and off, so what's
wrong with doing that with an adapter as opposed to some mechanism that
doesn't yet exist?
> Also its not very efficient of course.
I have to wonder what problem you're trying to solve...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03286 seconds