chesstango

Patterns Index

Creational Patterns

Factory Method

Factory method pattern is usually applied in combination with Template method pattern:

Abstract Factory

Abstract Factory pattern examples:

Builder

Builder pattern has been implemented with different participant classes

Structural Patterns

Facade pattern is implemented by GameImp class.

Proxy pattern is implemented by ChessPositionReader as access control interface to underlying implementation classes. Game and ChessPosition implements this interface, Game forwards all requests to ChessPosition class for actual implementation. MoveGenaratorWithCacheProxy implements a cache proxy. Another example is MoveGeneratorWithCacheProxy.

Behavioral Patterns

State

The classes in the package net.chesstango.uci.engine collaborate within the State Design Pattern to implement the behavior of a chess engine that uses the Universal Chess Interface (UCI) protocol. The State Design Pattern allows the engine to encapsulate its behavior and manage the transitions between different operational states. Each state is represented as a class that defines specific behavior and controls transitions to other states. Please read State Pattern for further description.

Template method

Template method pattern is applied in different situations by abstract classes. By convention, those classes with template methods are abstract classes and named with the Abstract prefix.

Command

Command pattern in combination with Visitor pattern can be found at chess.moves package.

Interfaces Move/MoveKing/MoveCastling define DO and UNDO operations.

Classes in package net.chesstango.board.moves.imp implement these interfaces.

Strategy

Strategy pattern is implemented at net.chesstango.board.movesgenerators.pseudo.strategies package. MoveGenerator interface declares the interface, all the classes in this package implements the interface (with the exception of PeonPasanteMoveGenerator).

Iterators

Iterators can be found at net.chesstango.board.iterators package.