Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

API-driven development with OpenAPI and Swagger

Matthew Tyson | Oct. 11, 2017
Get started with API-driven development for cloud and microservices architectures

api blocks
Credit: Thinkstock

While you were getting your coffee, Java application development changed--again.

In a world driven by rapid change and innovation, it's ironic that APIs are making a comeback. Like the coding equivalent of New York City's subway system in the age of autonomous cars, APIs are old tech--ancient but indispensable. What's interesting is how this invisible, everyday IT architecture is being re-envisioned and used in current technology trends.

While APIs are everywhere, they've become especially prominent in their remote incarnation as RESTful services, which are the backbone of cloud deployments. Cloud services are public APIs, which are characterized by public-facing endpoints and published structures. Cloud-based apps are also trending toward microservices, which are independent but related deployments. All of these factors increase the prominence of APIs.

In this two-part article you'll learn how to put APIs at the heart of your design and development process, from concept to coding. Part 1 starts with an overview and introduces you to OpenAPI, also known as Swagger. We'll also start developing a simple BikeParts application, which we'll build out in Part 2.

 

What is an API?

APIs are so commonplace in software development that it's sometimes assumed that programmers simply know what they are. Rather than rely on osmosis, let's take a minute to unpack what we mean when we talk about APIs.

In general, we can say that APIs set and manage the boundaries between systems.

First, API stands for "application programming interface." An API's role is to specify how software components interact. If you're familiar with object-oriented programming, you know APIs in their incarnation as the interfaces and classes used to obtain access to underlying features of the language, or as the public face of third-party libraries and OS capabilities.

In general, we can say that APIs set and manage the boundaries between systems, as seen in Figure 1.

jw apidrivendev fig1
Matthew Tyson. Figure 1. The role of the API

So where does that leave us with API-driven development?

 

Cloud computing, microservices, and REST

API-driven development comes to the fore with the modern web API: a network-exposed API (NEA), where the boundary between systems is "over the wire." These boundaries are already central to web apps, which are the common point of contact between front-end clients and back-end servers. The cloud revolution has exponentially increased the importance of APIs.

Any programming activity that requires consuming cloud services (which are basically public APIs) and deconstructing systems into smaller, independent but related deployments (also known as microservices), relies heavily on APIs. Network-exposed APIs are simply more universal, more easily obtained, and more readily modified and extended than traditional APIs. The current architectural trend is to capitalize on these features.

 

1  2  3  4  5  6  7  Next Page 

Sign up for Computerworld eNewsletters.