I have the following scenario(the analogy is not accurate):
The specific implementation of MoveForward
is implemented in "Dogfeature" and "SnakeFeature".
Dog snoopie = new Dog();
Snake kaa = new snake();
snoopie.MoveForward();
kaa.MoveForward();
When I call snoopie.MoveForward()
I want the MoveForward
implemented in DogFeature
to be executed.
I dont see this problem as a polymorphism or is it?
How do i solve this? any design patterns?
The language that i'm trying is C#.
Aucun commentaire:
Enregistrer un commentaire