Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » (OCL)Validation
(OCL)Validation [message #414846] Mon, 26 November 2007 09:53 Go to next message
LEE is currently offline LEEFriend
Messages: 1
Registered: July 2009
Junior Member
Hi all,

i have seen a lot of Validation and Query- Frameworks within EMF-Projekt
but i am not really sure which of them is the best for my intention.


I have the following situation:

I have developed a modell and the Editor Plug-In which based on. In my
Modell u have a class which has an attribute called "constraint". (EString)

This field contains allways a OCL-Constraint which relate to the modelled
instance in the Editor. Let me bring an example:

Two classes: Book and Page. Book is a container.

each page has a "constraint"-attribute. this constraint relate allways to
other pages. Now i want to enable the user to formulate his own
ocl-Contsraint and make a validation ( So lets be an invariant). So i must
have a framework which allows me to Query my Instances.

Example:

MYBOOK
Page ID="1" Author="I"

page ID="2" Author="You" contrsinat="context MYBOOK inv: page.ID=1
->page.Author=She"

page ID="3" Author="HE" contrsinat="context MYBOOK inv: page.ID=1
->page.Author=I"

or something like that. The user formulate these invariants and make a
validation. The result will be for page 2-contraint false an for page
3-constraint true.

Is such an intention possible at all?
i am a little bit confused:-)


best wishes,
lee
Re: (OCL)Validation [message #414856 is a reply to message #414846] Mon, 26 November 2007 14:59 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Lee,

If I understand correctly, you want users of your editor to be able to embed
OCL constraints in instances of your model. You can do this using both the
generator validator framework in core EMF and the extensible validation
framework component.

In the former case, I can imagine that you would generate a validation
method in the book class that is implemented (by hand) to parse (and
probably cache) the OCL constraints in each page, and to evaluate them on
the book instance.

In the latter case, I can imagine that you would define an implementation of
the IConstraintProvider interface on the
org.eclipse.emf.validation.constraintProviders extension point, which looks
for OCL constraints in the pages and does basically the same thing.

I guess choosing between these is a matter of choice. The EMF Core SDK and
EMF Validation Framework SDK both include tutorials to help you get started
with their respective validation frameworks, to get you better informed
about your decision.

HTH,

Christian


LEE wrote:

> Hi all,
>
> i have seen a lot of Validation and Query- Frameworks within EMF-Projekt
> but i am not really sure which of them is the best for my intention.
>
>
> I have the following situation:
>
> I have developed a modell and the Editor Plug-In which based on. In my
> Modell u have a class which has an attribute called "constraint".
> (EString)
>
> This field contains allways a OCL-Constraint which relate to the modelled
> instance in the Editor. Let me bring an example:
>
> Two classes: Book and Page. Book is a container.
>
> each page has a "constraint"-attribute. this constraint relate allways to
> other pages. Now i want to enable the user to formulate his own
> ocl-Contsraint and make a validation ( So lets be an invariant). So i must
> have a framework which allows me to Query my Instances.
>
> Example:
>
> MYBOOK
> Page ID="1" Author="I"
>
> page ID="2" Author="You" contrsinat="context MYBOOK inv: page.ID=1
> ->page.Author=She"
>
> page ID="3" Author="HE" contrsinat="context MYBOOK inv: page.ID=1
> ->page.Author=I"
>
> or something like that. The user formulate these invariants and make a
> validation. The result will be for page 2-contraint false an for page
> 3-constraint true.
>
> Is such an intention possible at all?
> i am a little bit confused:-)
>
>
> best wishes,
> lee
Previous Topic:Ecore mapping of xsd:restriction
Next Topic:[editor] Tree with Columns
Goto Forum:
  


Current Time: Fri Apr 26 07:33:08 GMT 2024

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

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

Back to the top