I am designing a client that will call methods based on certain inputs. I will be sending in a billing system enum and calling an endpoint to determine which billing system is appropriate for an existing patient. Once I get the billing system, I have to check to see what type of operation I need to perform and make an API call based on the billing system. For example, if I need to update a patient record and the patient is in BillingSystemA, I need to call a Put based method of the API for BillingSystemA. I need to have CRUD methods for each billing system. Selecting between the two billing systems and allowing for future growth made me thing that the strategy pattern was a good fit. Strategy seems to work for the billing system, but what about the CRUD operations? I have a BillingStrategy abstract class that has Create, Update Get and Delete methods, but I need those methods to work against a variety of types. Can I just make the methods generic, like T Create<T>
or bool Update<T>
or do I need a strategy within a strategy to manage this? I've analyzed myself into a corner and could use some advice.
mercredi 5 juin 2019
How do I deal with two situations that could be candidates for a strategy pattern solution?
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire