In the software industry, the design of software components or products typically begins with an assessment of customer's needs and goals combined with an analysis of any existing system into which the software will be deployed. Modeling techniques are commonly employed in conjunction with this assessment to document and formalize the incoming customer requirements into a specification of the required structural and behavioral semantics of the new software. In addition, the analysis of the existing system's semantic specification can be similarly represented using the same modeling techniques. A modeling language, such as UML defines a standard grammar that allows the software developer to document the observed semantics of the existing system in a way that is complete and verifiably consistent with the implementation but that is sufficiently abstracted that it does not require in-depth knowledge of the details of the implementation or deployment. This means that a significant amount of information about the target system (including some information about the existing solution implementations) is captured in a format that allows the developer to leverage powerful object-oriented concepts in analysis and design (such as extension of existing API artifacts) during the iterative analysis and design process for software development.
One such concept is a Model to Model Transformation. A Model to Model Transformation allows the transformation of any Source Model (containing source elements) based on any arbitrary Source meta-model to Target Models based on some equally arbitrary Target meta-model provided that a mapping is defined from the source meta-model to the target meta-model.
Existing technologies applying such transformations from an arbitrary source element to a target model must also transform all children of that source element as well as any source elements that are referenced by any element being transformed. This algorithm is recursive thus any element transformed from the source model results in the transformation of its children and references.
In products or solutions involving such Model to Model transformations, where source and target models are kept coherent at all times, there are two common problems—(1) how to enforce the semantics of the source meta-model on the target meta-model and (2) how to change the source model whenever the target model changes. To explain theses problems further, assume a source meta-model 11 and a target meta-model 13 with mappings as shown in
Further assuming that a model “S” based on Source meta-model is transformed to a target model “T” based on Target meta-model. Model S has one instance saobj of meta class SA 15 that is transformed to taobj, an instance of meta class TA 17.
Assume that the client of the target model adds a reference to an instance of TB 19 (tbobj) in taobj. Since both source model S and target model T are kept coherent at all times, this change to T should be reflected in S. So in the source model S, saobj should reflect the change done to the target model. Similarly addition of an instance of TC 21 to meta class TA 17 should be invalidated.
In the assumed target meta-model 13, meta class TC 21 and feature ‘containTac’ of meta class TA 17 do not have any mapping from source meta-model 11. Assuming, model ‘S’ based on Source meta-model 11 is transformed to a model T based on Target meta-model 13, if both models are to be kept coherent at all times, then the target meta-model 13 should never contain an instance of meta class TC 21 in feature ‘containTac’. After the transformation is complete, if some external agent tries to modify model T to add an instance of TC 21 contained in TA 17 as ‘containTac’, that modification should be invalidated, provided there is no mechanism to reflect this information in the source meta-model 11.
Existing solutions use peripheral techniques, like feature blocking at the graphical user interface (GUI) level, to achieve the coherent transformed models. These techniques to block the modification of the target model provide a limited solution around the target model, and special handling is required for models that are a result of some transformation.
In other solutions a graphical user interface (GUI) tool involved in changing the target model also changes the source model. The changes that are invalid for the source model are not allowed in the target model at the GUI layer. Some solutions provide explicit committing tools (users invoke at will) to bring source and target models in coherent state.
The present invention provides a solution to the problems of the prior art. In particular, the present invention provides:
(1) Validation of a change in a transaction. If a change is done to a model based on target meta-model and cannot be propagated to a model based on the source meta-model, the change is determined not to be a valid change and the transaction is invalidated. Invalid changes in a transaction cannot be partially committed to the model based on source meta-model. Thus invalid changes are avoided, omitted or otherwise voided in both the target and source models.
(2) Committing the change done in a transaction. If the change done to a model based on target meta-model is a valid change, then the change is transformed to a corresponding source meta-model change and committed to the source model.
(3) In the preferred embodiment, this process (validation and committing) is implemented at transaction and batch level.
The foregoing and other objects, features and advantages of the invention will be apparent from the following more particular description of preferred embodiments of the invention, as illustrated in the accompanying drawings in which like reference characters refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention.
To solve the problems described above, the present invention proposes using a Change-Set Validator 29 (
A special implementation of Change-Set Validator 29 can also be used as a transaction Committer 31, where after validating the change-set, changes are made to the source model 39, thereby bringing both models 39, 41 in sync (coherent bidirectionally). This special implementation of Change-Set Validator 29 and transaction Committer 31 is referred to herein as the Inverse Transformation Adapter 27 (
Unlike a Transformation Adapter that deals with transformation of source meta-model objects to target meta-model objects, the present invention Inverse Transformation Adapter 27 (
One advantage of using a Change-Set Validator 29 and Committer 31 of the present invention is that clients developing a GUI layer around the target model 41 do not have to worry about the origin of the target model (normal model or a model resulting from some transformation). The present invention solution provides a real time inverse transformation solution which is different from existing solutions that provide explicit committing tools to maintain source and target model coherency.
The following details a generic implementation for the above mentioned solution which can handle any source meta-model and any target meta-model. In a preferred embodiment, the Change-Set Validator 29 is implemented as a Rule which gets executed at the end of every transaction on a target model 41.
With reference to
More specifically, the Semantic Procedure implemented by the change-set Committer 31 and the rule implemented by the Change-Set Validator 29 only run on models 39, 41 that are results of some transformation. Based on the source and target model 39, 41 for the transformation, the Change-Set Validator 29 rule delegates the validation and the change-set Committer 31 semantic procedure delegates the committing of the change set 25 to a specific Inverse Transformation adapter 27.
Based on the mappings of the source and target meta-models, the specific Inverse Transformation adapter 27 validates the change set 25 and commits the target change set 25 to the source model 39 (
Thus, in the above mentioned example of
If the transformation adapter 43 generates the target model 41 based on the pattern illustrated in
In scenarios where a source model 39 is based on some source code and the target model 41 is based on some Software Modeling language (like UML), then the Inverse Transformation adapter 27 can be called a Code Provider. If the code provider cannot translate a change in UML to source code in any form, then the code provider invalidates the change done to the UML model else the code provider emits some form of code to the pertinent source file.
Client computer(s)/devices 50 and server computer(s) 60 provide processing, storage, and input/output devices executing application programs and the like. Client computer(s)/devices 50 can also be linked through communications network 70 to other computing devices, including other client devices/processes 50 and server computer(s) 60. Communications network 70 can be part of a remote access network, a global network (e.g., the Internet), a worldwide collection of computers, Local area or Wide area networks, and gateways that currently use respective protocols (TCP/IP, Bluetooth, etc.) to communicate with one another. Other electronic device/computer network architectures are suitable.
In one embodiment, the processor routines 92 and data 94 are a computer program product (generally referenced 92), including a computer readable medium (e.g., a removable storage medium such as one or more DVD-ROM's, CD-ROM's, diskettes, tapes, etc.) that provides at least a portion of the software instructions for the invention system. Computer program product 92 can be installed by any suitable software installation procedure, as is well known in the art. In another embodiment, at least a portion of the software instructions may also be downloaded over a cable, communication and/or wireless connection. In other embodiments, the invention programs are a computer program propagated signal product 107 embodied on a propagated signal on a propagation medium (e.g., a radio wave, an infrared wave, a laser wave, a sound wave, or an electrical wave propagated over a global network such as the Internet, or other network(s)). Such carrier medium or signals provide at least a portion of the software instructions for the present invention routines/program 92.
In alternate embodiments, the propagated signal is an analog carrier wave or digital signal carried on the propagated medium. For example, the propagated signal may be a digitized signal propagated over a global network (e.g., the Internet), a telecommunications network, or other network. In one embodiment, the propagated signal is a signal that is transmitted over the propagation medium over a period of time, such as the instructions for a software application sent in packets over a network over a period of milliseconds, seconds, minutes, or longer. In another embodiment, the computer readable medium of computer program product 92 is a propagation medium that the computer system 50 may receive and read, such as by receiving the propagation medium and identifying a propagated signal embodied in the propagation medium, as described above for computer program propagated signal product.
Generally speaking, the term “carrier medium” or transient carrier encompasses the foregoing transient signals, propagated signals, propagated medium, storage medium and the like.
The invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiment, the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
Furthermore, the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk—read only memory (CD-ROM), compact disk—read/write (CD-R/W) and DVD.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
While this invention has been particularly shown and described with references to preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the invention encompassed by the appended claims.
For example, the computer architecture and network configuration of
Further model to model transformations (such as those carried out by transformation adapter 43) may be carried out using various techniques. Example techniques are disclosed in U.S. patent application Ser. No. 11/170,384 assigned to the assignee of the present invention and herein incorporated by reference.