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.
Factory for creating a singleton instance
We have some legacy code that has a bunch of singletons all over the place (written in C#).
factory methods in JPA entity classes. anti pattern?
I started using factory methods in JPA Entity classes. But I’m not sure if it’s an anti-pattern. If it is , then where do I place them instead ?
A similar sample is below
factory methods in JPA entity classes. anti pattern?
I started using factory methods in JPA Entity classes. But I’m not sure if it’s an anti-pattern. If it is , then where do I place them instead ?
A similar sample is below