Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » UML and generate code
UML and generate code [message #59048] Fri, 04 July 2008 06:49 Go to next message
Eclipse User
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 #59072 is a reply to message #59048] Fri, 04 July 2008 12:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26152
Registered: July 2009
Senior Member
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
Re: UML and generate code [message #59097 is a reply to message #59072] Fri, 04 July 2008 13:29 Go to previous messageGo to next message
Eclipse User
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 messageGo to next message
Eclipse User
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.&nbsp; 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">&gt; Pieter,</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Comments below.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; pieter martin wrote:</FONT>
<FONT COLOR="#000000">&gt;&gt; Hi,</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; I am currently generating code from UML diagrams by importing the </FONT>
<FONT COLOR="#000000">&gt;&gt; model into the UML2 api and then using Jet templates.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; I am not using emf generation.</FONT>
<FONT COLOR="#000000">&gt; I wonder why not?</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; I would like to generate OCL constaints and queries.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; I have read the article Implementing Model Integrity in EMF with OCL </FONT>
<FONT COLOR="#000000">&gt;&gt; and it is exactly what I would like to do only using the UML2 api and </FONT>
<FONT COLOR="#000000">&gt;&gt; not with EMF.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Does OCL need the objects to be EObject(s) with all the associated </FONT>
<FONT COLOR="#000000">&gt;&gt; resources and registries?</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; The objects I generate are in general persisted with hibernate.</FONT>
<FONT COLOR="#000000">&gt; You could use Teneo to do that with EMF-generated code.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Can someone please provide me with some pointers.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Thanks</FONT>
<FONT COLOR="#000000">&gt;&gt; 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 messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26152
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
Re: UML and generate code [message #59171 is a reply to message #59147] Fri, 04 July 2008 16:29 Go to previous message
Eclipse User
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
Previous Topic:QVT in OCL implementation
Next Topic:OCL closures implementation
Goto Forum:
  


Current Time: Thu Oct 30 18:18:07 GMT 2014

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

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