Service return type best paratice

24 views
Skip to first unread message

Filippo De Luca

unread,
Dec 8, 2011, 7:50:18 AM12/8/11
to google-we...@googlegroups.com
Hi to all,
I have a doubt about the best return type of a RPC service: shortly is better to return an interface or the implementation object? (Set or HashSet?)

I think is better use the implementing class due to the fast serialization or permutation, am I wrong?

Paul Robinson

unread,
Dec 8, 2011, 10:04:23 AM12/8/11
to google-we...@googlegroups.com
You're correct. Best practice for choice of return type in an RPC interface is the exact opposite from what you would normally use in Java. That is, you should be as specific as possible to avoid forcing GWT having to generate serialization code for every implementation of Set or List etc.

Paul

> --
> 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/-/SbFWi-Eelc8J.
> 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.

Filippo De Luca

unread,
Dec 9, 2011, 4:02:41 AM12/9/11
to google-we...@googlegroups.com
Thank you very much Paul for the explanation.
Reply all
Reply to author
Forward
0 new messages