-
1. Re: Marshalling discovery need to be revised
jfuerth Jun 28, 2012 10:17 AM (in response to throwable)Hi Anton,
Thanks for this feedback. I agree with you on many points, and I disagree on a few:
- Every class, abstract class or interface may be marked as @Portable.
- Every class that inherits portable class or interface automatically becomes portable.
- Now we can create a "Portable" marker interface (like Serializable) and mark our classes via inheritance.
This behaviour makes sense to me, and I think it's a pretty low-risk change in behaviour.
- Every class found in set of fields of a portable class (except transient and static) must become portable (including subclasses).
- Every classes discovered in methods of an interface marked as @Remote becomes portable
I disagree on these two points. The requirement to explicitly mark types as @Portable has benefits:
1. It prevents accidentally sending large amounts of data over the wire
2. It is a safety mechanism that prevents sending instances of secret "server only" types over the wire
3. It advertises to other developers that instances of the type will be serialized, so they need to keep in mind some design constraints
- Static inner classes of a portable class by default must not be portable.
I totally agree. I fought for this default behaviour, but I lost. Unfortunately, you will have to mark each static nested class with @NonPortable (which is newly available in Errai 2.0.1).
- It will be good to add support for non-static inner classes. Currently none of GWT serializers support them.
That's a very good idea. Can you open an issue for this at issues.jboss.org?
-Jonathan