Details
-
Improvement
-
Resolution: Duplicate
-
Major - P3
-
None
-
2.5.3
-
None
Description
We're attempting to add some cross-cutting concerns to the DBCollection class (such as profiling and auditing). We wanted to do so using the JDK Proxy, but unfortunately DBCollection is an abstract class rather than an interface, and JDK Proxy only works on interfaces. We then tried decorating DBCollection, which was only possible by writing our class in the com.mongodb package, since DBCollection has some package-protected abstract methods.
It would be good practice (and will generally assist users in extending the Mongo driver) if core classes, such as DB, DBCollection, etc were exposed as Java Interfaces rather than being abstract classes.