I’m studying OOP design patterns in a solution-oriented way which I mean not concentrating just one pattern but with a comparative analysis like their combined or hybrid usages and equivalents in dynamic languages or in functional languages.
As the GoF grouping name
behavioral patterns implies, this patterns are for
behavior parameterization by utilizing
single method dynamic dispatch in terms of polymorphism that OOP languages provides inherently AFAIK. I assume Strategy pattern as the main form of this mechanism and Template method pattern as its derivation which also keeps common code. Is that reasoning right? Can we approach polymorphism in OOP in this way?
If we think outside of OOP there are higher order functions and lambda functions in dynamic languages and functional languages or mix of them. I think that these languages provides only a few patterns/constructs in contrast to the GoF catalog which I map them to Strategy and Template Method Patterns in essence.
With this perspective, I have analyzed other behavioral patterns and then this question can’t get out of my mind. Even if it looks general but I think I’ve tried to be specific, I’m taking the risk of asking here.
Can we do the same job with Strategy or Template patterns instead of
Command, Chain of Responsibility or Decorator(Structural but let's assume in this group) for an example in more or less finer design?
Note: I’m not trying to generalize so for example I know
Visitor pattern is out of this scope since it solves the expression problem.