18.04.2013 Views

B2B Integration : A Practical Guide to Collaborative E-commerce

B2B Integration : A Practical Guide to Collaborative E-commerce

B2B Integration : A Practical Guide to Collaborative E-commerce

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Integration</strong> Patterns 11<br />

system programs. Therefore, if a program has <strong>to</strong> read some data from a<br />

file or write some data <strong>to</strong> a file, all it does is invoke a method on the 1/<br />

O API provided by the operating system and let the operating system<br />

perform the task of seeking, reading and writing from the hard disk bit<br />

by bit.<br />

Most of the packaged applications such as ERP, CRM and SCM<br />

provide APIs <strong>to</strong> interact with the underlying application and business<br />

objects. These APIs are independent of the platform and programming<br />

language. This feature gives companies flexibility in terms of integrating<br />

their already developed internal applications, irrespective of their<br />

language and platform, with the packaged software.<br />

Usually all the APIs are synchronous in nature, i.e., the function call<br />

does not return until the specified action is complete. However, if the<br />

application invoking a function call through an API does not want the<br />

client process <strong>to</strong> wait indefinitely, it can spawn a new thread process <strong>to</strong><br />

handle other tasks.<br />

Components of APIs<br />

There are several components of an application programming interface,<br />

as follows:<br />

Interfaces — Interfaces contain the signatures or definitions of the API<br />

functions. They are distributed and used by all the client programs <strong>to</strong><br />

invoke API functions. A typical function signature contained in an API<br />

will have the following information:<br />

• Name of the function or method;<br />

• Input parameters;<br />

• Return type (output); and<br />

• Any exceptions thrown by the function.<br />

Methods or Functions — The methods or functions contain the actual<br />

code that performs the tasks defined by the API and are defined and<br />

contained in the underlying programs. If there is any change in the<br />

implementation of a function, its function code has <strong>to</strong> change.<br />

Input and Output Parameters — Each API function can take multiple<br />

input parameters and may return an output. The input parameters and

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!