You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To support true, full thread-safety of ObjectMapper instances it is necessary to remove mutability. One proven way is to require construction of instances via "builder" style construction.
Something like:
in which changes to configuration may be chained.
In addition to immutability, this will also make it much easier to construct properly typed sub-classes of ObjectMapper needed mainly (for now) for handling other data formats like XML, CSV, Smile and CBOR.
Beyond adding build() and builders, we should also add rebuild() method which will create builder from an existing mapper instance. This will allow simpler delegation of construction process.
Finally, JDK serializability of mappers can be changed to be simpler and safer process as we can retain builder information, including registered modules, and serialize that, instead of all the state actual mappers have.
The text was updated successfully, but these errors were encountered:
(from FasterXML/jackson3-dev#3)
To support true, full thread-safety of
ObjectMapper
instances it is necessary to remove mutability. One proven way is to require construction of instances via "builder" style construction.Something like:
in which changes to configuration may be chained.
In addition to immutability, this will also make it much easier to construct properly typed sub-classes of
ObjectMapper
needed mainly (for now) for handling other data formats like XML, CSV, Smile and CBOR.Beyond adding
build()
and builders, we should also addrebuild()
method which will create builder from an existing mapper instance. This will allow simpler delegation of construction process.Finally, JDK serializability of mappers can be changed to be simpler and safer process as we can retain builder information, including registered modules, and serialize that, instead of all the state actual mappers have.
The text was updated successfully, but these errors were encountered: