title: EJB 3 Multiple Stateless Session Bean Implementations of the Same Interface
body: <p>I am wondering if it is possible to accomplish the following using EJB3.</p>
  
  <p>I have the following interface:</p>
  
  <pre><code>interface DateParser {
      Date parseDate(String input);
      String getType();
  }
  </code></pre>
  
  <p>Then I have several implementations of said interface that handle different formats based on the information given in the getType method. When my bean starts up it creates a Set of implementations of DateParser and when it needs to parse a date, it iterates over the set to see which one matches. If one matches it uses that one to parse the date. If none match, then it applies a default strategy. I would like to get away from instantiating these delegates because every time I add a new strategy it requires a code change in the bean making it a huge mess. </p>
  
  <p>I would much prefer to have the container inject all of the implementations it finds at deployment. Is there a reasonable way to accomplish this?</p>
  
  <p>Thanks</p>