Spring bean creation via deserialization
- by mdma
Spring has many different ways of creating beans, but is it possible to create a bean by deserializing a resource?
My application has a number of Components, and each manipulates a certain type of data. During test, the data object is instantiated directly and set directly on the component, e.g. component.setData(someDataObject). At runtime, the data is available as a serialized object and read in from the serialized stream by the component.
Rather than having each component explicitly deserialize it's data from the stream, it would be more consistent and flexible to have Spring deserialize the data object from a resource.
Is there a DeserializerBeanFactory or something similar?