Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Dynamic constraint provider
Dynamic constraint provider [message #63591] Mon, 04 December 2006 08:40 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
I'm working on an editor and execution environment, and now I'm
struggling with constraint validation. I've several static
constraints, that check model properties that always should hold, and
these work well. However, some constraints depend on the execution
environment that is currently linked to the editor, so for this
purpose the static constraints cannot be used.

The documentation describes how you can declare "dynamic" constraint
provides, i.e. constraint providers that generate the constraints
dynamically. However, in my case I cannot use XML, since my dynamic
constraint provider must be created in the context of my execution
environment (and not just from a class name in the XML). There does
not seem to be a way to register a constraint provider instance to the
ModelValidationService, i.e. to add a constraint provider that is
created without the use of XML.

Am I wright, and if yes, isn't this a design flaw?

Hallvard
Re: Dynamic constraint provider [message #63823 is a reply to message #63591] Tue, 05 December 2006 17:05 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Hallvard,

Have a look at the changes described in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=165661 to better support
non-XML-based constraint providers. These should make it feasible to
implement a more flexible constraint provider of the kind you need (before
even considering how or when the provider is constructed).

Can your constraint provider be registered on an extension point and created
statically, but obtain whatever context is required from the execution
environment at run-time? Your provider can define the API that your
application requires, to feed the context that it needs.

Once we have implemented
https://bugs.eclipse.org/bugs/show_bug.cgi?id=137213 (dynamic-awareness of
the extension points), a really ugly approach would be to create extensions
on-the-fly, but I don't think you could do that without violating the
internal/subclassing contracts of Eclipse's OSGi implementation. I expect
that when this feature is implemented, some API will have to be added to
add/remove constraint providers to/from the validation service. Please
append a comment and add yourself to the cc list so that your requirements
will be taken into consideration.

Cheers,

Christian

Hallvard Tr�teberg wrote:

> I'm working on an editor and execution environment, and now I'm
> struggling with constraint validation. I've several static
> constraints, that check model properties that always should hold, and
> these work well. However, some constraints depend on the execution
> environment that is currently linked to the editor, so for this
> purpose the static constraints cannot be used.
>
> The documentation describes how you can declare "dynamic" constraint
> provides, i.e. constraint providers that generate the constraints
> dynamically. However, in my case I cannot use XML, since my dynamic
> constraint provider must be created in the context of my execution
> environment (and not just from a class name in the XML). There does
> not seem to be a way to register a constraint provider instance to the
> ModelValidationService, i.e. to add a constraint provider that is
> created without the use of XML.
>
> Am I wright, and if yes, isn't this a design flaw?
>
> Hallvard
Re: Dynamic constraint provider [message #596562 is a reply to message #63591] Tue, 05 December 2006 17:05 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Hallvard,

Have a look at the changes described in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=165661 to better support
non-XML-based constraint providers. These should make it feasible to
implement a more flexible constraint provider of the kind you need (before
even considering how or when the provider is constructed).

Can your constraint provider be registered on an extension point and created
statically, but obtain whatever context is required from the execution
environment at run-time? Your provider can define the API that your
application requires, to feed the context that it needs.

Once we have implemented
https://bugs.eclipse.org/bugs/show_bug.cgi?id=137213 (dynamic-awareness of
the extension points), a really ugly approach would be to create extensions
on-the-fly, but I don't think you could do that without violating the
internal/subclassing contracts of Eclipse's OSGi implementation. I expect
that when this feature is implemented, some API will have to be added to
add/remove constraint providers to/from the validation service. Please
append a comment and add yourself to the cc list so that your requirements
will be taken into consideration.

Cheers,

Christian

Hallvard Tr�teberg wrote:

> I'm working on an editor and execution environment, and now I'm
> struggling with constraint validation. I've several static
> constraints, that check model properties that always should hold, and
> these work well. However, some constraints depend on the execution
> environment that is currently linked to the editor, so for this
> purpose the static constraints cannot be used.
>
> The documentation describes how you can declare "dynamic" constraint
> provides, i.e. constraint providers that generate the constraints
> dynamically. However, in my case I cannot use XML, since my dynamic
> constraint provider must be created in the context of my execution
> environment (and not just from a class name in the XML). There does
> not seem to be a way to register a constraint provider instance to the
> ModelValidationService, i.e. to add a constraint provider that is
> created without the use of XML.
>
> Am I wright, and if yes, isn't this a design flaw?
>
> Hallvard
Previous Topic:Teneo: problems with HibernatePersistableEList.equal(Object)
Next Topic:extending EvaluationVisitorImpl
Goto Forum:
  


Current Time: Sat Apr 27 05:09:23 GMT 2024

Powered by FUDForum. Page generated in 0.03153 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top