Jump to: navigation, search

JFace Viewer - Implementation of Strategy Pattern

Revision as of 14:13, 30 November 2008 by Annamalai.chockalingam.gmail.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

In the Viewers implementation you would want to customise its behaviour

  1. Sorting
  2. Filtering


In addition to customising, you may also want to reuse the same Sorting and Filtering Algorithm in some other viewer also. Therefore eclipse uses Strategy Pattern to implement these features without disturbing the loading and filling of the Viewer.

How is Strategy Pattern used?

In Strategy Pattern, the expected behaviour is handled by a seperate object.
Therefore the concept of ViewerSorter and ViewerFilter are implementation examples of Strategy Pattern used in JFace Viewers. These are initialised when required to apply the customised behaviour in a Viewer.