Skip to main content



      Home
Home » Modeling » EMF » recommendation on custom factory methods
recommendation on custom factory methods [message #415095] Thu, 29 November 2007 07:47 Go to next message
Eclipse UserFriend
Hi,
For my model, I have manually added a fair number of convenience factory
methods to generated the Factory interface/class.

In order to keep things organized, I recently extended the default
generated factory and placed my custom methods there. I mimic the
eINSTANCE field in the extended family, although currently the
Impl.init() returns a cached factory instance without interplay with
package. It works nicely, for the most part, because it is a drop-in
replacement for the standard factory and I can keep a clean separation
between the generated and manual code.

BUT - is this really the best way handle custom factory methods?

Any experiences out there?

Thanks, chris
Re: recommendation on custom factory methods [message #415096 is a reply to message #415095] Thu, 29 November 2007 08:10 Go to previous message
Eclipse UserFriend
Chris,

I think you should just mix in your code with the generated code. I see
no reason to keep it separate. JMerge won't be confused by this. The
one factory should be one-stop shopping...


Chris Giblin wrote:
> Hi,
> For my model, I have manually added a fair number of convenience
> factory methods to generated the Factory interface/class.
>
> In order to keep things organized, I recently extended the default
> generated factory and placed my custom methods there. I mimic the
> eINSTANCE field in the extended family, although currently the
> Impl.init() returns a cached factory instance without interplay with
> package. It works nicely, for the most part, because it is a drop-in
> replacement for the standard factory and I can keep a clean separation
> between the generated and manual code.
>
> BUT - is this really the best way handle custom factory methods?
>
> Any experiences out there?
>
> Thanks, chris
Previous Topic:Change of Focus when element is deleted from EMF editor
Next Topic:OCL query with EDate
Goto Forum:
  


Current Time: Sun Jul 06 14:44:41 EDT 2025

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

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

Back to the top