My favorites | Sign in
Google
                
New issue | Search
for
| Advanced search | Search tips
Issue 21: Lack of java.io.Serializable hurts interoperability
50 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  mmendez+personal@google.com
Closed:  May 2007
Type-Enhancement
Priority-High
Category-RPC
Milestone-1_4_RC


Sign in to add a comment
 
Reported by gwt.team.scottb, Sep 19, 2006
GWT Release: 1.1.10

Detailed description:
GWT doesn't include a class definition for java.io.Serializable.  This is
to avoid confusion with GWT's built-in serialization mechanisms.  However,
not having a definition causes compile errors when trying to use a single
set of classes that are both IsSerializable and Serializable.  Several
users have requested this.

Workaround if you have one:
Add an empty Serializable interface to gwt-user.jar as
com/google/gwt/emul/java/io/Serializable.java

Links to the relevant discussion group topics (optional):
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/8fe5d325263460e1
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/30b7a90432d0ced8

Comment 1 by gwt.team.scottb, Sep 19, 2006
(No comment was entered for this change.)
Labels: -Type-Defect Type-Enhancement
Comment 2 by gwt.team.bruce, Sep 25, 2006
(No comment was entered for this change.)
Owner: gwt.team.ecc
Labels: Milestone-1_2_RC
Comment 3 by gwt.team.ecc, Sep 26, 2006
(No comment was entered for this change.)
Owner: gwt.team.mmendez
Comment 4 by JMGuillemette, Sep 29, 2006
This is extremely important for being able to cleanly integrate gwt framework with
other frameworks like spring or hibernate
Comment 5 by gwt.team.bruce, Oct 26, 2006
We talked about this one a lot and (1) it definitely needs to be addressed and (2)
the exact solution is controversial enough that we shouldn't hold up 1.2 RC until we
figure out the right answer.

I'm taking off of 1.2 RC but I'm increasing the priority to "High".
Labels: -Priority-Medium -Milestone-1_2_RC Priority-High
Comment 6 by eclipseguru, Nov 04, 2006
Do you think it's possible to deprecate IsSerializable and use java.io.Serializable
instead?
Comment 7 by JMGuillemette, Nov 06, 2006
From a standards prospective that would make alot more sense.
Deprecate IsSerializable and implement Serializable.

Most people who are fighting for this are doing so cause of integration requirements.
I like to use hibernate for example. My POJO's out of the database are by nature
Serializable. I cant send them to the display layer however because of the
"serialiable" issue.. Instead i have to now translate them to antoher pojo that
doesnt implement serializable (but IsSerializable) to send it up...  since both
methods are empty implementations.. why not merge them together. 
Comment 8 by martin.c.webb, Nov 18, 2006
Out of the two possible options identified so far:

1. Add an empty Serializable interface to gwt-user.jar
2. Deprecate IsSerializable and use java.io.Serializable instead

I would strongly request option 2 - currently having to write wrappers around our
services to convert objects which will slow take up within our larger internal and
offshore developer community for the telco I work for.

We can't afford to pollute are service and domain tier DTOs with IsSerializable.  Any
work required to provide a wrapper is overhead in terms of development and test
effort.  We want to be in the situation that we mandate to our development community:
code to interfaces, and everything is implemented as POJO.  We then are in a position
where the POJO can be consumed in struts/tiles apps, converted to XML on the fly for
third party mashups, and consumed by GWT.

The later can't currently happen whilst we need to implement IsSerializable.
Comment 9 by sandymac, Nov 26, 2006
While we wait for GWT to include java.io.Serializable if you add GWTx to your project
you can use classes that implement java.io.Serializable in your client code. See:
http://code.google.com/p/gwtx/ for details.
Comment 10 by gass.bofh, Jan 05, 2007
+1
Comment 11 by gwt.team.bruce, Jan 22, 2007
(No comment was entered for this change.)
Labels: Category-RPC Milestone-Planned
Comment 12 by gwt.team.bruce, Feb 14, 2007
This is a major inconvenience for integration cases. We have essentially agreed that
we want to remove IsSerializable in a future release, very likely in the release
after 1.4. However, since we haven't finalized the semantics for that change (i.e. do
we honor Serializable? do we serialize anything at all?), we're not ready to actually
make Serializable mean anything. 

We should strongly consider at least including java.io.Serializable simply for the
sake of not preventing integration cases. IOW, resolving this issue is explicitly
*not* removing IsSerializable nor is it making Serializable actually have any effect.
Labels: -Milestone-Planned Milestone-1_4_RC
Comment 13 by goergen.daniel, Feb 16, 2007
Yes please include that in the next release! I am tired of using copy constructors :O)
Serializable doesnt have to have an effect on client side but if you want to
serialize a bean that implements IsSerializable this is really a pain.
Comment 14 by martin.c.webb, Mar 12, 2007
Bruce,

I'd be happy to allow Serializable not to mean anything.  However, "*not* removing
IsSerializable" is not the step in the right direction that I was looking for.  By
leaving IsSerializable as a necessary requirement for implementing asynch services is
tainting, otherwise technology/framework agnostic code, with a GWTism.

*IF* we could take a bulk standard POJO and _somehow_ add the IsSerializable marker
interface to the standard POJO at either Java 2 JavaScript code generation time or
run time, *without* affecting the source of the original POJO then I'd be immensely
happy!

I'm assuming (as I've not looked at the source code) that you are using
IsSeriablizable as a marker to the Java2JavaScript code generatorto know what data
needs to be supported across the wire?  If thats the case, and as you are using a
Java2JavaScript code generator cannot you implement a different marking schema
external to the source code.  I know it would get tricky with nested POJOs, i.e.
which of the nested POJOs are serialiable or not...

I don't know or understand the technical details of GWT - but supporting Serializable
as an internal means to mark the code is the obviously perfect mechanism! ;)

Happy to dialogue further if it would help...

What does IsSerializable do that it is so fundamental to the solution?

Regards
Martin
Comment 15 by treeder, Mar 14, 2007
+1 to removing the IsSerializable dependency.
Comment 16 by marceloemanoel, Mar 14, 2007
another one voting for IsSerializable remove :)
Comment 17 by climbingrose, Apr 11, 2007
+1 for removing IsSerializable interface.
Comment 18 by andres.a.testi, Apr 16, 2007
+1 for removing IsSerializable interface.
Comment 19 by gwt.team.mmendez, Apr 19, 2007
Added java.io.Serializable.  Removing IsSerializable will be addressed in the
subsequent release.  I created a new issue
http://code.google.com/p/google-web-toolkit/issues/detail?id=947 to track that
specifically.
Status: FixedNotReleased
Comment 20 by david.nouls, Apr 19, 2007
+1 for removing IsSerializable interface.
Whatever the technical details are, I can not sell a GUI/middleware if we must polute
the database tier. So I guess we have to wait for after GWT1.4. In a strict
environment we must follow the rules to get past the review process.
Comment 21 by theclassconnection, Apr 27, 2007
From what I've read in other threads, there is resistance to making Serializable
actually mean anything because the entire contract entailed by serializable in a java
environment could not be honored in GWT.  That's a rather weak argument though, as
almost EVERY class in the emulated java classes are limited beyond their java
contracts.  There are some Collections methods that would be really nice to have in
my application (retainAll and the like...) that are not supported.  They're part of
the collections contract, but failing to fully enforce THAT contract didn't prevent
you from implementing ArrayList and others.  More importantly, it didn't stop the
limited versions of these classes from being useful.

Even a relatively limited version of Serializable would be useful in a very similar
way.  Yes, you would have to ensure that you follow the supported parts of the
contract and do not rely on unsupported portions; but that is in no way different
from what you have to do in any other instance working with GWT.

-Joshua Yanchar
Comment 22 by gwt.team.bruce, May 29, 2007
Changing to Fixed status with GWT 1.4 RC release
Status: Fixed
Comment 23 by sumitcha...@google.com, Apr 28, 2008
 
Owner: mmendez
Sign in to add a comment