jeudi 25 décembre 2014

Should I use strategy pattern for domain service that is saving data using an independent API

I have domain service A and B. They are focused on the types T1 and T2 and they have methods to read and save T1 and T2 objects from and to the persistence layer.


The save functionality is based in a unique API that take objects T1 and T2 and is no related to the read methods. I was thinking to use Strategy pattern in the domain services A and B that take by constructor or property the saverUsingAPI service but I dont know if this the optima solution.


Should I use Strategy pattern on this case or can I use other pattern or just pass the service by constructor or property to the domains services?


Aucun commentaire:

Enregistrer un commentaire