In many of the examples using the java arangoDB driver , they use method chaining
arangoDB.db("myDatabase").createCollection("myCollection", null);
or
arangoDB.db("myDatabase").collection("myCollection").insertDocument(myObject);
Are there any drawbacks with re-using objects?
ArangoDatabase db = arangoDB.db("myDatabase");
...
db.createCollection("myCollection", null);
ArangoCollection coll = db.collection("myCollection");
...
coll.insertDocument(myObject);
I am not sure if chaining approach is preferred or just for simplicity (fewer lines for an example).
Yes, you can reuse instances of ArangoDatabase, ArangoCollection, ArangoGraph, ArangoVertexCollection, ArangoEdgeCollection.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.