I’m just getting into design patterns and what I’m reading is that the pattern is typically independent of language.
In programming we have OOP and non-OOP (is there a name for non-OOP?).
I’ve recently been playing with the template pattern and it seems to almost counter-intuitive for OOP. The fact it’s just effectively a bunch of “Go To Methods” (reminding me of Pascal to a degree) seems some how ‘against’ how OOP wants to behave.
Does this mean that some patterns are better suited to languages (and I appreciate that having some thing not perfectly suited doesn’t mean it’s not suitable).
The template pattern is actually a very good example of OOP when done properly because you can refer to a group of related objects by their abstract type, and operate on them in a similar fashion because they each implement the same “contract” of methods. That pattern is said to define algorithm/program structure, but in most basic cases, it’s really just polymorphism.
You could argue that some patterns are better suited to other languages, but you can pretty much use any pattern in any language.