As with all thi gs computer related each action has some kind of  
reaction of cost. Sometimes this cost is visible other times it's not  
as noticable.

By introducing an Insertxxx interface and having all the right Panels  
implement it you are making your compiled JavaScript that much bigger.  
Whenever your code uses the new interface the compiler must also keep  
the code for the implementors. Other problem I believe I have seen  
mentioned is that it's not desirable to have  interfaces for every  
common action.

Another problem is that runtime casting  is costly in terms of CPU  
cycles. In the past each type at runtiMe had an array of implementing  
interfaces and a pointer to it's super. When doing a cast or similar  
op the runtime had to walk these structures to get the answer before  
continuing.

On 08/08/2009, at 7:04 PM, Ed <[email protected]> wrote:

>
> Why is issue 1112 not planned for GWT 2.0??
> http://code.google.com/p/google-web-toolkit/issues/detail?id=1112
>
> This suprises me a lot.
> Now I need to have 3 methods to deal with the insert method from
> FlowPanel/HorizontalPanel/VerticalPanel... This is very poor OO
> programing :(...
>
> Example (just one of them):
> Like explained in issue 3867 (http://code.google.com/p/google-web-
> toolkit/issues/detail?id=3867) I use a InsertPanelWrapper interface to
> wrap the above panels that have CRUD panel actions. I use the wrapper
> to add functionality like animations and listener stuff if needed and
> to have a clear api to the outside world (developer). The base
> abstract class that implements this interface contains another
> interface that is called ModifyPanelWrapper that is used to perform
> the actual CRUD actions (his implementation contains the actual
> animations). His interface is:
> ----
> void add(HasWidgets panel, Widget widget);
> void insert(HorizontalPanel panel, Widget widget, int beforeIndex);
> void insert(VerticalPanel panel, Widget widget, int beforeIndex);
> void insert(FlowPanel panel, Widget widget, int beforeIndex);
> <IPan extends IndexedPanel & HasWidgets> boolean remove(final IPan
> panel, int index);
> boolean remove(HasWidgets panel, Widget widget);
> ----
>
> The interface is very ugly and poor like I am programming in the
> stoneage...
> Why? I need 3 insert methods for every GWT panel supporting this as
> GWT doesn't use a single interface for this kind of action.
>
> Please let me understand why this isn't planned for gwt 2.0 ?  As I
> think if you call yourself 2.0, things like these must be present (And
> I don't even talk about primitive Widget interfaces) !
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to