widget your object must follow the "Is A..." rule.
Il you extent a button with a new child class "MyButton" or
"MyToolbar" you inherit all present and future methods, your object
can be cast and used as a parent representative, it is also a Button
and a Widget as example. So may be "MyToolbar" is not a good idea here
because it is a button set and no a single button (The Rule "Is A
Button" is not respected). The composite is a good way to build a new
widget mays be with various smaller widgets and java code as glue
(another one is wrapping the JS component using native methods).
Inheritance has to keep the original widget idea with only
specialisation like button with image as a sort of button or
IntegerTextBox as a interger input dedicate TextBox. So if (and only
if) the "Is A" rule apply it seems better to inherit.
Hope it help a little bit. G. ;-)
On 24 avr, 01:10, Harald Schilly <harald.schi...@gmail.com> wrote:
> When you want to design your own widget that modifies some data, you can
> combine more than one widget in such a Composite, additionally implement for
> example a HasValueChangeHandlers<...> interface, and much more. That helps
> to isolate all this into one class and you can use this as a bigger block
> when designing the UI.
>
> H
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment