Home » Modeling » OCL » OCL Constraints on ECore Model
|
Re: OCL Constraints on ECore Model [message #17380 is a reply to message #17340] |
Wed, 18 April 2007 15:23 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Ian,
No, EMF does not provide OCL support in the default templates. There is,
however, support planned for generating constraints (much as in [1]) from
UML models:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=105199
for those of us who do all of our modeling with UML, not Ecore :-)
EMF does support the embedding of Java code in annotations on constraint
EOperations (those having the (DiagnosticChain, EMap) signature); I'm not
sure of the details.
Cheers,
Christian
Ian Bull wrote:
> This may be just my lack of understanding, but can "simple" OCL
> constraints be specified as Annotations on Ecore Models. I have looked
> at [1] and there is lots of talk about templates, but it is possible to
> just add a constraint (as an EAnnotation) to that says "self.something >
> 0" for example, without worrying about templates (i.e. are there default
> templates for working with OCL)?
>
>
[1] http://www.eclipse.org/articles/article.php?file=Article-EMF -Codegen-with-OCL/index.html
>
> Cheers,
> ian
|
|
| | | |
Re: OCL Constraints on ECore Model [message #18713 is a reply to message #18641] |
Wed, 18 April 2007 19:34 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Antonio,
Yes, my update of that article (for OCL 1.1) fixes some problems with
inherited EOperations and EStructuralFeatures, as well as generally
producing cleaner code. This update has yet to be published, but is
available as an attachment on
https://bugs.eclipse.org/bugs/show_bug.cgi?id=143580
I think Ian was specifically looking for out-of-the-box OCL support, not
requiring custom templates.
Cheers,
Christian
Antonio Carrasco wrote:
> Ian,
>
> If I understand properly, you can add OCL constraints to an EMF model,
> following Christians example:
> http://www.eclipse.org/resources/resource.php?id=124
>
http://www.eclipse.org/articles/article.php?file=Article-EMF -Codegen-with-OCL/index.html
>
> There were a couple errors in the codegen of constraints in classes
> specializing other classes, but this may have been fixed already.
>
> Ill send you my template fixes to your personal address
> (not sure I can post a .zip here).
>
> Cheers!
> ACV
>
>
>
> "Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
> news:f05d5g$ier$1@build.eclipse.org...
>>
>> Hi, Ian,
>>
>> No, EMF does not provide OCL support in the default templates. There is,
>> however, support planned for generating constraints (much as in [1]) from
>> UML models:
>>
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=105199
>>
>> for those of us who do all of our modeling with UML, not Ecore :-)
>>
>> EMF does support the embedding of Java code in annotations on constraint
>> EOperations (those having the (DiagnosticChain, EMap) signature); I'm not
>> sure of the details.
>>
>> Cheers,
>>
>> Christian
>>
>>
>> Ian Bull wrote:
>>
>>> This may be just my lack of understanding, but can "simple" OCL
>>> constraints be specified as Annotations on Ecore Models. I have looked
>>> at [1] and there is lots of talk about templates, but it is possible to
>>> just add a constraint (as an EAnnotation) to that says "self.something >
>>> 0" for example, without worrying about templates (i.e. are there default
>>> templates for working with OCL)?
>>>
>>>
>>
[1] http://www.eclipse.org/articles/article.php?file=Article-EMF -Codegen-with-OCL/index.html
>>>
>>> Cheers,
>>> ian
>>
|
|
| |
Re: OCL Constraints on ECore Model [message #18872 is a reply to message #18803] |
Thu, 19 April 2007 13:14 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Antonio,
It's great to hear that you're having such success with those templates!
That's very encouraging. I'm keen to know what you think of the "new &
improved" version, if you want to try it out! I've learned a few things
about the EMF templates since the first edition ...
Thanks,
Christian
Antonio Carrasco wrote:
> Ok! being the key aspect I didnt the custom templates.
> IMO, given the minimal effort it takes to aply your article,
> and the outstanding results,
> I just use systematically your templates for EMF codegen,
> with a couple minimal additions and the inheritance fix.
>
> Thanks a lot,
> ACV
>
|
|
| |
Re: OCL Constraints on ECore Model [message #18914 is a reply to message #18894] |
Thu, 19 April 2007 14:32 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Antonio,
In case you thought I was referring to the UML2 codegen enhancement for OCL
support, I wasn't. I was just referring to an update of my article, still
dealing with EMF codegen for Ecore:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=143580
If and when you do get a chance to review it, I'd appreciate it if you could
comment on that bug to nudge Wayne to post the update to Eclipse Corner
:-)
Cheers,
Christian
Antonio Carrasco wrote:
> Encouraging! Thanks,
> but actually its is possible to do really interesting things with just EMF
> and your templates,
> such that Ive not been forced to jump into UML2 codegen - yet.
> Some of the ideas for uses of the expressions come from previous work at
> IBM (IAA, IBEE, IBL),
> and BOCA:
> http://www.omg.org/docs/ad/99-10-09.pdf
>
> Ill look at it, soon.
> Cheers,
> ACV
<snip>
|
|
|
Re: OCL Constraints on ECore Model [message #18936 is a reply to message #17340] |
Thu, 19 April 2007 15:09 |
Eclipse User |
|
|
|
Originally posted by: irbull.cs.uvic.ca
Thanks for the help Christian and Antonio!
I agree Antonio that using the custom templates was very minimal effort.
They work very well and I have a neat little customer management
system up and running (in an RCP app) without a single line of code!
(other than OCL). Very powerful!
Although I think the templates are generic enough that they could be
part of the OCL distribution. I understand that this is probably not
Christian's goal right now, but WOW, what a powerful technology.
Thanks again!
Ian
Ian Bull wrote:
> This may be just my lack of understanding, but can "simple" OCL
> constraints be specified as Annotations on Ecore Models. I have looked
> at [1] and there is lots of talk about templates, but it is possible to
> just add a constraint (as an EAnnotation) to that says "self.something >
> 0" for example, without worrying about templates (i.e. are there default
> templates for working with OCL)?
>
> [1] http://www.eclipse.org/articles/article.php?file=Article-EMF -Codegen-with-OCL/index.html
>
>
> Cheers,
> ian
|
|
|
Re: OCL Constraints on ECore Model [message #19046 is a reply to message #18914] |
Thu, 19 April 2007 20:38 |
Eclipse User |
|
|
|
Originally posted by: carrasco.ModelDrivenDevelopment.co.uk
Indeed!
ACV
"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:f07ugo$cr2$1@build.eclipse.org...
>
> Hi, Antonio,
>
> In case you thought I was referring to the UML2 codegen enhancement for
> OCL
> support, I wasn't. I was just referring to an update of my article, still
> dealing with EMF codegen for Ecore:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=143580
>
> If and when you do get a chance to review it, I'd appreciate it if you
> could
> comment on that bug to nudge Wayne to post the update to Eclipse Corner
> :-)
>
> Cheers,
>
> Christian
>
>
> Antonio Carrasco wrote:
>
>> Encouraging! Thanks,
>> but actually its is possible to do really interesting things with just
>> EMF
>> and your templates,
>> such that Ive not been forced to jump into UML2 codegen - yet.
>> Some of the ideas for uses of the expressions come from previous work at
>> IBM (IAA, IBEE, IBL),
>> and BOCA:
>> http://www.omg.org/docs/ad/99-10-09.pdf
>>
>> Ill look at it, soon.
>> Cheers,
>> ACV
>
> <snip>
|
|
|
Goto Forum:
Current Time: Thu Apr 25 20:23:04 GMT 2024
Powered by FUDForum. Page generated in 0.04264 seconds
|