jeudi 29 juin 2017

Connect observers to observable automatically using dependency injection container

I have several services that implement an observer interface and one service that implements the corresponding observable interface.

I'm currently using unity together with Prism so I would prefer to keep this combination. My current solution is to inject the observable service in the observer services and let the observers subscribe themselves. I'm not sure this is a good design since the observer doesn't really depend on the observable.

Is there a way to automatically couple these using a dependency injection container? Is there another way?

Aucun commentaire:

Enregistrer un commentaire