Re: Interface vs implementation

75 views
Skip to first unread message

Gal Dolber

unread,
Nov 25, 2012, 7:12:01 AM11/25/12
to google-we...@googlegroups.com
As I understand that only applies to gwt-rpc

On Saturday, November 24, 2012, shippi wrote:
Hi!

I am aware of the fact that the GWT best practices are slightly different from the regular java recommendations. There is one question i would like to clarify. I am 
 
aware of the fact that when writing RPCs than the best practice is to use implementations as a return value f.e. ArrayList instead of List, because using less-specific classes forces the GWT compiler to generate serialization code for every serializable subclass of List. This make sense! My question is regarding the regular Widgets or (Presenter+View), is this still true in case of the ui code? To have

private ArrayList<String> myList = new ArrayList<String>();

is more effective than,

private List<String> myList = new ArrayList<String>();

Does the GWT compiler generate the JavaScript for each subclass of the List?

Thank you very much!!!



--
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/-/e2vgRK9n3UwJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


--
A world citizen



Dennis Haupt

unread,
Nov 25, 2012, 7:18:06 AM11/25/12
to google-we...@googlegroups.com
1. this only applies to gwt-rpc. for pure client code, everything is completely known at compile time, so the compiler knows which implementation is possibly going to be used.
2. you can use gwt's configurable blacklist/whitelist to prevent it from making every possible subclass serializable and still use interfaces. i do it that way.


2012/11/25 Gal Dolber <gal.d...@gmail.com>

shippi

unread,
Nov 25, 2012, 2:05:26 PM11/25/12
to google-we...@googlegroups.com
Thanks for your quick answers!
Reply all
Reply to author
Forward
0 new messages