ArchiMate constructs: Representing APIs
Representing APIs
The meta-model for API interconnections:
Two ArchiMate elements are suitable for representing an API interconnection: Application Service and Application Interface. There is only one possibility for attaching the providing component (the element Application Component) to the “connector”; we have to attach:
- the Application Interface element with the Composition relationship
- the Application Service element with the Realization relationship
We have two options for attaching the consuming component, disregarding which ArchiMate element represents the “connector”; the possible ArchiMate relations are:
- Triggering
- Serving
This leads us to four options in representing API interconnections, visualized here below:
We shall not base or discussions of PROS and CONS of these options. Instead, we shall elaborate on the use of Application Interface vs Application Service and on the use of Triggering vs Serving.
Using Application Interface
PROS
- Reflects better the fact that our knowledge of the interconnection is limited to awareness of the interface.
CONS
- Application Interface has to be attached to the providing component with the Composition relation. That may appear strange; what we want to convey is that the Interface element represents the interface to a specific web service, and not to a component (which may be exposing more than one API).
Using Application Service
PROS
- Associates intuitively the connector with the provided functionality, better than Application Interface
CONS
- May cause confusion when combined with services that are not exposed by means of APIs.
Using Triggering
PROS
- Reflects better the limited knowledge of the interaction between the components. We know that the execution is being invoked (triggered!) but we do not know where the actual service is being delivered.
CONS
- Triggering may appear counterintuitive
Using Serving
PROS
- Reflects correctly that the request of the invoking application is satisfied,
CONS
- May intuitively imply that the actual service is always being delivered to the component that invokes the API.