I have a Product class, and Builder classes, one of them can build that product subclass getting data from database, another builder can build that product getting data from other sources. So far I have an interface:
public interface ProductDao {
Product buildProduct(RetrieveBy by, String s);
}
an enum with building options:
public enum RetrieveBy {
NAME, TYPE, BRAND
}
I do not know what is the best way to name class that is going to implement the interface and will build the product getting data from database, and other classes that can build that product getting data from other sources(JSON, XMLs, or property files).
Someone suggested me to create just a single class and name it ProductBuilder
, but, IMO this violates single responsibility principal.