|
Annex B: Design PatternsB9.StrategyDescriptionWhen there are several possible implementations of an algorithm and is necessary to choose one of them dynamically, this pattern proposes the delegation of the execution of this algorithm to interchangeable objects which respect a common interface. Structure and Components
Structure and Components of the Strategy design pattern
Collaborations
Strengths and Weaknessesallows the definition of family of algorithms, allows the choice of the algorithm in a dynamic way and adapted to the context, it can be difficult to foresee the representation of the parameters resulting from the context of execution which are transmitted in a way identical to all the concrete algorithms. Use in CBR*ToolsThis pattern is used for each phase of the reasoning (classes Retrieve , Resuse , Revise and Retain ), as well as in the realisation of the phases themselves (classes CaseSetAdpatationFormula and AnalysisAdpatationFormula ). It is also used for the filters of indices ( IndiceFilter class) and in the similarities (classes ValueSimilarityFct and AggregationFct ). Brigitte Trousse Last modified: Fri Sep 28 13:52:30 MEST 2001 |