Strategy Pattern

Strategy Pattern

Strategy Pattern is a commonly used pattern for OOP.
The idea is to use Has-A relation replace Is-A relation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

interface FlyBehaviour

abstract class Duck {

constructor(flyBehaviour:FlyBehaviour) {

}

}

class rubberDuck extends Duck{

}




  TOC