Home » Modeling » OCL » UML and generate code
UML and generate code [message #59048] |
Fri, 04 July 2008 06:49 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: pieter.martin.gmail.com
Hi,
I am currently generating code from UML diagrams by importing the model
into the UML2 api and then using Jet templates.
I am not using emf generation.
I would like to generate OCL constaints and queries.
I have read the article Implementing Model Integrity in EMF with OCL and
it is exactly what I would like to do only using the UML2 api and not
with EMF.
Does OCL need the objects to be EObject(s) with all the associated
resources and registries?
The objects I generate are in general persisted with hibernate.
Can someone please provide me with some pointers.
Thanks
Pieter
|
|
| |
Re: UML and generate code [message #59097 is a reply to message #59072] |
Fri, 04 July 2008 13:29 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: pieter.martin.gmail.com
Ed Merks wrote:
> Pieter,
>
> Comments below.
>
> pieter martin wrote:
>> Hi,
>>
>>
>> I am currently generating code from UML diagrams by importing the
>> model into the UML2 api and then using Jet templates.
>>
>>
>> I am not using emf generation.
> I wonder why not?
>>
>>
>> I would like to generate OCL constaints and queries.
>>
>>
>> I have read the article Implementing Model Integrity in EMF with OCL
>> and it is exactly what I would like to do only using the UML2 api and
>> not with EMF.
>>
>> Does OCL need the objects to be EObject(s) with all the associated
>> resources and registries?
>>
>>
>>
>> The objects I generate are in general persisted with hibernate.
> You could use Teneo to do that with EMF-generated code.
>>
>>
>> Can someone please provide me with some pointers.
>>
>>
>> Thanks
>> Pieter
Hi,
Thanks for the Teneo advise, I'll have a look at theie approach to
customizing emf code generation.
I am not using emf because I do not need to have such complicated
objects and admittedly a lot of it I do not understand (yet). That also
means that it is not really applicable to our domain.
We make heavy use of profiles and find it very easy to generate domain
specif stuff, custom annotations mostly, from the profile information.
I do think it is more natural to generate directly from the UML model as
that is the language that we model and think in.
I also imagine that when we get more sophisticated in generation that it
will be possible to generate code from State and Activity Diagrams. Not
sure if emf generation will still be an option then.
My main concern though is OCL constraints and queries.
Does OCL need the objects to be EObject(s) with all the associated
resources and registries?
Cheers
Pieter
|
|
|
Re: UML and generate code [message #59121 is a reply to message #59097] |
Fri, 04 July 2008 13:45 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: cdamus.zeligsoft.com
--=-c7sEf0FBKEIX1PTf2K1s
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi, Pieter,
Yes, the MDT OCL implementation requires model elements and run-time
elements, alike, to be EObjects. The meta-meta-model of this OCL
implementation is Ecore.
Cheers,
Christian
On Fri, 2008-07-04 at 15:29 +0200, pieter martin wrote:
> Ed Merks wrote:
> > Pieter,
> >
> > Comments below.
> >
> > pieter martin wrote:
> >> Hi,
> >>
> >>
> >> I am currently generating code from UML diagrams by importing the
> >> model into the UML2 api and then using Jet templates.
> >>
> >>
> >> I am not using emf generation.
> > I wonder why not?
> >>
> >>
> >> I would like to generate OCL constaints and queries.
> >>
> >>
> >> I have read the article Implementing Model Integrity in EMF with OCL
> >> and it is exactly what I would like to do only using the UML2 api and
> >> not with EMF.
> >>
> >> Does OCL need the objects to be EObject(s) with all the associated
> >> resources and registries?
> >>
> >>
> >>
> >> The objects I generate are in general persisted with hibernate.
> > You could use Teneo to do that with EMF-generated code.
> >>
> >>
> >> Can someone please provide me with some pointers.
> >>
> >>
> >> Thanks
> >> Pieter
> Hi,
>
> Thanks for the Teneo advise, I'll have a look at theie approach to
> customizing emf code generation.
>
> I am not using emf because I do not need to have such complicated
> objects and admittedly a lot of it I do not understand (yet). That also
> means that it is not really applicable to our domain.
>
> We make heavy use of profiles and find it very easy to generate domain
> specif stuff, custom annotations mostly, from the profile information.
>
> I do think it is more natural to generate directly from the UML model as
> that is the language that we model and think in.
>
> I also imagine that when we get more sophisticated in generation that it
> will be possible to generate code from State and Activity Diagrams. Not
> sure if emf generation will still be an option then.
>
> My main concern though is OCL constraints and queries.
>
> Does OCL need the objects to be EObject(s) with all the associated
> resources and registries?
>
> Cheers
> Pieter
--=-c7sEf0FBKEIX1PTf2K1s
Content-Type: text/html; charset=utf-8
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Pieter,<BR>
<BR>
Yes, the MDT OCL implementation requires model elements and run-time elements, alike, to be EObjects. The meta-meta-model of this OCL implementation is Ecore.<BR>
<BR>
Cheers,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Fri, 2008-07-04 at 15:29 +0200, pieter martin wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Ed Merks wrote:</FONT>
<FONT COLOR="#000000">> Pieter,</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Comments below.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> pieter martin wrote:</FONT>
<FONT COLOR="#000000">>> Hi,</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> I am currently generating code from UML diagrams by importing the </FONT>
<FONT COLOR="#000000">>> model into the UML2 api and then using Jet templates.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> I am not using emf generation.</FONT>
<FONT COLOR="#000000">> I wonder why not?</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> I would like to generate OCL constaints and queries.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> I have read the article Implementing Model Integrity in EMF with OCL </FONT>
<FONT COLOR="#000000">>> and it is exactly what I would like to do only using the UML2 api and </FONT>
<FONT COLOR="#000000">>> not with EMF.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Does OCL need the objects to be EObject(s) with all the associated </FONT>
<FONT COLOR="#000000">>> resources and registries?</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> The objects I generate are in general persisted with hibernate.</FONT>
<FONT COLOR="#000000">> You could use Teneo to do that with EMF-generated code.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Can someone please provide me with some pointers.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Thanks</FONT>
<FONT COLOR="#000000">>> Pieter</FONT>
<FONT COLOR="#000000">Hi,</FONT>
<FONT COLOR="#000000">Thanks for the Teneo advise, I'll have a look at theie approach to </FONT>
<FONT COLOR="#000000">customizing emf code generation.</FONT>
<FONT COLOR="#000000">I am not using emf because I do not need to have such complicated </FONT>
<FONT COLOR="#000000">objects and admittedly a lot of it I do not understand (yet). That also </FONT>
<FONT COLOR="#000000">means that it is not really applicable to our domain.</FONT>
<FONT COLOR="#000000">We make heavy use of profiles and find it very easy to generate domain </FONT>
<FONT COLOR="#000000">specif stuff, custom annotations mostly, from the profile information.</FONT>
<FONT COLOR="#000000">I do think it is more natural to generate directly from the UML model as </FONT>
<FONT COLOR="#000000">that is the language that we model and think in.</FONT>
<FONT COLOR="#000000">I also imagine that when we get more sophisticated in generation that it </FONT>
<FONT COLOR="#000000">will be possible to generate code from State and Activity Diagrams. Not </FONT>
<FONT COLOR="#000000">sure if emf generation will still be an option then.</FONT>
<FONT COLOR="#000000">My main concern though is OCL constraints and queries.</FONT>
<FONT COLOR="#000000">Does OCL need the objects to be EObject(s) with all the associated </FONT>
<FONT COLOR="#000000">resources and registries?</FONT>
<FONT COLOR="#000000">Cheers</FONT>
<FONT COLOR="#000000">Pieter</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-c7sEf0FBKEIX1PTf2K1s--
|
|
|
Re: UML and generate code [message #59147 is a reply to message #59097] |
Fri, 04 July 2008 15:50 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Ed Merks![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=ed.merks%40gmail.com) Messages: 33201 Registered: July 2009 |
Senior Member |
|
|
Pieter,
Comments below.
pieter martin wrote:
> Ed Merks wrote:
>> Pieter,
>>
>> Comments below.
>>
>> pieter martin wrote:
>>> Hi,
>>>
>>>
>>> I am currently generating code from UML diagrams by importing the
>>> model into the UML2 api and then using Jet templates.
>>>
>>>
>>> I am not using emf generation.
>> I wonder why not?
>>>
>>>
>>> I would like to generate OCL constaints and queries.
>>>
>>>
>>> I have read the article Implementing Model Integrity in EMF with OCL
>>> and it is exactly what I would like to do only using the UML2 api
>>> and not with EMF.
>>>
>>> Does OCL need the objects to be EObject(s) with all the associated
>>> resources and registries?
>>>
>>>
>>>
>>> The objects I generate are in general persisted with hibernate.
>> You could use Teneo to do that with EMF-generated code.
>>>
>>>
>>> Can someone please provide me with some pointers.
>>>
>>>
>>> Thanks
>>> Pieter
> Hi,
>
> Thanks for the Teneo advise, I'll have a look at theie approach to
> customizing emf code generation.
Interestingly they really don't need to customize the code generation
since the mapping from the instances to the database can be specified
external to the generated code...
>
> I am not using emf because I do not need to have such complicated
> objects and admittedly a lot of it I do not understand (yet). That
> also means that it is not really applicable to our domain.
So many folks start out assuming they don't need all this stuff, but of
course over time, their applications become more sophisticated and they
end up needing it.
>
> We make heavy use of profiles and find it very easy to generate domain
> specif stuff, custom annotations mostly, from the profile information.
I see, that's a pretty good reason. I'm not sure how much of the
profile information ends up being mapped to Ecore annotations...
>
> I do think it is more natural to generate directly from the UML model
> as that is the language that we model and think in.
That's a reasonable argument as well. Though Ecore is like a subset of
UML, and a much simpler one at that....
>
> I also imagine that when we get more sophisticated in generation that
> it will be possible to generate code from State and Activity Diagrams.
> Not sure if emf generation will still be an option then.
No, Ecore only focuses on class structure, not all the other more
complex UML aspects.
>
> My main concern though is OCL constraints and queries.
>
> Does OCL need the objects to be EObject(s) with all the associated
> resources and registries?
As Christian says, yes, OCL relies heavily on the metadata that EMF
provides.
>
> Cheers
> Pieter
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: UML and generate code [message #59171 is a reply to message #59147] |
Fri, 04 July 2008 16:29 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: pieter.martin.gmail.com
Thanks for the responses et al!
Cheers
Pieter
Ed Merks wrote:
> Pieter,
>
> Comments below.
>
> pieter martin wrote:
>> Ed Merks wrote:
>>> Pieter,
>>>
>>> Comments below.
>>>
>>> pieter martin wrote:
>>>> Hi,
>>>>
>>>>
>>>> I am currently generating code from UML diagrams by importing the
>>>> model into the UML2 api and then using Jet templates.
>>>>
>>>>
>>>> I am not using emf generation.
>>> I wonder why not?
>>>>
>>>>
>>>> I would like to generate OCL constaints and queries.
>>>>
>>>>
>>>> I have read the article Implementing Model Integrity in EMF with OCL
>>>> and it is exactly what I would like to do only using the UML2 api
>>>> and not with EMF.
>>>>
>>>> Does OCL need the objects to be EObject(s) with all the associated
>>>> resources and registries?
>>>>
>>>>
>>>>
>>>> The objects I generate are in general persisted with hibernate.
>>> You could use Teneo to do that with EMF-generated code.
>>>>
>>>>
>>>> Can someone please provide me with some pointers.
>>>>
>>>>
>>>> Thanks
>>>> Pieter
>> Hi,
>>
>> Thanks for the Teneo advise, I'll have a look at theie approach to
>> customizing emf code generation.
> Interestingly they really don't need to customize the code generation
> since the mapping from the instances to the database can be specified
> external to the generated code...
>>
>> I am not using emf because I do not need to have such complicated
>> objects and admittedly a lot of it I do not understand (yet). That
>> also means that it is not really applicable to our domain.
> So many folks start out assuming they don't need all this stuff, but of
> course over time, their applications become more sophisticated and they
> end up needing it.
>>
>> We make heavy use of profiles and find it very easy to generate domain
>> specif stuff, custom annotations mostly, from the profile information.
> I see, that's a pretty good reason. I'm not sure how much of the
> profile information ends up being mapped to Ecore annotations...
>>
>> I do think it is more natural to generate directly from the UML model
>> as that is the language that we model and think in.
> That's a reasonable argument as well. Though Ecore is like a subset of
> UML, and a much simpler one at that....
>>
>> I also imagine that when we get more sophisticated in generation that
>> it will be possible to generate code from State and Activity Diagrams.
>> Not sure if emf generation will still be an option then.
> No, Ecore only focuses on class structure, not all the other more
> complex UML aspects.
>>
>> My main concern though is OCL constraints and queries.
>>
>> Does OCL need the objects to be EObject(s) with all the associated
>> resources and registries?
> As Christian says, yes, OCL relies heavily on the metadata that EMF
> provides.
>>
>> Cheers
>> Pieter
|
|
|
Goto Forum:
Current Time: Wed Aug 28 02:20:05 GMT 2024
Powered by FUDForum. Page generated in 0.04385 seconds
|