Home > REST Constraints > Uniform Contract

Uniform Contract

Short Definition

Service consumers and services share a common, overarching, generic technical contract.

Long Definition

Consumers access service capabilities via methods, media types, and a common resource identifier syntax that are standardized across many consumers and services. Service capabilities provide access to resources that can further provide links to other resources.

Application
  • A uniform contract with generic and reusable methods media types and resource identifier syntax is established for a collection of consumers and services.
  • Consumer message processing logic is designed to be tightly coupled to the uniform contract.
  • Consumer message processing logic is designed to be decoupled or loosely coupled to service-specific capabilities and resources.
  • Resources can further provide links to other resources that the service consumer can "discover" and optionally access, dynamically at runtime.
  • Consumers can dynamically "learn" new media types to process previously unknown resource formats.
Impacts
  • The application of this constraint results in baseline standardization of technical interface characteristics across all services within the scope of application. This level of standardization can foster interoperability across all affected services.
  • Standardization resulting from Uniform Contract can include canonical schemas associated with media types. The common use of such schemas can further improve the extent of intrinsic interoperability.
  • By limiting coupling to the uniform contract and leveraging dynamic binding, consumers and services can achieve reduced levels of overall coupling requirements.
  • It can be difficult to identify and entirely rely on built-in uniform contract semantics for machine-to-machine interactions that need to be reusable by multiple services and their consumers.
  • Request and response messages based on uniform methods and media types may contain more information than is strictly required for a particular interaction. The transfer of redundant data can increase performance overhead.
Relationship to REST

The Uniform Contract constraint builds upon Client-Server to support reuse and composition of consumers and services.

Related REST Goals

Simplicity, Modifiability, Performance (negative), Visibility