Conjecture::StrategyFactory Class Reference

#include <StrategyFactory.h>

Inheritance diagram for Conjecture::StrategyFactory:

Conjecture::DefaultAlgorithms Conjecture::GocrAlgorithms Conjecture::OcradAlgorithms Conjecture::WmhAlgorithms List of all members.

Detailed Description

AbstractFactory design pattern supporting the bundled creation of related Strategy algorithms.

In order to make customization easy, Conjecture identifies the fundamental algorithms necessary to perform OCR. Each of these algorithms is formalized into a Strategy class hierarchy - different subclasses provide different implementations of the algorithm. A particular run of the OCR establishes which strategy to use for every one of its algorithms, and performs them in the appropriate sequence (the sequence in which algorithms are applied is also one of the algorithms).

Since the specific strategy for solving one problem might depend on or require a specific strategy for solving some other pattern, we introduce an Abstract Factory design pattern. In general, an Abstract Factory is a collection of Factory Methods (which produce products). An Abstract Factory allows one to enforce dependencies between individual products created.

NOTE: The products being produced here are instances of a specific subclass of each Strategy hierarchy. Strategy is another design pattern, and normally the subclasses are Singletons (the classes represent algorithms, and are normally stateless, or at least requiring only a single state). However, I have not yet fully established whether using Singletons will pose problems for multi-threading or parallel/distributed algorithms, so for now I'm not making Strategy subclasses singletons. If we do decide to do so, it might be easier to just have the StrategyFactory intern objects than to put the Singleton design pattern into every single Strategy subclass. There will be many Strategy hierarchies, and potentially many subclasses in each hierarchy.


Public Member Functions

FormatStrategyformat () const
IdentifyStrategyidentify () const
SegmentStrategysegment () const
ProcessStrategyprocess () const
void init ()
virtual ProcessStrategycreateProcessStrategy () const =0
virtual SegmentStrategycreateSegmentStrategy () const =0
virtual IdentifyStrategycreateIdentifyStrategy () const =0
virtual FormatStrategycreateFormatStrategy () const =0

Protected Member Functions

void formatIs (FormatStrategy *format)
void identifyIs (IdentifyStrategy *identify)
void segmentIs (SegmentStrategy *segment)
void processIs (ProcessStrategy *process)


The documentation for this class was generated from the following files:
Generated on Mon Jun 12 20:27:17 2006 for Conjecture by  doxygen 1.4.6