I am reading about factory design pattern, this pattern comes in 3 forms, simple factory, factory method and abstract factory.
what I understand, that's simple factory is not a design pattern, it just a type of encapsulate the object creation code in conjunction with if/switch statement or direct loading for the classes with exception if the class not exist!.
When I tried to move to factory method I can't find a clear enough example to defer it from simple factory.
could you guys give an example that's explain the factory method and how its defer from simple factory?
Thank you.
Aucun commentaire:
Enregistrer un commentaire