Colleague working on his laptop

Developing REST APIs: 3 approaches

We have written before about how to define a good REST API and whether to develop your REST API yourself or use an integration framework. In this blog article we describe three key approaches to developing a REST API: from a blueprint, with the help of a framework, and from your consumer.

1. Develop from a blueprint of your API and landscape

You choose to first make a design, a blueprint, of your landscape and then develop APIs, or you choose to develop an API in small steps. The chance that your API will be uniform or reusable is very small when you develop it in a fragmented way. You shape your REST API for a single question, and in the design you do not take a next question into account. This way of developing is handy when you do not know well how REST works, because you learn by building step by step.

When you do choose to make a design first, it costs you much more time at the start. But you do get an impression of how the organization is put together and which consumers there are. Describe the interfaces at object level: how do you categorize them? By first making a blueprint, you get an overview of your concept API. We mostly prefer this, because it lets you build much more smartly.

2. Develop a REST API with a framework

Nowadays almost everything falls under the term 'framework'. You have the Spring Framework for Java, which, for example, already provides part of the documentation of your API. This Spring Framework is in turn part of an integration framework (or integration layer). The latter separates the functional part of your API from the technical part. An integration framework gives you building blocks for your API that are ready-made and tested.

You can deploy an API directly from Spring, or you can put an API gateway or integration layer in front of it. You can see the gateway as a kind of filter: what may and may not go out? That can be about, for example, making certain documentation available to external customers of your API. The integration layer offers you the advantage that a lot of functionality and standard integrations have already been developed, and it makes your API manageable right away. It is definitely advisable to use a framework to develop and implement your REST API.

3. Develop a REST API from your consumer

You build a REST API for a specific consumer: often an application or an end user. It is important to be clear about that yourself, because an API doesn't fit all. When you develop an API for an end user, you can apply caching so that information loads faster. But for an API between applications, that mechanism is not needed. Or think of authorization: an end user is often not authorized to see all information, whereas an API between applications often simply shares all data. Moreover, an application knows very specifically what it needs from the other application. An end user is often still exploring. So who your consumer is determines how you build your REST API.

E-book: The 10 principles of systems integration applied

A clear, stable and manageable infrastructure is what you want to end up with after a systems integration. You get there with a flexible integration layer, insight into the needs of your business and your data flows, and by already thinking about what has to happen after the integration. Want to read more about this? Get in touch with us.

Questions about this case?
Get in touch
Portrait of Erwin Beets

Written by
Erwin Beets