It seems the discussion about how to do a better @GwtTransient has stalled. Meanwhile, some bug reports are sitting in limbo (2931, 2964), where the best answer depends on whether @GwtTransient is in the pipeline.
How about we go with this patch for now, thus giving the above people an immediate answer? In defense of that strategy, even though we may well redesign custom serializers more broadly later on, this feature will be very easy to support even if we decide to stop documenting it. The implementation is less than ten lines of very simple code. If that sounds like a workable way forward, could someone review the implementation? Bob, I can't remember if you looked at it yet or not. Lex On Thu, Nov 13, 2008 at 9:15 PM, Freeland Abbott <[email protected]> wrote: > @NotSerializable, however, doesn't capture the "serializable for other > purposes, just not for GWT" semantic. Granted, the FQCN of the annotation > specifies that it's a GWT annotation, but it may still be worth putting > something into the base name, e.g. @NotGwtSerializable. > However, moving towards Bruce's comment about more general use cases and > trying to retain some sense of "cool," we might consider > @SerializationHints(...) or @GwtSerializationHints(...), using the value to > specify attributes: @SerializationHints(TRANSIENT), > @SerializationHints(@Nullable Class[] whitelist, @Nullable Class[] > blacklist), @SerializationHints(OBFUSCATEDCLASSNAMES), etc. > (A value-sensitive annotation also concerns me less if it doesn't > basename-identify as "Gwt," but that may be my aesthetic quirk.) > > > > On Thu, Nov 13, 2008 at 8:41 PM, Bruce Johnson <[email protected]> wrote: >> >> Minor nit regarding the terminology, probably mostly just aesthetic on my >> part. "GwtTransient" doesn't sound that cool to me. >> Could we name it now to align with a more comprehensive effort later >> related to more developer control of RPC? For example, what if we called the >> annotation @NotSerializable. Then, we could also honor the annotation >> applying to an entire class in addition to fields. If that spanned >> inheritance, then it would be an easy way to blacklist entire hierarchies of >> classes. >> It isn't perfect, but we'd get a useful first step toward an full-featured >> RPC whitelist/blacklist facility. (In the general case, of course, you want >> to specify serializable-ness relative to a particular RPC service interface, >> not on the class itself. But it's a start...) >> >> On Thu, Nov 13, 2008 at 11:30 AM, Lex Spoon <[email protected]> wrote: >>> >>> Bob, can you review the small attached patch? I can ask others if you >>> are slammed, but it's small and affects code you are familiar with, so >>> I thought I'd ask you first. >>> >>> This patch implements support for a @GwtTransient annotation. >>> @GwtTransient means the same thing as the transient keyword, but it is >>> ignored by all serialization systems other than GWT's. Usually the >>> <code>transient</code> keyword should be used in preference to this >>> annotation. However, for types used with multiple serialization >>> systems, it can be useful. The motivation is discussed further in >>> these bug reports: >>> >>> http://code.google.com/p/google-web-toolkit/issues/detail?id=2931 >>> http://code.google.com/p/google-web-toolkit/issues/detail?id=2964 >>> >>> >>> The patch simply adds the annotation and checks it in the places >>> isTransient is currently checked. So, from GWT's point of view, >>> isTransient and @GwtTransient are equivalent. >>> >>> >>> -Lex >>> >>> >> >> >> --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
