Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Can Validation handle inter-model constraints?
Can Validation handle inter-model constraints? [message #62586] Thu, 23 November 2006 14:27 Go to next message
Eclipse UserFriend
Originally posted by: rasmusmodsat.hotmail.com

Hi,

can the Validation framework handle constraints that span different EMF
models? So far, I've only seen examples of constraints on a single model.

My concrete problem is that I have two models a.ecore and b.ecore where the
following constraint should hold: forall instances of class A in a.ecore
there should be a corresponding instance of class B in b.ecore with the same
attribute values. The way I'm solving it at the moment is by writing some
custom java code.

I would prefer to write a constraint in an OCL-like manner. This seems to be
more concise and maintainable.

Idea: perhaps I could specify an extent which spanned two models in the
Query API's setExtentMap(..) method?

If anyone have ideas, references, links or anything else, I would be very
interested. Open source solutions, code snippets or even academic papers ;)

-- HW
Re: Can Validation handle inter-model constraints? [message #62843 is a reply to message #62586] Mon, 27 November 2006 15:26 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

EOL is an OCL-based language that enables simultaneous access to
multiple models. Eclipse-based tools and documentation for EOL are
available at http://www-users.cs.york.ac.uk/~dkolovos/epsilon/ . If you
face any problems with installing or using the tools please let me know.

Cheers,
Dimitrios

Hubertus Wilder wrote:
> Hi,
>
> can the Validation framework handle constraints that span different EMF
> models? So far, I've only seen examples of constraints on a single model.
>
> My concrete problem is that I have two models a.ecore and b.ecore where the
> following constraint should hold: forall instances of class A in a.ecore
> there should be a corresponding instance of class B in b.ecore with the same
> attribute values. The way I'm solving it at the moment is by writing some
> custom java code.
>
> I would prefer to write a constraint in an OCL-like manner. This seems to be
> more concise and maintainable.
>
> Idea: perhaps I could specify an extent which spanned two models in the
> Query API's setExtentMap(..) method?
>
> If anyone have ideas, references, links or anything else, I would be very
> interested. Open source solutions, code snippets or even academic papers ;)
>
> -- HW
>
>
>
Re: Can Validation handle inter-model constraints? [message #62878 is a reply to message #62586] Tue, 28 November 2006 15:06 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Hubertus,

Yes, validation can handle such cases. A constraint implemented in Java
(extending AbstractModelConstraint) can certainly do this, as it has access
to all models via the ResourceSet.

In the OCL case, you would have to define your own extent map, as you
suggested, that encompasses multiple resources (perhaps the entire
ResourceSet?). For this to work, however, you would need to define your
own 'constraint language' as indicated in the recent discussion in another
thread ("Custom EnvironmentFactory for OCL Constraints") in this newsgroup,
to plug in your extent map implementation.

Cheers,

Christian


Hubertus Wilder wrote:

> Hi,
>
> can the Validation framework handle constraints that span different EMF
> models? So far, I've only seen examples of constraints on a single model.
>
> My concrete problem is that I have two models a.ecore and b.ecore where
> the following constraint should hold: forall instances of class A in
> a.ecore there should be a corresponding instance of class B in b.ecore
> with the same attribute values. The way I'm solving it at the moment is by
> writing some custom java code.
>
> I would prefer to write a constraint in an OCL-like manner. This seems to
> be more concise and maintainable.
>
> Idea: perhaps I could specify an extent which spanned two models in the
> Query API's setExtentMap(..) method?
>
> If anyone have ideas, references, links or anything else, I would be very
> interested. Open source solutions, code snippets or even academic papers
> ;)
>
> -- HW
Re: Can Validation handle inter-model constraints? [message #596216 is a reply to message #62586] Mon, 27 November 2006 15:26 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

EOL is an OCL-based language that enables simultaneous access to
multiple models. Eclipse-based tools and documentation for EOL are
available at http://www-users.cs.york.ac.uk/~dkolovos/epsilon/ . If you
face any problems with installing or using the tools please let me know.

Cheers,
Dimitrios

Hubertus Wilder wrote:
> Hi,
>
> can the Validation framework handle constraints that span different EMF
> models? So far, I've only seen examples of constraints on a single model.
>
> My concrete problem is that I have two models a.ecore and b.ecore where the
> following constraint should hold: forall instances of class A in a.ecore
> there should be a corresponding instance of class B in b.ecore with the same
> attribute values. The way I'm solving it at the moment is by writing some
> custom java code.
>
> I would prefer to write a constraint in an OCL-like manner. This seems to be
> more concise and maintainable.
>
> Idea: perhaps I could specify an extent which spanned two models in the
> Query API's setExtentMap(..) method?
>
> If anyone have ideas, references, links or anything else, I would be very
> interested. Open source solutions, code snippets or even academic papers ;)
>
> -- HW
>
>
>
Re: Can Validation handle inter-model constraints? [message #596261 is a reply to message #62586] Tue, 28 November 2006 15:06 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Hubertus,

Yes, validation can handle such cases. A constraint implemented in Java
(extending AbstractModelConstraint) can certainly do this, as it has access
to all models via the ResourceSet.

In the OCL case, you would have to define your own extent map, as you
suggested, that encompasses multiple resources (perhaps the entire
ResourceSet?). For this to work, however, you would need to define your
own 'constraint language' as indicated in the recent discussion in another
thread ("Custom EnvironmentFactory for OCL Constraints") in this newsgroup,
to plug in your extent map implementation.

Cheers,

Christian


Hubertus Wilder wrote:

> Hi,
>
> can the Validation framework handle constraints that span different EMF
> models? So far, I've only seen examples of constraints on a single model.
>
> My concrete problem is that I have two models a.ecore and b.ecore where
> the following constraint should hold: forall instances of class A in
> a.ecore there should be a corresponding instance of class B in b.ecore
> with the same attribute values. The way I'm solving it at the moment is by
> writing some custom java code.
>
> I would prefer to write a constraint in an OCL-like manner. This seems to
> be more concise and maintainable.
>
> Idea: perhaps I could specify an extent which spanned two models in the
> Query API's setExtentMap(..) method?
>
> If anyone have ideas, references, links or anything else, I would be very
> interested. Open source solutions, code snippets or even academic papers
> ;)
>
> -- HW
Previous Topic:[Transaction] Command is not executed
Next Topic:teneo - two different hibernate databases in one ResourceSet
Goto Forum:
  


Current Time: Sat Nov 09 05:03:07 GMT 2024

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

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

Back to the top