vendredi 20 mai 2016

Is it appropriate to create Callables in a factory and execute them through a dispatcher? [on hold]

In my application , We are creating two types of callable object based on some condition.

We are executing all the callable objects using executer service from the main thread and updating the DB.

 public interface CallableTask<T> extends Callable<T>{

 }

 public class Task1 implements    CallableTask<TaskOutCome>{

 }

 public class Task2 implements    CallableTask<TaskOutCome>{

 }

Can we use factory design pattern to create callable objects and dispatcher design pattern to execute all callable object from the main thread.

Aucun commentaire:

Enregistrer un commentaire