Spring bean creation via deserialization
Posted
by mdma
on Stack Overflow
See other posts from Stack Overflow
or by mdma
Published on 2010-04-27T12:00:30Z
Indexed on
2010/04/27
12:03 UTC
Read the original article
Hit count: 322
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?
© Stack Overflow or respective owner