The present invention relates to applications and software components and more particularly to methods and systems for calling late bound functions from an early bound application.
Binding a function call in an application entails replacing a symbolic address for the function with a real machine address. Thus, the binding determines which function (i.e. the section of code that implements the function) to execute at runtime. When binding occurs during compilation, it is “early bound.” In contrast, when binding occurs at runtime, it is “late bound.” Programming languages may generally be categorized as being either early bound or late bound.
The choice of function call binding time (i.e. early bound vs. late bound) is a trade-off between performance of the code at runtime (early binding is faster at runtime) and ease of programming for the programmer (late bound programs are easier to write). Currently, a programmer must decide what is more important: the time it takes for the programmer to write the program or the time it takes for the program to execute. Unfortunately, this is often a difficult choice to make. There is no mechanism in conventional systems to balance the trade-off effectively.
The present invention provides a method and system for integrating late bound program functions into an external program environment. The external program environment may be an early bound environment, a late bound environment, or some combination thereof.
In accordance with a first aspect of the present invention, a method is provided wherein a late bound application is integrated into an external program environment. A late bound program and a late bound environment are provided and subsequently examined to determine which late bound calls exist within the late bound program and environment that should be made available to the external environment. An interface is then generated, wherein the interface allows for the integration of the late bound function calls within the external program environment. The external environment used in practicing this invention may be a late bound environment, an early bound environment or some combination thereof.
In another aspect of the present invention a system for integrating a late bound program language into an external environment is provided, wherein the system comprises an external environment and a late bound program and program environment. The external environment can be a late bound program environment, and early bound program environment or some combination thereof. The late bound program environment contains a modular execution engine and an interface mechanism such that the interface mechanism allows for the expression of late bound semantics in an external environment compatible format.
In a further aspect of the present invention, a method for packaging executable late bound content into a re-distributable application for use with an external program environment is provided. The external environment can be a late bound program environment, an early bound program environment or some combination thereof. The method includes the steps of first examining the late bound content to determine which files in the late bound content represent a late bound application. A late bound modular execution engine is further provided, wherein the modular execution engine contains only those functions which are necessary to support the late bound application. Furthermore the modular execution engine is configured to execute only those functions which are necessary to support the late bound application.
In another aspect of the present invention, a network comprising a client and server is provided wherein the server is capable of executing a late bound program environment and an external program environment. Suitable external environments include, but are not limited to, late bound program environments, early bound program environments or some combination thereof. The client is in communication with the server through the network. An interface is generated such that the interface allows data exchange between the late bound program and program environment and the external program environment such that the late bound program application can be integrated into the external program environment.
In an alternate aspect of the present invention, a system for integrating a late bound application into an external environment is recited wherein a distribution server is utilized for providing information to a client device. Additionally, an interface mechanism is provided wherein the interface mechanism allows for the integration of the late bound function calls into the external program environment.
The illustrative embodiment of the present invention provides a mechanism for applications existing within external program environments to invoke functions which exist in late bound languages. For the purposes of illustration, the following description will be in reference to the integration of late bound functions into early bound external program environments. Alternate external environments exists, including but not limited to those containing early bound languages, late bound languages or some combination thereof. In the present example, the integration of late bound function within an early bound environment allows a programmer to choose when to make the trade-off of execution time versus ease of coding. Thus, a programmer can use early bound function calls for performance critical portions of an application and use late bound function calls for functions that are difficult to program.
The integration of late bound function calls into an early bound programming environment provides a number of benefits in addition to providing the balancing of the trade-off described above. First, the integration provides early bound programming environments with a way to take advantage of the expressive power of late binding. Second, the integration enables early bound programming environments to bind an early bound function call to a set of one or more late bound function calls. Third, it provides a way for large legacy systems to incorporate more modern programming methods, such as found with late bound function calls.
In the alternative, late bound function integration into late bound program environments offers numerous benefits not readily recognized when utilizing late bound function integration into early bound languages. For example, most late bound program languages are specialized for operation within a specific problem domain. The LISP late bound language, for example, is best suited for the symbolic processing of lists of strings. In comparison, the late bound PROLOG programming language is suitable for theorem proving and logical inference problems. The late bound MATLAB programming language, in contrast, is suitable for operation within the numerical linear algebra domain. The above late bound program languages are used solely as illustrative examples of applicable late bound program environments for use with the present invention. This list is not definitive, as one skilled in the art will readily recognize the existence of numerous alternative late bound program environments applicable to the present invention.
The present invention, when integrating a late bound function call within a late bound environment, allows a user to form a program that combines calls to multiple late bound languages such that the most suitable language is used in solving the outstanding computing problem.
The illustrative embodiment will be described for illustrative purposes relative to a MATLAB® environment. Although the illustrative embodiment will be described relative to MATLAB®-based applications, the present invention may be applied to deploy and distribute applications generated in different programming and development environments, such as but not limited to Labview from National Instruments, Inc., LISP, or PROLOG.
MATLAB® is an intuitive high performance language and technical computing environment. MATLAB® provides mathematical and graphical tools for data analysis, visualization and application development. MATLAB® integrates computation and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. MATLAB® is an interactive system whose basic data element is an array that does not require dimensioning. This allows users to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar non-interactive language, such as C and FORTRAN. MATLAB® provides application development tools including the MATLAB® Compiler. MATLAB® Builder for COM and MATLAB® Builder for Excel work in conjunction with the MATLAB® Compiler to automatically generate objects that execute in COM and Excel environments. The application development tools enable users to create and distribute MATLAB® applications and share MATLAB® work with colleagues who may use MATLAB® or other environments.
It should be noted that the electronic device 100 is merely representative of a structure for implementing the present invention. However, one of ordinary skill in the art will appreciate that the present invention is not limited to implementation on only the described device 100. Other implementations can be utilized, including an implementation based partially or entirely in embedded code, where no user inputs or display devices are necessary. Rather, a processor can communicate directly with another processor or other device.
One of the advantages of using late bound function calls, when programming within an object-oriented environment, is that it enables the developer to write code that does not have to be specific about the exact object types of objects that are manipulated. In other words, the late bound function calls can support polymorphism.
Using the interface mechanism 210 of the present invention, during compile time, when an early bound compiler encounters a late bound function that exists in a late bound environment, the compiler in the early bound environment, using the interface mechanism 210, allows for runtime execution of the late bound function that exists in the late bound environment. The interface mechanism 210 serves as a kind of proxy for a set of late bound functions, one of which (depending on the types of the inputs at runtime) will be invoked at runtime.
Furthermore, for illustrative purposes the interface mechanism is illustrated as associated with the network 200, but one skilled in the art will readily recognize that the interface mechanism 210 can be additionally associated with the client device 202, the server 204 or some combination thereof. One skilled in the art will further recognize that the presented network embodiment is solely an exemplary sample and the functionality may be divided up in any number of ways over a network. For example, a plurality of clients may be associated with the server, a single client may be associated with several servers, or some combination thereof.
In the illustrative case, when the late bound functions are MATLAB® functions, the MATLAB® compiler generates late bound interface functions 304 and 306 that are early bound functions that reside within the early bound environment 300. The names and implementations of these interface functions 304 and 306 are completely determined at compile time. At runtime, these interface functions 304 and 306 invoke late bound functions. Specifically, late bound interface function 304 invokes a set of one or more late bound functions 308 via a modular late bound execution engine 302 (described in more detail below). Similarly, late bound interface function 306 invokes a set of one or more late bound functions 310 via the modular late bound execution engine 302. Hence, a mechanism is provided by which an early bound environment 300 can delay function binding until runtime for selected functions.
As can be seen in
The interface mechanism, in one embodiment, can be realized through an Application Program Interface (API) having functions that may be called from the early bound application. The API can be used to initiate a call to a function in the late bound environment. For example, an API running in a C program environment can call functions in a MATLAB® late bound environment. In the alternative, the API can be a standalone executable program that does not require a secondary program to operate. From the perspective of an application running in the early bound C language, for example, the function called in the late bound MATLAB® application appears to be a traditional function call, where the function and its arguments are understood and the outputs are passed in a similar manner as any existing function.
The interface mechanism, while described as an API by example, is not limited to use with an API, and in the alternative may be a software or hardware component running in the early or late bound environment. The interface mechanism is capable of automatically expressing the semantics of the late bound programming environment in a format readily recognized by the early bound programming environment at runtime and as set forth prior may take the appropriate form for expressing said semantics.
The modular late bound execution engine 302 provides a mechanism for executing functions that exists in a late bound environment. As these are late bound functions, they are bound at runtime in the late bound environment. In situations where the late bound environment is a MATLAB® environment, the modular late bound execution engine may be a MATLAB® component runtime engine. The MATLAB® component runtime engine is a stand-alone set of shared libraries that enables execution of M-files, MEX-files and other types of MATLAB executable content. With the MATLAB® component runtime engine as a modular execution engine, there is no need to open the MATLAB® computation runtime engine in a new window visible to the user when executing a function in the late bound environment; rather the component runtime engine can execute in the background in a manner that is not visible to the user.
The present invention is not limited to solely a MATLAB® application and MATLAB® component runtime engine, and may be practiced with numerous substitute late bound environments and execution engines.
The modular late bound execution engine 302 is such that following the execution of a late bound interface function call 304 or 306 in the early bound environment 300, the modular late bound execution engine 302 can either remain running or can be terminated. Allowing the modular late bound execution engine 302 to remain running allows for subsequent function execution in the late bound environment for calls from within the early bound environment 300 to occur more quickly, and it is no longer necessary to initiate the module late bound execution engine 302. In the alternative, terminating the modular late bound execution engine 302 after executing late bound functions, controlled from within the early bound environment 300, decreases processor demand and resource allocation, and the resources associated with the modular late bound execution engine 302 are free upon termination of the modular execution engine 300. (THAT EXISTS)
An example is helpful to illustrate operation of the illustrative embodiment. The example is a MATLAB® function from within a late bound program environment (e.g. MATLAB®) that is used to add 10 to any input number. The function is named plus10 and is defined as follows:
Set forth below are the source files for a C function library automatically generated by the MATLAB® Compiler from the M file plus10.m that contains the function plus10. The first file listed below is a header file libplus.h. This header file is followed below by the file libplus.c. The function mlfPlus10 an example of an interface function that a C program calls to access the MATLAB® functionality provided by the plus10 function.
Here is the header file:
Here is the libplus.c file:
The calling of the aforementioned interface function mlxPlus10 from within an early bound programming environment, such as C, is illustrated in the following code.
The aforementioned code is written for use in the C programming language, but one skilled in the art will readily recognize that numerous alternative early bound environments exist for practicing the present invention.
As evidenced by the method for calling the late bound function set forth above, the process is both streamlined and simultaneously provides a suitable mechanism for integration of a late bound function into an early bound environment with minimal user interaction. The calling of the original late bound function (plus10.m) appears as the calling of any other ordinary function from within the early bound environment. Furthermore the early bound environment continues to process early bound functions as usual, thereby offering increased function execution speed.
The output of the dependency analyzer is the final list of late bound functions that comprise the application. These functions are used by the compiler in conjunction with user defined data, such as input data and switches, to determine which interface functions should be generated, as well as the form of these generated functions.
The generated early bound interface functions 408 (
At runtime the final user application or component 414 calls the data type creation API 418 to create data which is late bound environment compatible from data which is contained within the external environment. In the present embodiment the external environment is an early bound programming environment. The data type creation API 418 then identifies this newly created data to the final user application or component 414. The identifying of this data may occur using a “handle” or a “proxy”, as understood by one skilled in the art.
The final user application or component 414 then invokes an early bound interface function 408 which in turn calls the modular late bound execution engine 420. Compatible data created from the external environment data, as well as the name of the early bound interface function 408, is then passed to a modular execution engine 420 such that the modular execution engine can combine both the data and the function name (i.e. late binding) to choose the appropriate function from the set contained in the CTF archive 410. The result of the modular late bound execution engine 420 is then returned to the final user application or component 414.
The illustrative embodiment of the present invention provides data types that enable the late bound functions to be called from the early environment. These data types allow the early language to represent the types of data present in the late bound language. These data types may be part of an interface library that is provided to the user.
Further associated with each invocation of the compiler 406 may be an encryption/decryption schema. In one embodiment, upon invocation of the compiler a unique encryption/decryption key is generated. This key may be secured using available public key encryption means such as the Advanced Encryption Standard (AES) as used by the United States government. One skilled in the art will readily recognize that numerous alternate encryption/decryption means exist which are readily available for use with the present invention. At runtime, the unique key is decrypted and used in decrypting the required files in the CTF archive. In one embodiment, decryption of files only occurs as the file is needed, thereby preventing the storage of decrypted information on disk.
The use of an encryption/decryption scheme such as this provides for the protection of the code developed by those building applications. As the files used in the CTF archive are encrypted, they may be shared or distributed while simultaneously protecting that which is contained within them. For example, a file containing company trade secrets can be distributed in an encrypted manner such that this trade secret is not revealed to a user. Additionally as the files used in the application are encrypted, an end user cannot readily modify the files such that program execution is affected. Furthermore, as files are encrypted and decrypted based upon a unique key generated by the compiler, files used in one application cannot be used in another application. Finally, the tracing of pirated software can be accomplished using the present encryption/decryption mechanisms as each generated application can be analyzed to determine which compiler license key generated the application. Thus, once the compiler license key is known, it is possible to cross reference that license key to a list of licensees to determine the source of the pirated software.
In the illustrative case, when the late bound functions are MATLAB® functions, the MATLAB® compiler generates late bound interface functions 604 and 606 that are late bound functions that reside within the late bound environment 600. At runtime, these interface functions 604 and 606 are utilized in invoking late bound functions using a modular late bound execution engine 602. As additionally illustrated in
In one embodiment the interface mechanism can be an Application Program Interface (API) having functions that may be called from the late bound application. In the alternative, the API can be a standalone executable program that does not require a secondary program to operate. Additionally, the interface function can be a software or hardware component.
The modular late bound execution engine 602 provides a mechanism for executing functions at runtime, where the functions exist in a late bound environment. In a MATLAB® environment, the modular late bound execution engine may be a MATLAB® component runtime engine capable of execution of M-files, MEX-files and other MATLAB® executable content. The present invention is not limited to solely a MATLAB® application and MATLAB® component runtime engine, and may be practiced with numerous substitute late bound environments and execution engines.
The modular late bound execution engine 602 is such that following the execution of a late bound interface function call 604 or 606 in the late bound environment 600, the modular late bound execution engine 602 can either remain running, such that subsequent function execution in the late bound environment can readily occur, or it can be terminated.
The present invention has been described by way of example, and modifications and variations of the described embodiments will suggest themselves to skilled artisans in this field without departing from the spirit of the invention. Aspects and characteristics of the above-described embodiments may be used in combination. The described embodiments are merely illustrative and should not be considered restrictive in any way. The scope of the invention is to be measured by the appended claims, rather than the preceding description, and all variations and equivalents that fall within the range of the claims are intended to be embraced therein.
This Application is continuation of U.S. patent application Ser. No. 11/144,411, which was filed on Jun. 2, 2005, which will issue on Oct. 25, 2011, as U.S. Pat. No. 8,046,777. The above-identified application is hereby incorporated by reference in its entirety as though fully set forth herein.
Number | Name | Date | Kind |
---|---|---|---|
5381547 | Flug et al. | Jan 1995 | A |
5812855 | Hiranandani et al. | Sep 1998 | A |
5828843 | Grimm et al. | Oct 1998 | A |
6026238 | Bond et al. | Feb 2000 | A |
6041179 | Bacon et al. | Mar 2000 | A |
6247175 | Ledford et al. | Jun 2001 | B1 |
6366958 | Ainsworth et al. | Apr 2002 | B1 |
6401099 | Koppolu et al. | Jun 2002 | B1 |
6415434 | Kind | Jul 2002 | B1 |
6442752 | Jennings et al. | Aug 2002 | B1 |
6799320 | Elvanoglu et al. | Sep 2004 | B1 |
6901595 | Mukundan et al. | May 2005 | B2 |
7000238 | Nadler et al. | Feb 2006 | B2 |
7100153 | Ringseth et al. | Aug 2006 | B1 |
7171311 | Dai et al. | Jan 2007 | B2 |
7324972 | Oliver et al. | Jan 2008 | B1 |
7370075 | Farquharson et al. | May 2008 | B2 |
7373406 | Jones et al. | May 2008 | B2 |
20010037417 | Meyer | Nov 2001 | A1 |
20020078255 | Narayan | Jun 2002 | A1 |
20030233385 | Srinivasa et al. | Dec 2003 | A1 |
20040019883 | Banerjee et al. | Jan 2004 | A1 |
Number | Date | Country |
---|---|---|
6-103075 | Apr 1994 | JP |
Entry |
---|
Ajay Bakre, M-RPC: A Remote Procedure Call Service for Mobile Clients, 1995. |
Cox, B.J. et al., “Object-Oriented Programming: An Evolutionary Approach,” 2nd Edition, shinkigensha Co., Ltd. p. 17 (2004). |
McGraw-Hill Dictionary of Scientific and Technical Terms, “early binding,” 3rd Edition, Nikkan Kogyo Shimbun Ltd., p. 826 (1997). |
Nink, Udo et al., “Database Application Programming with Versioned Complex Objects,” Informatik aktuell: Datenbanksysteme in Buro, Technik and Wissenschaft, 20 pages (1997). |
Setiawan, Agus et al., “GridCrypt: High Performance Symmetric Key Cryptography Using Enterprise Grids,” Proceedings of the 5th International Conference on Parallel and Distributed Computing, Applications and Technologies (2004). |
European Search Report for Application No. 06772051.6-221, 5 pages, dated Feb. 28, 2008. |
International Preliminary Report on Patentability for Application No. PCT/US2006/021591, 8 pages, dated Dec. 6, 2007. |
Japanese Office Action for Application No. 2008-514937, 15 pages, dated Mar. 6, 2012. |
Kuhn, D. Richard, “A Source Code Analyzer for Maintenance,” Proceedings, Conference on Software Maintenance—1987, pp. 176-180 (1987). |
International Search Report for Application No. PCT/US2006/021591, 5 pages, dated Jan. 2, 2007. |
Chinese Office Action for Application No. 201010503801.1, 11 pages, dated Feb. 28, 2013. |
Number | Date | Country | |
---|---|---|---|
20120036519 A1 | Feb 2012 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 11144411 | Jun 2005 | US |
Child | 13277844 | US |