Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2264

Support constructor based serialization

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Codecs
    • Labels:
      None

      Rather than instantiating an empty instance via a no-arg constructor, allow for the construction of entities via constructor that takes values for the fields. Questions to answer:

      1. Should all the fields be required in the constructor?
        • If no, should the remaining fields be set via field injection?
      2. Should the constructor parameter names be forced to match field names so we can order them properly when invoking?
        • Should we rely on document order instead?
        • Should we allow for explicitly mapping constructor parameters to fields via annotations on those parameters?

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            justin.lee Justin Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: