BsonContext rework
Since the start of the project, BsonContext has been the main entry-point. BsonContext was initially placed in :bson because it represented the concept of "creating a BSON document". Everything in :dsl and in the drivers uses BsonContext, so it also became the "configuration class".
In !80 (merged), ObjectIdGenerator was added to BsonContext, as it is a "configuration" that needs to be available from everywhere.
In !151 (merged), PropertyNameStrategy was added to BsonContext, as it is a "configuration" that needs to be available from everywhere.
However, this has a few downsides:
-
BsonContextoriginally had the single concern of "generating BSON documents". It now also acts as a service locator. -
PropertyNameStrategyhas nothing to do in:bson, and it would be much better in:dslwhere it would have access toPath. However, sinceBsonContextis in:bson, it has to be there too.
This MR splits BsonContext into two:
-
BsonFactoryremains in:bsonand has the single concern of generation BSON documents & arrays. -
BsonContextis moved to:dsland has the single concern of holding services.
Additionally, PropertyNameStrategy is moved to :dsl and migrated to Path.
This refactor is quite big, but it shouldn't impact users of the high-level API other than maybe some imports renames.
Closes #95 (closed)