This is the 1st pattern I study. In here, I will mark down my doubts, Java study, design principles, design pattern.
There are3 design principlesIn this pattern:
1. Identify the aspects of your application that vary and separate them from what stays the same (codeproject)
2. Program to an interface, not an implementation (stackoverflow)
3. Favor composition over inheritance (stackoverflow)
Java study:
1. in C ++, absolute C ++ said we need to encapsulate so that we separate codes into interface (. HPP) and implementation (. CPP ). but in Java, just use:
Public interface name {}
Public class name {}
2. in strategy DP, encapsulate algorithms for one interface. and the duck base class needs to be inherited, and use abstract method. by defining an abstract method, the class needs to be defined:
Public abstract class duck {}
3.
UML Notations: (Ref: codeproj link shown before)