Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Custom Create Methods
Custom Create Methods [message #482464] Wed, 26 August 2009 16:17 Go to next message
Paul Glezen is currently offline Paul GlezenFriend
Messages: 60
Registered: July 2009
Member
Some of the classes I have modeled with EMF had previously used
non-default constructors that did much of the initialization work.
After converting to EMF, I now perform this initialization outside the
constructor through several set methods everywhere I create a new
instance. It's doable, but cumbersome.

Is there a way to specify a custom factory method in the genmodel that
would allow input parameters to the factory create methods? My source
of info is Section 10.8 of the EMF Bible, 2nd Ed. But I don't see
anything about customized creates.
Re: Custom Create Methods [message #482529 is a reply to message #482464] Wed, 26 August 2009 22:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Paul,

No, you'd have to provide custom create methods in the factory by hand.


Paul Glezen wrote:
> Some of the classes I have modeled with EMF had previously used
> non-default constructors that did much of the initialization work.
> After converting to EMF, I now perform this initialization outside the
> constructor through several set methods everywhere I create a new
> instance. It's doable, but cumbersome.
>
> Is there a way to specify a custom factory method in the genmodel that
> would allow input parameters to the factory create methods? My source
> of info is Section 10.8 of the EMF Bible, 2nd Ed. But I don't see
> anything about customized creates.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Custom Create Methods [message #482556 is a reply to message #482529] Thu, 27 August 2009 03:31 Go to previous messageGo to next message
Paul Glezen is currently offline Paul GlezenFriend
Messages: 60
Registered: July 2009
Member
I'm cool with that. I just didn't want to violate any part of the
framework by doing so.

Ed Merks wrote:
> Paul,
>
> No, you'd have to provide custom create methods in the factory by hand.
>
Re: Custom Create Methods [message #482559 is a reply to message #482556] Thu, 27 August 2009 04:47 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Paul,

As long as the regular create methods still create uninitialized
objects, all will be good.


Paul Glezen wrote:
> I'm cool with that. I just didn't want to violate any part of the
> framework by doing so.
>
> Ed Merks wrote:
>> Paul,
>>
>> No, you'd have to provide custom create methods in the factory by hand.
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] CDOID vs. EMF ID attribute
Next Topic:Strange Update behavior
Goto Forum:
  


Current Time: Fri Apr 26 00:42:50 GMT 2024

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

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

Back to the top