I have successfully used strategy design pattern to for a Ducks Class and its Subtypes. Below is the diagram of relationships between different classes.
Now, I want to create a Factory to generate instances of different types of ducks. Should I use behavior classes (FlyBehavior and QuackBehavior) or should I use just Duck class to create a Factory class? Thanks. Your help will be appreciated.
Aucun commentaire:
Enregistrer un commentaire