Thanks for the response.
What you say is true, for the most part, but doesn't hold well for the specific category of objects I'm trying to serialize and deserialize at the moment, basically, persistent message driven workflows. A good example is NServiceBus's sagas:
NServiceBus actually separates the state of the saga (saga data) from the saga implementation, but I believe the reason for that is to ease object relational mapping of the saga data, which I'm not interested in. I just want to serialize the thing to JSON. This works fine as long as your service related dependencies are transient. Though I'm open to splitting the saga data out to a separate class, it seems like an extra hoop to make our users jump through as things have worked fine as they are so far.
As for re-hydrating a saga, you can either let gson create the object and inject any remaining members with Guice, or in my cause, what I'd like to do is construct the object with Guice (so that it can be instrumented) and populate state data via Gson. It looks like this would only work if Gson supported a global InstanceCreator, or an InstanceCreator that created instances assignable from some registered type (such as Object.class).
Anyways, given the specific use case I'm working with here, any change in thought?
Cheers,
Josh