Tag: factorymethod

  • How to implement Factory Method pattern in Java?

    Lets say you want to sell headphones. You create an application to handle your sales. You create a generic HeadPhoneShop class which can handle creating(buying from the manufacturer) the head phones and sell them. But you don’t want it to do the actual creation. You want to delegate it a shop which deals with creating…