Relative Content

Tag Archive for strategy

Context class in Strategy pattern

I’m trying to understand the strategy pattern and asking myself: is the context class must-have or can I leave it out without compromising pattern’s purpose ?

Best strategy in SQL

Recently, a colleague told me that it wasn’t advisable to make conditions in the join clauses. Instead he suggested to make conditions in the where clause. He told me that the SQL engine was optimized for this way.

Inheritance vs ‘specification’ by fields

I’m currently reading ‘Head first design patterns’ and I already have a few questions on the first chapter of the book.
This chapter introduces the ‘prefer composition over inheritance’ design principle, by explaining the ‘Strategy-Pattern’. My question isn’t about the pattern, but rather about a more basic design decision in one of the examples:

Inheritance vs ‘specification’ by fields

I’m currently reading ‘Head first design patterns’ and I already have a few questions on the first chapter of the book.
This chapter introduces the ‘prefer composition over inheritance’ design principle, by explaining the ‘Strategy-Pattern’. My question isn’t about the pattern, but rather about a more basic design decision in one of the examples: