Differences between Abstract Factory Pattern and Factory Method,confused by one case -
the main difference between "factory method" , "abstract factory" factory method single method, , abstract factory object. but, can't is,for example
class product{ } interface facotory{ public product create(); } class factorya implements facotory{ public product create() { return null; } } class factoryb implements facotory{ public product create() { return null; } } can tell me factory method or abstract factory?thank you!
imo, current example above factory method.
as have defined interface (factory) factory method (create) allows sub classes (factorya , factoryb) decide class instantiate (product derived classes).
Comments
Post a Comment