recommendation on custom factory methods [message #415095] |
Thu, 29 November 2007 07:47  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03790 seconds