Constructs of an API
Before we start discussing the various architecture styles, let's get familiar with the different constructs that make up an API. Throughout this chapter, we will be using these terms and hence it is important to have a common understanding of them. The various parts that constitute an API are depicted here:
The constructs of an API are explained in the following sections.
API operations or service contract
The interface definition of an API outlines the list of operations supported by the API. Each operation must be unique and should perform a single function or task; in other words, it follows the single-responsibility principle. Â
Data contract or entity schema
The data contract defines the schema of the entities that participate in the various operations supported by the API. The entities can be simple or complex data types depending on the type of operation being...