Thursday, October 22, 2020

1.2 Rise of APIs in Software Design

 Software development is a broad field, and there are many different types of software that you encounter daily. Compare the firmware running on the car you drive with the mobile banking applications you use on your mobile phone—each serves a specific purpose. Similarly, the development process for each type of software has its own specifics. Mobile application development is nothing like embedded programming. Yet, you can still identify some similarities across many areas.

In the software development industry, you can observe these trends:

  • Web applications: Replacing traditional desktop (fat) clients, such as Microsoft Office 365

  • Proliferation of mobile applications: Often providing an alternative, seamless access to web applications

  • Integration with social media: To apply existing functionalities of social platforms

  • Cloud services: For data sharing and processing

  • Free software and libraries: To save cost in applications and services rather than implementing everything from scratch

APIs separate functionality into building blocks. Web applications, for example, rely on web servers to store data but use a web browser for presenting it. Single-page applications (SPAs) are modern web applications, which dynamically load data on demand into a single web page. This approach requires communication with the web server. Likewise, use of cloud services, software libraries, and social media require some form of communication, either to the server hosting the service or to the library code that you want to use. The details of communication are specified by the application programming interface (API).

With software trends, the use of APIs is also spreading. One of the reasons more and more developers are relying on APIs is the fact that they allow faster prototyping and development of software. APIs allow you to simply use an existing service or library to create a working prototype or the final program, without having to implement the functionality yourself.

APIs enable communication between computer systems or programs by specifying the details of how the information is exchanged, thereby facilitating code and functionality reuse.



This benefit is the reason so many developer-focused cloud services exist today. Not only is the functionality already implemented, they also take care of maintaining the service for you. The increasing number of applications are really integrations of existing cloud services in interesting new ways. Such cloud services were designed to be used as part of some other application. Applications can also reuse functionality of existing standalone systems if they provide an API. This capability is most useful for implementing custom applications and automating various tasks, such as notifying users via the Cisco Webex Teams messaging application or publishing information on a web dashboard. APIs are often used to streamline the development process as well. Examples include building with automated processes, bug tracking, testing, and more.

Using APIs

An increasing number of systems that expose functionality through APIs has enabled building more complex solutions and driving automation and integration unlike anything seen in the past. Therefore, consuming and building APIs has become a foundational skill for most professional software developers.

To use APIs effectively, keep in mind these considerations:

  • Modular software design

  • Prototyping and testing API integration

  • Challenges in consuming networked APIs

  • Distributed computing patterns

Prototyping and testing API actions allows you to quickly verify the feasibility of a chosen design, determine if the design meets stakeholder needs, and ensure that integration keeps working over time, especially across version upgrades. Many APIs rely on the network for communication, so it is also important that you understand the kinds of challenges an unreliable network presents and how to address them.

APIs also make more complex software architectures possible. However, to tackle the additional complexity, you must become familiar with modular software design, which will make the software you write maintainable and testable. This design familiarity holds true for either a single program code base or across distributed systems. Distributed systems in particular present many trade-offs, and adhering to best practices for their implementation will save you many headaches in the end.

One example of a distributed system that is of interest to developers and DevOps engineers is infrastructure automation workflow. It reduces management overhead by provisioning servers and networks in an automated way, either for a specific application or for shared infrastructure. It is commonly used as part of the application build process, such as in continuous integration and continuous deployment (CI/CD) pipelines.



The main purpose of APIs is to expose functionality, so documentation is at least as important as implementation.

Developers rely on API documentation to provide information such as:

  • Which functions or endpoints to call

  • Which data to provide as parameters or expect as output

  • How to encode protocol messages and data objects

The first two are inevitably bound to each individual API, and you will have to consult the API documentation for your particular use case. However, many networked APIs have settled on a common, standardized set of encodings and data formats.

No comments:

Post a Comment