Suppose, I have four different entities in our c# design system.
- Organization
- Class
- Course
- Students
Now, I have to pull the above entities data from the third party API and store in our system.
I have created the four different business access classes of above entities which will have common pull method.
Public bool PullFromThirdPartyApi()
{
//Logic goes here
}
So far, I can use the factory design pattern for it but problem will arise when business class may contains different functions.
Suppose, Organization and Class business access contains extra below method which Course and Students business Class may not contain.
Public bool PullByIDFromThirdPartyApi()
{
//Logic goes here
}
Please suggest the suitable design pattern here with sample demo.
Aucun commentaire:
Enregistrer un commentaire