Americas

  • United States

Asia

by David Orenstein

Application Programming Interface

how-to
Jan 10, 20006 mins
Enterprise Applications

You often have to rely on others to perform functions that you may not be able or permitted to do by yourself, such as opening a bank safety deposit box. Similarly, virtually all software has to request other software to do some things for it.

To accomplish this, the asking program uses a set of standardized requests, called application programming interfaces (API), that have been defined for the program being called upon. Almost every application depends on the APIs of the underlying operating system to perform such basic functions as accessing the file system. In essence, a program’s API defines the proper way for a developer to request services from that program.

More

Computerworld QuickStudies

Developers can make requests by including calls in the code of their applications. The syntax is described in the documentation of the application being called. By providing a means for requesting program services, an API is said to grant access to or open an application.

Building an application with no APIs, says Josh Walker, an analyst at Forrester Research Inc. in Cambridge, Mass., “is basically like building a house with no doors. The API for all computing purposes is how you open the blinds and the doors and exchange information.” APIs also exist between applications.

SAP AG’s enterprise applications include APIs, called BAPI, that offer other applications access to business data. When an industry settles on a data standard, a common API allowing access to applications that process that data often follows, Walker says.

Middleware works by providing a standardized, API-like interface that can allow applications on different platforms or written in different languages to interoperate. Although APIs provide a quick and easy way to tap into an application, they can be constraining for certain power users such as independent software vendors, says Adam Braunstein, an analyst at Robert Frances Group Inc. in Westport, Conn.

Open source code exposes every instruction and operation in an application and therefore offers the most flexibility. But understanding source code can be time-consuming, and it also exposes the author’s intellectual property.

When Novell Inc. was rumored to be considering opening up the source code for its Novell Directory Services (NDS) software last year, then-Vice President Chris Stone said most corporate developers didn’t want to delve into open source code. Instead, he said, they wanted additional sets of APIs they could work with more quickly. So far, Novell has kept NDS code closed.

Corporate developers should consider including APIs in applications they develop, especially if they expect the applications to last and interact with other applications, Braunstein says. As time goes on, the likelihood that another developer will need to tap an application’s services increases. He says having the foresight to include APIs saves subsequent developers from having to find and review the source code.

APIs aren’t difficult to create, but they can be difficult to learn, says analyst Larry Perlstein at Stamford, Conn.-based Gartner Group Inc.

Application developers and vendors must constantly be thinking about whether their APIs will be understandable to future developers. “An API is useless unless you document it,” he says, yet some vendors have left APIs undocumented.

APIs as Competitive Weapons

If a company wants to frustrate developers, it might keep its APIs secret or change them rapidly. Microsoft Corp.’s many critics, including government lawyers and competitors, have accused the company of engaging in such practices. Andrew Schulman, who ferreted out several hidden APIs in Windows in his book Undocumented Windows, is now a consultant for Caldera Inc. in Orem, Utah, which has an antitrust suit pending against Microsoft. Instead of hiding APIs nowadays, Schulman says, “Windows has a kind of ‘kitchen sink’ architecture into which Microsoft can keep dumping new APIs. This API ‘churn’ is in part an attempt to keep Windows a ‘moving target’ so that it doesn’t get cloned.”

Judge Thomas Penfield Jackson cited a similar criticism in his Nov. 5 findings of fact in the Department of Justice’s case against Microsoft: “Attempting to clone the 32-bit Windows APIs is such an expensive, uncertain undertaking that it fails to present a practical option for a would-be competitor to Windows.”

But Perlstein says Microsoft competitors may be more jealous than justified in criticizing how the company handles the Windows APIs. Some “back doors” may be oversights. Microsoft spokesman Jim Cullinan adds that Microsoft is constantly improving Windows and updating and adding APIs, because to slow the pace of improvement would mean falling behind

APIs and You

Application programming interfaces (API) can seem vague, and vendors or developers might wave them around like magic wands that solve all problems. But they really can be very simple and powerful. Everyone uses something similar to APIs in daily life all the time to request access to services.

APIs offer less flexibility than open source code but more flexibility than completely closed applications.

IMAGINE YOU HAVE THREE NEIGHBORS: Closed Carl, Open Oscar and API Annie. Each of you is like an application. Like any neighbor, you sometimes need to borrow things from your neighbors, such as a lawn mower. This is the equivalent of applications integrating.

CLOSED CARL simply won’t provide you with any services. He mows his own lawn behind a high fence. Not only is there no way to ask him for anything, you can’t even walk onto his property to try because his fence has no gate. An application like Closed Carl exposes no source code or APIs. OPEN OSCAR is the opposite. He’s so open that he will let you freely enter his yard whenever you’d like and even tinker with his mower so it suits your needs exactly. Of course, once you’ve changed the design from what’s documented in the manual, you’ve entered the mower maintenance business. An application like Open Oscar has open source code, giving you free reign if you want it. API ANNIE will let you borrow the mower if you ask in the right way (by calling the “getMower” API in your own application code). You can’t enter the gate without that request, and you can’t open the mower and tinker with it. But you can get the service of mowing as needed. Applications like Annie, which are closed but have APIs, are the most common in enterprise settings.

See additional Computerworld QuickStudies