Relative Content

Tag Archive for factory-method

Event action abstraction and trigger control

I am thinking of abstracting Event action in order to make further alteration/implementation/maintenance easy since the project I am currently working on has volatile requirement. So I thought of the following concept.
I created an implementation of IEventAction which ex. handles closing of planning in my application, I made IEventAction extends IEventAction so I can manage all EventAction using a generic collection; and using a factory, I will get the appropriate event by passing the keypress key to the factory to resolve the correct event as shown in the code below.