I agree, but there are not much places where this becomes a real overhead, especially not if one avoid a spaghetticode.
for instance, I have to customize the LocalizableGenerator, here an excerpt String generatedClass = AbstractLocalizableImplCreator.generateConstantOrMessageClass( logger, context, locale, targetClass); if (generatedClass != null) { return generatedClass; } here it would make life easier to obtain a creator from a method, otherwise I have to copypaste the whole generate() method, this also applies to static methods :( On 13 Okt., 16:51, Joel Webber <j...@google.com> wrote: > Specific examples might be helpful here. I can see how this might be useful > in some specific cases, but wrapping every new in a template method sounds > like a horribly contorting way to have to write all one's code. > > Le 13 octobre 2010 05:19, cokol <eplisc...@googlemail.com> a écrit : > > > many other developers, including me, would appreciate if you'd use > > protected factory methods in non-final classes (even if the class is > > not abstract), like: > > > a no-go: > > ------------ > > void func() { > > A = new A(); > > A.doSomething(); > > } > > > instead, a better pattern: > > ----------- > > protected A createA() { > > return new A(); > > } > > > void func() { > > A = createA(); > > A.doSomething(); > > } > > --------- > > > because in some situations the integration of GWT into existing > > environment becomes a little nightmare, and it would be great pay more > > attention to DI > > > thank you!! > > > -- > >http://groups.google.com/group/Google-Web-Toolkit-Contributors -- http://groups.google.com/group/Google-Web-Toolkit-Contributors