On 8 December 2011 02:18, Ed <post2edb...@gmail.com> wrote: > Even do you you might create the above lazily and only when needed, I would > still never put an initWidget() method in my constructor: the constructor > should be light weight (general sun rule), and you make the code > unit-testable if you don't put this method in the constructor. > I use my own SimpleComposite base class that extends from Composite that > will automatically create the widget subclass when needed -> real lazy > loading (I think the SimpleComposite class appears in the issue tracker).
It would be great if I didn't have to put initWidget() in the constructor (so that, like you say, unit tests become much easier) but how would that work then? I suppose you have some sort of init() method? How does that get called then? Moreover, in Composite it says "All composites must call initWidget() in their constructors.". You have encountered no difficulties not having initWidget() in the constructor? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.