-1

I've got a question about the following terms..what do they mean in terms of a strategy pattern?

Algorithm Interface

Context Interface

Class Strategy

Class Context

Attribute Strategy

Concrete Strategy

And their hierarchy...

In other words, what would be their places in a normal strategy pattern?

-D

D. Spigle
  • 541
  • 2
  • 5
  • 15

1 Answers1

3

In very simple words ( and just to provide some context )

Algorithm Interface The methods the algorithm ( strategy ) will have.

Context Interface The methods exposed by the main object to which an strategy will be added to.

Class Strategy The class implementing/defining the strategy.

Class Context The class that will use the strategy.

Attribute Strategy The attribute of the context class that will be the strategy.

Concrete Strategy A concrete implementation of the strategy class/interface.

And their hierarchy ¬¬

OscarRyz
  • 196,001
  • 113
  • 385
  • 569