Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ObjectCodec: replace with ObjectWriteContext / ObjectReadContext #16

Closed
cowtowncoder opened this issue Oct 6, 2017 · 1 comment

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Oct 6, 2017

Problem with ObjectCodec is that it refers to general "factory" entity (like ObjectMapper), so to read/write anything it is necessary to create active instances, but ones that are not (as of Jackson 2.x) carried through processing pipeline. This means that new distinct contexts are created, which not only add overhead (which may or may not be big issue) but also remove possible settings that reader/writer would have, as well as any state (context attributes).

So for 3.0 let's replace codec abstraction with separate stateful abstractions, work that has already started. Essentially:

  • ObjectReadContext will be used both for accessing necessary reader (parser) configuration, overrides AND state of deserialization.
  • ObjectWriteContext will be used both for accessing writer (generator) configuration, overrides AND state of serialization process.

So far most of latter has been done; more work needed for replacing reader usage.

@cowtowncoder
Copy link
Member Author

Implemented as FasterXML/jackson-core#413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant