title: Factory and Builder patterns (mixing two or more patterns)
body: <p>I know this question was asked for many times, and it may look like the question is a duplicate, but i tried to understand the posts on SO, Google, GoF and didn't found the answer for me...</p>
  
  <p>I understand the difference between the Factory Method and Builder:
  Factory Method - Creates objects that derive from a particular base class, decoupling concrete implementation from client</p>
  
  <p>Builder Method - Hides the complexity of the object creation from client</p>
  
  <p>Now I see example that i found on internet (<a href="http://www.theserverside.com/news/1363653/Programmatic-Dependency-Injection-with-an-Abstract-Factory" rel="nofollow">Abstract Factory Design Pattern for Dependency Injection</a>), it's about an Abstract Factory, but it doesn't matter for my question. It's just one of many articles that i viewed</p>
  
  <pre><code>//Abstract Factory for Dependency Injection
  //Factory interface
  public interface Module1ServiceFactory {
   ComponentA getComponentA();
   ComponentB getComponentB();
  }
  
  //Concrete factory
  public class Module1ServiceFactoryImpl {
   private Module1ServiceFactory instance;
  
   private Module1ServiceFactoryImpl() {}
  
   public static synchronized Module1ServiceFactory getInstance() {
    if (null == instance) {
     instance = new Module1ServiceFactoryImpl();
    }
  
  return instance;
   }
  
  *** SUBJECT METHOD ***
   public ComponentA getComponentA() {
    ComponentA componentA = new ComponentAImpl();
    ComponentB componentB = getComponentB();
    componentA.setComponentB(componentB);
    return componentA;
   }
  
   public ComponentB getComponentB() {
    return new ComponentBImpl();
   }
  }
  </code></pre>
  
  <p>What I see in that example, ComponentA is a complex type that getComponentA() method used to build it.</p>
  
  <ol>
  <li>So why this is called Factory and not Builder??? Or it means that Module1ServiceFactoryImpl  implement Factory <strong>AND</strong> Builder patterns?</li>
  <li>Is it correct (commonly used) to create classes/objects that implements more than one design pattern in software architecture design?</li>
  </ol>
  
  <p>And sorry for my English :)</p>