Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29864

Clarify/revisit how IDL-generated classes fit into larger C++ classes

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.5.9
    • Component/s: Internal Code
    • None
    • Service Arch

      The LogicalSessionId class inherits from Logical_session_id so that it can make use of the IDL-generated class' getters, setters, and parsing logic. The LogicalSessionId class is intended to be a value-add on top of the IDL-generated parsing code. This inheritance however makes it difficult to write code at the boundary between initialization and construction, because that requires casting from one type to the other.

      We should revisit and clarify the way that C++ classes are meant to incorporate or compose with IDL-generated classes, and develop clear methods and guidelines for how to do that in a way that is more straightforward. We could consider recommending factory functions and static getters rather than using inheritance in cases like these.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: