As a result of the ubiquity of computer and information technology, data is often transferred or transmitted between various computer systems (which may or may not be executing on different physical machines). This data may be in the form of messages, objects and the like. As a result of this exchange of information, it is often necessary to map between the data structures (which include objects) of a first system to the data structures of a second system.
An example of such transference or transmittal of data occurs when a client-side Java applet (or a server-side servlet) attempts to interact with a database (such as the IBM® DB2® relational database product). The applet may be issuing a request to retrieve data from, or be issuing a request to transfer data to, the database. The data which is to be retrieved or transferred will likely be stored as values associated with a data member (usually referred to as “field” in Java™) in an object which forms part of the applet/servlet. However, data stored in a relational database is stored as a field in a row and column in a table. As a result of the foregoing exemplary interaction, a mapping between the data member in the object and the records in a relational database table is required to ensure that data can be passed between the two systems.
Many products have been developed to facilitate the mapping described above. As illustrated in FIG. 1, the prior art systems 100 typically provide a graphical user interface (GUI) 112 in which the first data structure 102 and the second data structure 104 are visually rendered. The user is then prompted to visually connect (i.e., map) the elements 106 of the first data structure which are related to the elements 108 of the second data structure 104. Upon receipt of an instruction (e.g., selecting “Generate” or “OK”, not shown) the prior art systems 100 will generate a script or source code 110. The source code 110, when interpreted or compiled and executed, will implement the mapping described by the user input. These prior art mapping systems have often been designed to enable somewhat novice developers to effectively and quickly design applications which implement some business process or logic.
While the prior art systems are effective, these systems are not necessarily efficient. For instance, for large systems, there exists the need to map large numbers of elements in first data structures to large numbers of elements in other data structures. As such, under prior art systems known to the inventors, source code is individually generated (or the information is modeled individually and stored in a repository) for each of these large numbers of mappings despite the similarity between many of these mappings. Additionally, when there is a change to one of the data structures (or even to one of the elements in a data structure) then much source code needs to be regenerated.
In addition to the preceding shortcomings, prior art systems require the user to be familiar with the data structures of both systems. For example, assume that in the first data structure (an object which forms part of an Enterprise JavaBean) a data element “price” exists. In the second data structure (a relational database table) there exists two columns, “value” and “cost”. Without some additional information (i.e., an understanding of both data structures) a user would have some difficulty in providing the mapping input necessary for the proper source code generation.
Finally, present systems often pose difficulties where a second data structure is to be created from a first data structure. These difficulties often arise where there is no direct correlation between the types of elements in the two data structures. Assume, for example, that the first data structure is a Java object and the second data structure is table in a relational database. A data element in the Java object may be of “string” type. Unfortunately, in the relational database there may not exist the “string” type. However, there may be a corresponding type such as the “varchar” type. Unfortunately, without an in-depth understanding of the underlying language of the first data structure (Java, in the example) and the second data structure (SQL, in the example), providing the prior art mapping systems with the input required is very difficult for some users or developers. Unfortunately, it is often novice developers that are often without this understanding.
In a further shortcoming of the known present system, it is often the case that some of the functions used to convert are hard coded into these systems and, therefore, hidden from advanced developers.
As such, an improved mapping system and code generation which addresses, at least in part, some of the shortcomings identified above would be desired.