1. Field of the Invention
The present invention relates to an architecture for enabling business components to access middleware APIs in a runtime environment.
2. Description of the Related Art
Software developers often want to integrate business applications with various business services, such as web services, legacy applications, databases, Enterprise Information Systems (EIS), etc. One solution is the J2EE Connector Architecture, part of Java 2 Platform, Enterprise Edition (J2EE) 1.3, that specifies a standard architecture for accessing resources in diverse Enterprise Information Systems (EIS). The J2EE platform provides a reusable component model, using Enterprise JavaBeans and JavaServer Pages technologies to build and deploy multi-tier applications-that are platform and vendor-independent. (Java, J2EE, Enterprise JavaBeans, and JavaServer Pages are trademarks of Sun Microsystems, Inc.).
An Enterprise Java Bean (EJB) is a collection of Java classes, following defined rules and providing specific call-back methods, and an XML file, combined into one single unit. Session beans model business services and expose EJB remote interfaces, which a client will use to invoke the services.
Oftentimes the developer of the business components or applications may not have detailed knowledge of the many application programming interfaces (APIs) needed to access the middleware layer components, including components such as database access components, messaging components, web service components, EJB, etc. Nonetheless, the developers of the business applications will have to spend considerable amounts of time to determine how to properly invoke the middleware layer from the business applications, which can be complex and technical.
Provided is an architecture for enabling business components to access middleware APIs in a runtime environment. A business container hosts business components and services to enable communication between the business components. A plurality of infrastructure components expose interfaces and methods to the business components, wherein the exposed interfaces and methods have names descriptive of a business domain for which the business applications are written. The infrastructure components implementation of the interfaces and methods exposed to the business components include calls to the middleware application programming interfaces (APIs) to invoke middleware APIs to cause middleware operations.
In the following description, reference is made to the accompanying drawings which form a part hereof and which illustrate several embodiments of the present invention. It is understood that other embodiments may be utilized and structural and operational changes may be made without departing from the scope of the present invention.
A plurality of infrastructure, components 14a, 14b . . . 14n each include one or more implementations 16a, 16b . . . 16n, where each implementation 16a, 16b . . . 16n includes calls to application programming interfaces (APIs) 18a, 18b . . . 18n that are implemented in the middleware layer 22. The infrastructure components 14a, 14b . . . 14n may expose interfaces to the business components 10a, 10b . . . 10n that provide methods used to access the infrastructure component implementations 16a, 16b . . . 16n. The implementations 16a, 16b . . . 16n that may be invoked by the business components 10a, 10b . . . 10n include application programming interfaces (APIs) 18a, 18b . . . 18n to call the middleware APIs 20a, 20b, 20c, 20d, and 20e in a middleware layer 22. The middleware APIs may include: database access APIs 20a to provide access to a database; messaging APIs 20b, such as a Java Message Service (JMS), that allows communication with other entities; Enterprise Information System (EIS) APIs 20c that interface with EIS software and includes enterprise infrastructure systems such as enterprise resource planning (ERP), mainframe transaction processing, database systems, and other legacy information systems; web service APIs 20d providing access to services over the internet; and Enterprise JavaBeans (EJB) access APIs 20e. These APIs 20a, 20b, 20c, 20d, and 20e may be in their own containers. The variable “n” indicates an integer number of instances of an element, and may take different values when used with different elements, such that 10n, 14n, 16n, and 18n may indicate a same or different number of instances of the business components, infrastructure components, implementations, and calls to APIs, respectively.
In one embodiment, the business container 8 provides a runtime environment for the business components 10a, 10b . . . 10n that operates within the general runtime environment 6. The business components 10a, 10b . . . 10n include methods and themselves expose interfaces and methods to each other that have names, i.e., declarations descriptive of a business domain to which the business components are directed, such as financial services, retail operations, industrial operations, etc. The infrastructure components 14a, 14b . . . 14n expose interfaces and methods to the business components 10a, 10b . . . 10n that have names and declarations descriptive of the business domain of the business components 10a, 10b . . . 10n that invoke the implementations 16a, 16b . . . 16n of the infrastructure components 14a, 14b . . . 14n. The implementations 16a, 16b . . . 16n of the infrastructure components 14a, 14b . . . 14n include calls to middleware APIs 18a, 18b . . . 18n to invoke the middleware APIs 20a, 20b . . . 20e on behalf of the business components 10a, 10b . . . 10n. The middleware APIs 20a, 20b . . . 20e may be included in middleware containers. In this way, those developing and coding the business components 10a, 10b . . . 10n may use methods and interfaces having names and declarations descriptive of the business domain in which they are operating to access the middleware components 20a, 20b . . . 20n through the infrastructure components 14a, 14b . . . 14n.
The developers of the business components 10a, 10b . . . 10n need no knowledge of the APIs of the middleware components 20a, 20b . . . 20e, which may be technical and complex, and need only focus on the business domain in which they are operating. For instance, to access data, such as a stock quote, the infrastructure component 14a, 14b . . . 14n may expose an interface having a name descriptive of the business domain, e.g., getStockQuote( ). However, the calls to the APIs. 18a, 18b . . . 18n in the implementations 16a, 16b. . . . 16n may invoke the specific technical APIs to access a database 20a or web service 20d to obtain the requested data. The developer of the business components 10a, 10b . . . 10n does not need to be concerned with how the requested data is obtained, e.g., a database access 20a, web service 20c, etc., but only needs to use the interface whose name is descriptive of the operation as understood in the business domain, e.g., getStockQuote( ). The developers of the infrastructure components 14a, 14b . . . 14n have knowledge of how the middleware APIs 20a, 20b . . . 20e may be used and invoked to provide the access of the middleware layer 22 on behalf of the business components 10a, 10b . . . 10n.
Moreover, the business components 10a, 10b . . . 10n may only call methods implemented in the business application container 8 and may not include any calls to services available in the runtime environment 6 outside the business application container 8. In this way, the business component developer only needs knowledge of the interfaces descriptive of the business domain and not the technical details of the runtime environment 6, such as the middleware APIs 20a, 20b . . . 20e, which may be complex and require detailed knowledge of the different middleware components, such as J2EE and EJB, as well as the database and web service APIs.
Business level developers develop and code (at block 102) business components 10a, 10b . . . 10n to run in the business application container 8 and include calls to the exposed interfaces, descriptive of the business domain, of the infrastructure components 14a, 14b . . . 14n to access data (or access services of middleware outside of the business container 10). The business components 10a, 10b . . . 10n may only include calls to services within the business container 8 and interfaces exposed by the infrastructure components 10a, 10b . . . 10n. The developed infrastructure components 14a, 14b . . . 14n and business application container 8 including business components 10a, 10b . . . 10n are deployed into the runtime environment 8.
In certain situations, the developer may want to change the middleware API 20a, 20b . . . 20e used to perform operations. For instance, the developer may want a business component 10a, 10b . . . 10n to access data from the web service API 20d instead of the database access API 20a. At block 150, the developer may decide to use different middleware APIs 20a, 20b . . . 20e to access data requested by the business components 10a, 10b . . . 10n. To accomplish this, those working on the infrastructure components 14a, 14b . . . 14n, may code (at block 152) infrastructure components 14a, 14b . . . 14n to maintain the same named interfaces exposed to the business components 10a, 10b . . . 10n, descriptive of the business domain, but create new infrastructure components 14a, 14b . . . 14n or modify the existing infrastructure components 14a, 14b . . . 14n to include calls to the new middleware APIs that will be used to access the data (or access middleware APIs outside of the business application container 8). The newly coded or modified infrastructure components 14a, 14b . . . 14n may then be deployed (at block 154) in the runtime environment 6 to be available to calls from the business components 10a, 10b . . . 10n and to invoke the new (second) set of middleware APIs 20a, 20b . . . 20n to perform operations previously performed by a previous (first set) of middleware APIs 20a, 20b . . . 20e, such as access data or perform other middleware operations.
The described embodiments thus provide a way to separate the types of operations and calls into different layers, such as a business layer and infrastructure layer, so that developers of the business components need not be concerned with the details of how the calls, which are descriptive of the business domain, to the infrastructure components to obtain data are implemented.
The described operations may be implemented as a method, apparatus or article of manufacture using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof. The term “article of manufacture” as used herein refers to code or logic implemented in hardware logic (e.g., an integrated circuit chip, Programmable Gate Array (PGA), Application Specific Integrated Circuit (ASIC), etc.) or a computer readable medium, such as magnetic storage medium (e.g., hard disk drives, floppy disks,, tape, etc.), optical storage (CD-ROMs, optical disks, etc.), volatile and non-volatile memory devices (e.g., EEPROMs, ROMs, PROMs, RAMs, DRAMs, SRAMs, firmware, programmable logic, etc.). Code in the computer readable medium is accessed and executed by a processor. The code in which preferred embodiments are implemented may further be accessible through a transmission media or from a file server over a network. In such cases, the article of manufacture in which the code is implemented may comprise a transmission media, such as a network transmission line, wireless transmission media, signals propagating through space, radio waves, infrared signals, etc. Thus, the “article of manufacture” may comprise the medium in which the code is embodied. Additionally, the “article of manufacture” may comprise a combination of hardware and software components in which the code is embodied, processed, and executed. Of course, those skilled in the art will recognize that many modifications may be made to this configuration without departing from the scope of the present invention, and that the article of manufacture may comprise any information bearing medium known in the art.
The illustrated operations of
The foregoing description of various embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto. The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. Since many embodiments of the invention can be made without departing from the spirit and scope of the invention, the invention resides in the claims hereinafter appended.