Is it safe to ignore a HandlerRegistration if I know I will never need
to use it? Lets say the lifecycle of a pair of objects is inherently
bound (a button that clears a field, for example). I will never need
to remove the button's click handler once it's added. Is it ok to
ignore the return value from addHandler? Will this cause memory leaks
or any other bad side effects? I guess since the HandlerManager within
the Widgets will go away along with them, probably not, right?

Second q: what's the best pattern for managing handler registrations?
It's a bit different now since the caller must handle the bookkeeping,
and so if I have a Widget with many others within it, and I register a
handler with all of them, somewhere I need to store a mapping of all
those Handler Registrations so they can be removed.

What do folks find the works best? HashMap<Widget,
HandlerRegistration> ? Are there any subleties I need to be aware of?
I'd like to get this right before I start building bad habits (and
writing code which needs to be refactored later).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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