title: Auto-wiring Multiple implementation of a Abstract class
body: <p>I have been working on a spring MVC project structure where multiple concrete service classes extends from a Abstract Class. <br>
  <a href="https://i.stack.imgur.com/cODfh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cODfh.jpg" alt="enter image description here" /></a></p>
  <p>In my controller, i am trying to autowire the abstract class and choose the implementation based on the user choice. Here's the relevant portion of Controller class:</p>
  <pre><code>@Controller
  @RequestMapping(&quot;/&quot;)
  public class DashboardController {
      @Autowired
      LogAnalyzerAbstract logAnalyzer;//new LogAnalyzer();
        private static final Log logger  =LogFactory.getLog(DashboardController.class);
   ....
  logAnalyzer.process();
   }
  </code></pre>
  <p>I want to the controller to use the implementation based on the user input and used the Abstract class LogAnalyzer reference in the further implementaion.</p>
  <p>Is my logic valid? Can you guide me through?</p>