Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 732 Bytes

chapter2_5_2.md

File metadata and controls

18 lines (12 loc) · 732 Bytes

Document Collection Factory

The factory classes have the duty to create the document collection manager.

  • DocumentCollectionManagerFactory
  • DocumentCollectionManagerAsyncFactory

The DocumentCollectionManagerAsyncFactory and DocumentCollectionManagerFactory creates the manager synchronously and asynchronously respectively.

DocumentCollectionManagerFactory factory = //instance
DocumentCollectionManagerAsyncFactory asyncFactory = //instance
DocumentCollectionManager manager = factory.get("database");
DocumentCollectionManagerAsync managerAsync = asyncFactory.getAsync("database");

The factories were separated intentionally, as not all databases support synchronous and asynchronous operations.