[JAVA-322] Introduce interfaces on core classes such as DBCollection, DB, etc Created: 12/Apr/11  Updated: 25/Jun/13  Resolved: 12/Apr/11

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 2.5.3
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Shai Yallin Assignee: Antoine Girbal
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.



 Comments   
Comment by Bernardo S. A. Silva [ 12/Apr/11 ]

This is a the same problem that JAVA-303 is solving.
I already applied a patch.

Generated at Thu Feb 08 08:52:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.