title: Using ServiceLocatorFactoryBean of Spring
body: <p>I am creating third part login system for my web application using Oauth2 and have to support various third party Oauth2.0 service provider like</p>
  
  <ol>
  <li>Gmail</li>
  <li>Facebook</li>
  <li>MSN</li>
  <li>Yahoo</li>
  <li>Twitter</li>
  </ol>
  
  <p>I have already working code for these.Each service provider have a certain set of configuration which need to be created before starting Oauth process.I was thinking about using <code>ServiceLocatorFactoryBean</code> of Spring and create few services for each Oauth provider and based on what user has selected can fetch that specific service.</p>
  
  <p>Is my approach is good enough or is it like a overuse / overcomplicated one</p>
  
  <p><strong>Edit</strong></p>
  
  <p>As per one answer, We can create a single bean with singleton scope and inject Map of required services to it so as we can fetch services from Map based on what user has selected, though approach is fine but won't that force us to load every services in Memory and no matter if we will use them or not, they will remain in Memory</p>