Model instance constraints/rules [message #417852] |
Thu, 27 March 2008 08:39 |
Eclipse User |
|
|
|
Originally posted by: nima.mazloumi.gmx.de
Hi,
is there a way to model constraints/rules for model instances?
Here is the scenario:
Class A has the attribute name (EString). At runtime there can be many A instances but only one with the attribute name "foo".
I could customize the generated code for that but I was wondering if there is some kind of constraint/rule language that could be used for this purpose.
Thanks,
Nima
|
|
|
|
Re: Model instance constraints/rules [message #417868 is a reply to message #417858] |
Thu, 27 March 2008 17:05 |
Eclipse User |
|
|
|
Originally posted by: nima.mazloumi.gmx.de
Thank you
Ed Merks schrieb:
> Nima,
>
> You could implement this as a named constraint on class A and write the
> logic for the constraint in Java in the generated validator class as
> described in
>
> http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.Validation.html
>
> I could imagine you might be able to describe the constraint using OCL.
> Christian has written some nice articles about how the generator
> templates could be specialized to generate OCL-based constraints.
>
>
> Nima Mazloumi wrote:
>> Hi,
>>
>> is there a way to model constraints/rules for model instances?
>>
>> Here is the scenario:
>>
>> Class A has the attribute name (EString). At runtime there can be many
>> A instances but only one with the attribute name "foo".
>> I could customize the generated code for that but I was wondering if
>> there is some kind of constraint/rule language that could be used for
>> this purpose.
>>
>> Thanks,
>> Nima
>
|
|
|
Powered by
FUDForum. Page generated in 1.01020 seconds