lundi 30 novembre 2015

Architecture design

I have the following scenario(the analogy is not accurate):

enter image description here

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