We had a situation where we used Session Facade pattern to handle a number of business operations. We had a number of such Session Beans which almost exhibited similar behavior. Following are few example interfaces
CacheEntity getEntity(String pk);
There where 15 similar session beans what we did was to put all these methods into one Super Interface and all the session facades just extended this interface. In the Application we did not care much about which Session Bean are we operating on as long as it supported the Super Interface.
Lookup of the Session Beans was also made simple, we had an SessionBeanStore EJB which keeps trace of all the Session Bean and supported an very generic interface getSessionBean(SessionBeanName) which returned an Remote Reference of Session Facade.
So at the end of the day what we need is four line of code to call an update method.
SessionBean company = SessionBeanStore.getSessionBean(“Company”);
CacheEntity company = company.getEntity(companyName);
Also the Implementation of each Session Bean was much simple and straight forward.