Module architecture

The simplest possible module is a single class that implements the root module interface, DMBridgeModule. This class (called, for example, SampleModule) resides in a file called SampleModule.php within the dm/extensions/modules/SampleModule folder. (SampleModule is a real module included in this location.)

A simple interface hierarchy exists to define "contracts" for modules that perform different functions, such as the ones in the list above. The root interface is DMBridgeModule, and all modules must implement it. Additionally, they may implement any combination of the following other interfaces if they so choose:

DMBridgeModule

The root module interface that all modules must implement. This serves to identify the module and access its basic information, including its name and version.

DMBridgeControlPanelModule

To be implemented by modules that intend to add their own sections in the Control Panel.

DMBridgeDataStoreModule

To be implemented by modules that intend to use their own tables in the dmBridge data store.

DMBridgeRepresentationSchemaModule

To be implemented by modules that intend to supply their own representation schema (normally an XML Schema) in the HTTP API.

DMBridgeTemplateHelperModule

To be implemented by modules that provide their own template helpers.

The name of the main module class is not important, but it should be distinctive in order to avoid class name clashes.