java - Generic method invocation using annotations -
i creating web application , injecting systemmanager interface in it. of business logic resides behind , pages have request data it.  create generic implementation method signature , based on annotation invoke correct method in system.
the implementation of interface acts facade pattern - calls methods on different objects.
the current implementation
systemmanager.java
void executea();  void executeb();   systemmanagerimpl.java
void executea(){    systema.exectuea(); }  void executeb(){    systemb.exectueb(); }   but replace generic solution like
systemmanager.java
@systema void executea();  @systemb void executeb();   systemmanagerimpl.java
void genericmethod(){    // based on annotation of method received calling correct system class , invoking correct method }   i dont think possible still open suggestions.
 
 
Comments
Post a Comment