I have three usecases (firstType, secondType, thirdType) and firstType can do ( task1 , task2, task3, task4, task5) secondType (task1, task2 ) thirdType (task1, task2 , task5 ) second type can be converted to third type if some Condition happened
if I have 5 events and once each event happen I want to call the task in whoever is the current type
for example, if the event is handleTask1 and the current usecaseType is firstType i want to use firstTypeUsecase.task1
if the event handleTask5 and the current usecaseType is thirdType I want to do ThirdTypeUsecase.task5
I was thinking of FactoryPattern but since all of usecases don't implement the same methods
any idea how to implement that in a clean architecture?
Aucun commentaire:
Enregistrer un commentaire