H5P Guides

Contracts

The H5P design is highly modular. Our composite H5Ps (e.g. Course PresentationInteractive Video) that contain integrated libraries communicate through a pattern called Design by Contract (DbC). The terminology comes from the relationship between a "client" and a "supplier" that defines a "contract" that the supplier must follow in order to satisfy the client. Similarly a library that wants to supply composite H5Ps must implement a set of contracts, more specifically accessible functions and variables. The composite H5P use these functions to get information from the integrated library.

Due to the lack of formal interfaces in javascript we document important contracts here: