Posts Tagged Design Patterns

A (overlooked?) use case for the Strategy pattern, part 2: it’s not about Template Method

Recap As I explained in my previous post, I think there is a use case for the strategy pattern that, in my opinion, we often overlook: This is what I’ve seen: class A has method x. Just after method x is done doing its thing and before it exits, it calls a (sometimes empty) protected [...]

, , ,

2 Comments

A (overlooked?) use case for the Strategy pattern

Composition over inheritance. It seems that we all agree and understand this valuable principle. I’ve been reading a good amount of code lately from some open source projects (including mine,) and I think we are still missing at least one use case where to apply it. This is what I’ve seen: class A has method [...]

, ,

9 Comments