What is the difference between the template method and the strategy patterns?

Can someone please explain to me what is the difference between the template method pattern and the strategy pattern is?

As far as I can tell they are 99% the same – the only difference being
that the template method pattern has an abstract class as the base
class whereas the strategy class uses an interface that is implemented
by each concrete strategy class.

However, as far as the client is concerned they are consumed in exactly the same way – is this correct?

19 Answers
19

Leave a Comment