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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • 3.5.9
    • Internal Code
    • None
    • Service Arch

    Description

      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.

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: