I am trying to design an application where I will have a Map of IAction
objects. Each IAction
object has a method IAction IAction.processAction()
where it is executing the knowledge contained within it. This could querying the database calling a web service, etc. After the execution of each IAction
control is then sent to the next IAction
instance.
When the application starts up it will contain a Map of Map
that will be in the correct order of execution. The key of Integer
type of the Map
is the order for which execution will run. IAction.processAction()
could jump control to the last IAction
in the Map or stop it all together.
I can visualize the code in my head and I've written some lines to help me with this. I am looking for a Design Pattern that would easily help with this type of processing. I am not sure if the Command pattern would fit this role.
I was hoping someone could tell me which patterns they feel may fit the bill or not.