The initialization logic for DatabaseTermIdsAcquirer that will be passed to DatabaseItemTermStore and DatabasePropertyTermStore will be concerned about providing the callback function. These two classes receive the acquirer as a constructor rparameter. To hide the callback logic from the singleton/factory that creates the acquirer and pass it through to these two classes, we can do one of two things (from cleanest to dirtiest, the opposite order would put the least effort/most pragmatic ones first):
- allow DatabaseTermIdsAcquirer to accept multiple callbacks, adding a method to add new ones to in stance, say addTermIdsConsumerCallback => these two classes can add their callbacks to the instance that is passed to them
- just provide a setter method for the callback on DatabaseTermIdsAcquirer => these two classes can use to set their callbacks on the passed acquirer instance
- initialize Acquirer inside these two classes instead of it being passed to the constructor as done now => provide the callback as part of initialization