The best implementation of BSON is embedded in the mongo-java-driver. Somebody has the foresight to publishhttps://github.com/mongodb/ mongo-java-driver is published as 2 maven artifacts. One as org.mongodb:mongo-java-driver and as org.mongodb:bson (which only contains org.bson packages).
Problem is the org.mongodb:bson artifact is basically unusable, since it depends on the com.mongodb package
Here is a search for com.mongodb in https://github.com/mongodb/ mongo-java-driver/tree/master/ src/main/org/bson
$ ack com.mongodbBasicBSONEncoder.java19:import com.mongodb.DBRefBase;
BasicBSONObject.java19:import com.mongodb.util.JSONSerialize rs;
io/OutputBuffer.java174: return com.mongodb.util.Util.toHex( md5.digest() );
LazyBSONCallback.java19:import com.mongodb.LazyDBObject;
LazyBSONObject.java793: return com.mongodb.util.JSON.serializ e( this );
LazyDBList.java22:import com.mongodb.DBObject;
23:import com.mongodb.util.JSON;
28: * @deprecated Please use {@link com.mongodb.LazyDBList} instead.
Would love to see bson package extracted into its own repository. Replace all references of com.mongodb with extension points which the mongo-java-driver can use to preserve existing behaviour.
Then we can have an usable standalone org.mongodb:bson
We're aware of this problem, and for the upcoming 3.0 release we've ensured that the bson module can be separately compiled from the rest of the driver. See https://github.com/ mongodb/mongo-java-driver/ tree/3.0.x/bson.
Just out of curiosity, what are using the bson module for?
댓글 없음:
댓글 쓰기