Sign in Join
FPDoc Onlineexperiment

fpObserver unit

Observer pattern implementation for Free Pascal

The fpobserver unit provides a complete implementation of the Observer pattern for Free Pascal applications. It includes classes and interfaces for creating observable objects that can notify multiple observers when their state changes.

The unit contains the TObservedHook class for adding observer support to any object, the TBaseMediator hierarchy for automatic data binding between model and view objects, and mediator management classes for registering and finding appropriate mediators.

Classes and records

EMediatorclassException class for mediator-related errors
TBaseListMediatorclassBase mediator for handling lists of observable objects
TBaseMediatorclassBase class for mediating data between model and view objects
TColumnsListItemMediatorclassList item mediator with multi-column support
TColumnsListMediatorclassList mediator supporting multiple columns with field configuration
TComponentMediatorclassGeneral-purpose mediator for any TComponent-based view
TListItemMediatorclassMediator for individual items within list mediators
TMediatorDefclassDefinition for registering mediators with the mediator manager
TMediatorDefsclassCollection of mediator definitions for the manager
TMediatorFieldInfoclassDescribes a column in columnar list display mediators
TMediatorFieldInfoListclassCollection of field information for columnar list displays
TMediatorManagerclassCentral manager for registering and finding mediator definitions
TObservedHookclassObserver pattern helper class implementing IFPObserved interface

Procedures and functions

MediatorErrorprocedureRaises formatted mediator error with context information
MediatorManagerfunctionReturns the global singleton mediator manager instance

Types

TMediatingEventprocedure typeEvent type for mediating data transfer operations
TMediatorClasstypeClass reference type for TBaseMediator descendants
TOnBeforeSetupFieldprocedure typeEvent type for formatting field values before display

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.