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

Change Mongo/DB/DBCollection to interfaces

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.11.2
    • Component/s: API
    • Labels:
      None
    • Minor Change

      In our code, we'd like to have the ability to make a "DBCollection" class that would delegate all operations to the real DBCollection that we get from the Mongo driver and centralize operations around our db operations (ie: logging) in one place. However, DBCollection is an abstract class and not an interface.

      Would it be possible to add the public methods of the current DBCollection to a DBCollection interface and change the current class to be called DBCollectionAbstract, which implements DBCollection? It would allow this paradigm we want to use, allowing existing libraries to make use of custom DBCollections, and should only break driver users who have extended DBCollection and made their own. I'd be happy to contribute code for this as well.

      Thanks!

            Assignee:
            Unassigned Unassigned
            Reporter:
            michael.braun@wavestrike.com Michael Braun
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: