[gwt-contrib] Re: Allow RPC for unmodificable collections (issue620805)

2010-07-09 Thread rice

http://gwt-code-reviews.appspot.com/620805/show

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


[gwt-contrib] Re: Allow RPC for unmodificable collections (issue620805)

2010-07-09 Thread jat

LGTM


http://gwt-code-reviews.appspot.com/620805/diff/9001/10003
File user/super/com/google/gwt/emul/java/util/Collections.java (right):

http://gwt-code-reviews.appspot.com/620805/diff/9001/10003#newcode148
user/super/com/google/gwt/emul/java/util/Collections.java:148: */
So why was this comment removed?  It seems useful.

http://gwt-code-reviews.appspot.com/620805/show

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


[gwt-contrib] Re: Allow RPC for unmodificable collections (issue620805)

2010-07-08 Thread rice


http://gwt-code-reviews.appspot.com/620805/diff/1/2
File
user/src/com/google/gwt/user/client/rpc/core/java/util/Collections.java
(right):

http://gwt-code-reviews.appspot.com/620805/diff/1/2#newcode135
user/src/com/google/gwt/user/client/rpc/core/java/util/Collections.java:135:
/**
In practice it works fine with Sun's JDK and I expect it would work with
a Harmony-based classlib as well -- they and GWT are all using
compatible type definitions for singleton and unmodifiable collections.

I would be somewhat surprised if GWT RPC actually worked with a truly
exotic JDK that was neither Sun nor Apache based -- and I don't think
we should avoid implementing a useful feature just because it might
break on some future JDK.  Right now users can't RPC these types of
collections at all, so if they have to use an incompatible JDK the worst
case is that they will try to use this feature, fail, file a bug, and we
will add a case to support them in the server-side code.

This feature by itself isn't worth a major revamping of RPC semantics
IMHO.

On 2010/07/07 20:37:27, jat wrote:

So how does this work with server-side implementation classes?  Aren't

they

going to need custom serializers for whatever internal classes the

particular

JVM uses?



Previously we said the solution was RPC-by-interface, which would

allow you to

say that the default implementation for any unknown List subtype is

ArrayList,

for example, though obviously that breaks a List view onto some larger

data

structure.



http://gwt-code-reviews.appspot.com/620805/diff/1/4
File user/super/com/google/gwt/emul/java/util/Collections.java (right):

http://gwt-code-reviews.appspot.com/620805/diff/1/4#newcode141
user/super/com/google/gwt/emul/java/util/Collections.java:141: private
static final class SingletonMapK, V extends AbstractMapK, V
implements Serializable {
O.K.

On 2010/07/07 20:37:27, jat wrote:

Javadoc explaining when this is used.


http://gwt-code-reviews.appspot.com/620805/diff/1/6
File user/test/com/google/gwt/user/client/rpc/CollectionsTest.java
(right):

http://gwt-code-reviews.appspot.com/620805/diff/1/6#newcode590
user/test/com/google/gwt/user/client/rpc/CollectionsTest.java:590:
service.echoSingletonMap(TestSetFactory.createSingletonMap(),
I'll add createXXX methods to the test service.

On 2010/07/07 20:37:27, jat wrote:

Shouldn't these have a method where the various internal collection

types are

created on the server?


http://gwt-code-reviews.appspot.com/620805/diff/1/11
File
user/test/com/google/gwt/user/server/rpc/CollectionsTestServiceImpl.java
(right):

http://gwt-code-reviews.appspot.com/620805/diff/1/11#newcode450
user/test/com/google/gwt/user/server/rpc/CollectionsTestServiceImpl.java:450:
return value;
O.K.

On 2010/07/07 20:37:27, jat wrote:

Instead of returning the same value, what about creating a new one on

the server

from the one supplied, so we can test freshly-created instances?


http://gwt-code-reviews.appspot.com/620805/show

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


[gwt-contrib] Re: Allow RPC for unmodificable collections (issue620805)

2010-07-07 Thread jat


http://gwt-code-reviews.appspot.com/620805/diff/1/2
File
user/src/com/google/gwt/user/client/rpc/core/java/util/Collections.java
(right):

http://gwt-code-reviews.appspot.com/620805/diff/1/2#newcode135
user/src/com/google/gwt/user/client/rpc/core/java/util/Collections.java:135:
/**
So how does this work with server-side implementation classes?  Aren't
they going to need custom serializers for whatever internal classes the
particular JVM uses?

Previously we said the solution was RPC-by-interface, which would allow
you to say that the default implementation for any unknown List subtype
is ArrayList, for example, though obviously that breaks a List view onto
some larger data structure.

http://gwt-code-reviews.appspot.com/620805/diff/1/4
File user/super/com/google/gwt/emul/java/util/Collections.java (right):

http://gwt-code-reviews.appspot.com/620805/diff/1/4#newcode141
user/super/com/google/gwt/emul/java/util/Collections.java:141: private
static final class SingletonMapK, V extends AbstractMapK, V
implements Serializable {
Javadoc explaining when this is used.

http://gwt-code-reviews.appspot.com/620805/diff/1/6
File user/test/com/google/gwt/user/client/rpc/CollectionsTest.java
(right):

http://gwt-code-reviews.appspot.com/620805/diff/1/6#newcode590
user/test/com/google/gwt/user/client/rpc/CollectionsTest.java:590:
service.echoSingletonMap(TestSetFactory.createSingletonMap(),
Shouldn't these have a method where the various internal collection
types are created on the server?

http://gwt-code-reviews.appspot.com/620805/diff/1/11
File
user/test/com/google/gwt/user/server/rpc/CollectionsTestServiceImpl.java
(right):

http://gwt-code-reviews.appspot.com/620805/diff/1/11#newcode450
user/test/com/google/gwt/user/server/rpc/CollectionsTestServiceImpl.java:450:
return value;
Instead of returning the same value, what about creating a new one on
the server from the one supplied, so we can test freshly-created
instances?

http://gwt-code-reviews.appspot.com/620805/show

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