A database can be configured to store data records as well as one or more types of files. A relational database typically includes one or more tables with one or more columns and rows of data. The information in the data tables can be related to information in other tables through one-to-one, one-to-many, and many-to-many relationships. Databases are often interfaced to database servers to allow access by multiple users via a network.
Database content is typically accessed via an application program on a client computer. In the past, if a database architecture was added or modified, the application and server programs would have to be modified to work with the new or modified database. In highly distributed systems with multiple client computers, several weeks were often required to implement the change due to the existence of many different applications for the same database, as well as to distribute the changes throughout an organization.
In accordance with an embodiment of the present invention, a computer system includes a computer processor and logic instructions for rapid integration of data storage subsystems. An adapter factory is instantiated in response to a request from a client computer. The adapter factory is configured to provide a generic persistent data storage (Pds) adapter interface to the client computer. The Pds adapter interface interfaces to a specific adapter. The Pds adapter interface is configured to invoke corresponding data source operations in the specific adapter. A generic Pds data source interface is configured between the specific adapter and a specific data source.
Embodiments of the invention relating to both structure and method of operation may best be understood by referring to the following description and accompanying drawings:
In order to allow rapid integration of new or modified databases, generic persistent data storage (PDS) adapter and data source interfaces are provided that interface with one or more adapters that are specific to a corresponding data source. The PDS adapter does not require the client application to have any knowledge of the underlying structure of the data source. Accordingly, the data source may be modified and new data sources may be added without requiring a change to the client application. Such features alleviate the time-consuming and expensive process of modifying client applications to interface with new data source architectures, and distributing the changes to all users of the changed/updated data source.
Referring to
Client computer 102 is configured with one or more application programs that add, delete, modify, and/or query information in the database 106. Other suitable operations can be implemented, such as listing database elements by primary keys or foreign keys, and counting database elements by a key, where a primary key uniquely identifies a row in a table and a foreign key identifies a column or a set of columns in one table that refers to a column or set of columns in another table.
Server 104 can be configured with different levels of application programming interfaces (APIs) and factories (also referred to managers). In the embodiment shown, server 104 includes a (Persistent Data Storage) PdsAdapterFactory, PdsAdapterAPI, DataAdapters, PdsContextManager, InitialContext, PdsDataSource API, and one or more DataSources. In some embodiments server 104 is an application server, for example, a J2EE application server, commercially available from a number of vendors such as the WebLogic Server by BEA, Inc., JBoss from Red Hat, Inc., WebSphere from IBM Corporation, JRun by Adobe Corporation, and Oracle OC4J by Oracle Corporation. Software components in client computer 102 and server 104 can be configured to run in a Java Virtual Machine (JVM) or other suitable platform. A JVM is a virtual machine that interprets and executes Java bytecode that is generated by Java language compilers or compilers of other languages that target the JVM and adhere to the JVM standard published by Sun Microsystems, Inc.
System 100 can be configured to accommodate persistent data storage, which makes the state of an application available between instances of a process. The application program in client computer 102 can be configured to invoke persistent data storage (Pds) AdapterFactory to instantiate a PdsAdapter Factory on server 104. The PdsAdapterFactory creates a PdsAdapter API and a specific data adapter, and returns the PdsAdapter API class to the application program on the client computer 102. The PdsAdapter API provides a generic interface to any of the specific data adapters, such as a Java Database Connectivity (JDBC) adapter or other suitable adapter. The PdsDataSource API provides a generic interface to any specific data sources, such as a JDBC DataSource. By using the generic PdsAdapter and PdsDataSource APIs, changes to the underlying architecture of the database are transparent to the user and to the majority of other components in system 100. For example, the database being used by a client application may be switched from one type to another by pointing to another datasource in a configuration file at runtime. No changes are required to the client application, the PdsAdapterFactory, the PdsAdapter API, the PdsContextManager, or the PdsDataSource API. System 100 thus provides the ability to rapidly transition to new database architectures.
A generic PdsDataSource API class 214 is returned to the SpecificDataAdapter 208. The SpecificDataAdapter 208 also uses a PdsContextManager 210 to locate a generic data source interface (shown as PdsDataSource API 214). The PdsDataSource API 214 provides a generic interface to a Specific DataSource 216. PdsContextManager 210 can use any suitable facility for locating components, such as Java Naming and Directory Interface (JNDI), denoted by InitialContext 212. The PdsContextManager 210 can also create a SpecificDataSource 216 according to a standard format, such as the JDBC standard. The SpecificDataSource 216 interfaces with a third party DataSource connector 218, which interfaces with a database to process command statements and return results to the client application via the Specific DataSource 216.
The PdsAdapterFactory 302 is instantiated in response to a request from a client computer, and configured to provide a generic persistent data storage PdsAdapter interface 306 to the client computer. A configuration file 304 is accessed by the PdsAdapterFactory 302 to determine the type of database that will be accessed by the application program on the client computer.
The PdsAdapter interface 306 interfaces to one or more specific adapters, such as the JdbcAdapter 308 as well as other suitable data adapters 310. The PdsAdapter interface 306 is configured to invoke corresponding data source operations in the specific adapters 308, 310.
Server 104 further includes one or more specific data sources, shown as JdbcDataSource 318 and other DataSources 320. A generic PdsData Source interface 316 is configured between the specific adapters 308, 310 and the specific data sources 318, 320. The specific data sources 318, 320 translate commands from the generic PdsData Source interface 316 to perform functions specific to data sources 318, 320. For example, the JdbcDataSource 318 uses the standard class java.sql.DataSource to perform specific JDBC functions.
Context manager 312 is configured to locate the specific data sources 318, 320 using a name and directory interface service, such as the JNDI that is included in a Java Virtual Machine (JVM). The location and name of the specific data sources 318, 320 can be registered in the JNDI to allow remote instantiation of the specific adapter from the PdsAdapter interface 306. Thus, even though there may be several specific adapters 308, 310 available, the configuration file 304 enables the PdsAdapterFactory 302 to provide the correct specific adapter from among a plurality of specific adapters 308, 310. Likewise, the PdsContextManager 312 provides a name for the specific DataSource 318, 320 that corresponds to the data adapter 308, 310 to be used from among the plurality of specific data sources.
Various types of databases, data, and files can be accessed by the specific DataSources 319, 320, such as XML files, data tables, common flat files, and NonStop Kernel (NSK) files. In-memory storage can also be accessed without the use PdsContextManager 312 or datasources 318, 320, 322, 324. System 100 is flexible enough to allow a client application to utilize in-memory storage as well as datasources 322, 324 provided by third parties. Note that only the PdsAdapter API 306 and a specific data adapter 308, 310 are required when in-memory storage is used since there is no need to access a database through datasources 318, 320, 322, 324.
Referring to
Process 404 includes instantiating a persistent adapter factory in response to a request from a client computer. In process 406, the adapter factory creates a generic persistent adapter. The adapter factory gets the name and location of a specific adapter to be used based on a configuration file in process 408. The name and location of the specific adapter is supplied to the client application in process 410.
The generic persistent adapter receives commands/requests from the client application and translates the commands/requests to a format required by the specific adapter. The specific adapters are configured to interface with a corresponding specific data source. Process 412 invokes a context manager to determine the name and location of a generic persistent datasource. The persistent datasource is independent of the type of database being used. Accordingly, changes can be made to the underlying database without affecting other components of the application server or the client application.
Process 414 includes using the generic persistent datasource to interface with a specific datasource. The generic persistent datasource provides a level of abstraction for the specific datasource. The client application thus does not need to be customized to interface with a specific adapter and datasource, but rather is able to use generic interfaces to any specific type of adapter and datasource.
Referring now to
Referring to
The various functions, processes, methods, and operations performed or executed by system 100 can be implemented as programs that are executable on various types of computer processors, controllers, central processing units, microprocessors, digital signal processors, state machines, programmable logic arrays, and the like. The programs can be stored on any computer-readable medium for use by or in connection with any computer-related system or method. A computer-readable medium is an electronic, magnetic, optical, or other physical device or means that can contain or store a computer program for use by or in connection with a computer-related system, method, process, or procedure. Programs can be embodied in a computer-readable medium for use by or in connection with an instruction execution system, device, component, element, or apparatus, such as a system based on a computer or processor, or other system that can fetch instructions from an instruction memory or storage of any appropriate type. A computer-readable medium can be any structure, device, component, product, or other means that can store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The illustrative block diagrams and flow charts depict process steps or blocks that may represent modules, segments, or portions of code that include one or more executable instructions for implementing specific logical functions or steps in the process. Although the particular examples illustrate specific process steps or acts, many alternative implementations are possible and commonly made by simple design choice. Acts and steps may be executed in different order from the specific description herein, based on considerations of function, purpose, conformance to standard, legacy structure, and the like.
While the present disclosure describes various embodiments, these embodiments are to be understood as illustrative and do not limit the claim scope. Many variations, modifications, additions and improvements of the described embodiments are possible. For example, those having ordinary skill in the art will readily implement the steps necessary to provide the structures and methods disclosed herein, and will understand that the process parameters, materials, and dimensions are given by way of example only. The parameters, materials, and dimensions can be varied to achieve the desired structure as well as modifications, which are within the scope of the claims. Variations and modifications of the embodiments disclosed herein may also be made while remaining within the scope of the following claims. For example, a few specific examples of dialogs and data models are described. The illustrative system for declarative association of dialog fields can be used with any suitable dialogs or data models. The illustrative techniques may be used with any suitable data processing configuration and with any suitable servers, computers, and devices. In the claims, unless otherwise indicated the article “a” is to refer to “one or more than one”.