Realize that you are making yourself lazy at the cost of not-lazy code.
That is: all will be constructed in the constructor.

Try to make a difference between screen and not-screen components/classes. 
Screen components contain the GWT stuff containing the heavy stuff and 
should be created as late as possible, that is: only when they appear on 
the screen.

For one component the above will be ok, but it's hard to tell how you will 
use it in the near future.

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).

- Ed

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/Tv8S2xsruZYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to