1. Technical Field
The present invention relates generally to the field of integrated software development environments, and in particular to facilitating source code editor anticipation of remote object syntax.
2. Description of the Related Art
Over time computer programs and the software programming languages utilized to develop them have become more complex. Computer programs are typically composed of many different source code files and programming libraries. These libraries include system libraries, networking libraries and utility libraries comprising many different functions or methods. In addition, object oriented languages employ function overloading in which multiple functions or methods within a class hierarchy share the same identifier name, but have differing numbers of parameters or differing parameter types. Because of the proliferation of libraries and classes, the number of functions available to a software developer has steadily risen. This makes it very difficult if not impossible for a software developer to remember the calling sequence for a particular function.
In addition to function definitions, classes in object oriented languages typically have member attributes and properties used to define varying aspects of the class. Often the source code defining these attributes includes comments associated with the attributes indicating how they are utilized. The number of these attributes in any single class can grow quite large, and combined with the fact that attributes can be inherited from parent classes can make it difficult for a software developer to remember the purpose and use for a particular attribute.
A further factor complicating software development efforts is the fact that a software module often defines a large number of identifiers. These identifiers comprise type definitions, variables, macros, parameters, namespaces, templates, attributes, etc. and must each have a type, declaration and/or definition specified. It is often difficult for a developer to remember the type and identifier for these entities or the context in which they are applicable.
A prominent approach to managing the complexity of modern software development is the use of an Integrated Development Environment (IDE). IDEs typically support various on-line help mechanisms allowing, for example, a developer to reference on-line documentation describing varying function definitions. Furthermore, for program development of a distributed application, it is important that information about remote objects be available to the developer. Remote objects are applications that do not reside on the computer executing the application code. These objects are able to be requested by the program using techniques such as a Remote Procedure Call (RPC). For example, the Java Remote Method Invocation (RMI) is a type of access to remote objects that a programmer, using the Java programming language, employs to access objects on different platforms over a distributed network.
Remote objects are often developed in a source language different than that of the accessing application. In addition, the remote objects may operate in an operating system environment different from the operating system environment of the accessing application. An Object Request Broker (ORB) architecture is used in such situations to enable local/client objects to access and use remote/server objects. An Interface Definition Language (IDL) defines the interfaces to the remote objects that the respective applications must use to access ORB services. An “object broker” then manages the communication between object-oriented client programs and remote object services, enabling a program or object written in one language to communicate with a remote object written in another language. There are a number of interface definition languages including the Common Object Request Broker Architecture (CORBA) IDL and the Web Services Descriptor Language (WSDL) IDL. The present invention is not limited to a particular IDL. An IDL is used by a client program through “stub” interfacing. The IDL is interpreted by an “IDL compiler” to generate program stubs in the programming language of the client program. When utilized in RMI, a stub program residing on the client side appears to the local calling program to be the remote object being called to provide a service.
An important feature of most IDEs is a type-ahead function in the IDE source code editor. Type-ahead functions are familiar to most computer users and are generally characterized as utilizing some type of string matching that provides an essentially real-time comparison between a partial text string entered by the user and the contents of a keyword comparison database. Responsive to a match being found the type-ahead function displays one or more potential matching strings to complete the partial text string from which the user may select using a user pointing device.
Modern IDEs use type-ahead functionality to address the aforementioned problem of the sheer volume of available program functions making it impossible for a code editor to remember available resources and call sequences. Specifically, a typical IDE source code editor includes a code-completion mechanism that assists the human code editor in entering correct and complete source code resource names from a partial typed-in string. In conducting its automatic real time or user-prompted string matching function, the code-completion mechanism draws its compare keywords from artifact resources that are currently available to the current IDE project. The compare keywords are extracted or derived from the source code of the current project, libraries in the current CLASSPATH and other projects currently open in the IDE.
In this manner, the type-ahead/code-completion function greatly facilitates the source code editing process by providing an efficient mechanism by which a programmer can use local artifact data for code completion.
While useful for facilitating a more efficient IDE code editing process, the foregoing mechanism fails to incorporate the source code syntax associated with remote resources (referred to herein generically as “remote objects”) in the type-ahead compare keyword pool. As explained above, an ORB architecture employing IDLs is utilized to generate program stubs on the local platform which may be used as a resource conduit to access remote resources. Unless these stubs have been previously generated, their interfaces are not available to the type-ahead function of the IDE. Expanding the type-ahead compare pool to include keywords derived from remote object artifacts using conventional IDE architecture thus requires processing all IDLs through a stub generation mechanism to generate local stubs which can then be used to contribute keywords to the local type-ahead function. The delay and processing steps required to retrieve the desired remote object keywords significantly defeats the intended purpose of the type-ahead mechanism as providing a minimal disruption to the editor's train of thought. Furthermore, generating stubs for use in determining remote object syntax is an inefficient expenditure of time and processing resources since the stubs are often not currently needed for compiling or running a program that remains largely incomplete. From the foregoing, it can be appreciated that a need exists for an improved method and system for contributing remote object syntax to a local type-ahead keyword compare pool. The present invention addresses this and other needs unresolved by the prior art.
A system, method, and program product for enhancing keyword contribution to a code-completion facility used in association with an Integrated Development Environment source code editor are disclosed herein. A code-completion facility supporting a source code editor includes a look-up module that retrieves keywords from a keyword compare pool responsive to a code-completion prompt. The code-completion facility further includes a contribution mechanism for contributing keywords derived from system artifacts to the keyword compare pool. The contribution mechanism includes a remote artifact contribution module for obtaining or deriving keywords from remote object interface definitions and contributing the same to the keyword compare pool. In a preferred embodiment, the remote artifact contribution module includes a keyword prediction module for accessing a remote object interface repository, predicting one or more remote object based keywords in accordance with remote object interface definition data, and contributing one or more of the predicted keywords to the code-completion facility.
The above as well as additional objects, features, and advantages of the present invention will become apparent in the following detailed written description.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself however, as well as a preferred mode of use, further objects and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
The present invention is generally directed to a method, system and computer program product that enhances type-ahead or code-completion functionality in an Integrated Development Environment (IDE). IDEs are used for developing software for use in a distributed computing environment in which programs incorporate local and remote resources physically and logically distributed across networked clients and servers. A significant characteristic of such computing environments as it relates to the present invention is that the code development environments employ object-oriented programming architectures incorporating local and remote objects. The distributed objects are distinct code modules often rendered in different programming languages that can be accessed by local or remote clients via method invocations. The Common Object Request Broker Architecture (CORBA) and Java Remote Method Invocation (RMI) architectures employ Interface Definition Language (IDL) facilities to describe remote object program resources and support distributed object sharing within such frameworks. Interface Definition Languages can include CORBA IDL, Web Services Definition Language (WSDL), Java RMI descriptors as well as registry information in Universal Description Discovery and Integration (UDDI) or Java Naming Directory Interface (JNDI) form or repositories such as XMLRR or Lotus Notes Data Objects. All of these IDLs will be referred to in the following discussion as an “IDL.”
Source code editing is fundamental to IDE software development. Included with most IDE source code editors is a type-ahead or code-completion feature that assists a programmer with entering text code strings during source code entry. IDE code-completion utilities reduce the need for the user to spend time looking up help information such as class definitions while entering code syntax for software components that are often constructed from complex object classes comprising numerous class members and methods. As explained in further detail below, the present invention improves upon conventional IDE type-ahead/code-completion mechanisms by leveraging extant remote interfacing facilities such as IDLs to enhance the keyword compare pool utilized for code-completion tasks. In the following description relating to the invention as implemented in an IDE, reference is made to keywords associated with local and remote object resources. As utilized herein, a “keyword” refers to a language-specific object identifier or indicia consistent with source code syntax such as identifiers or names for an object type, class, method, method signature, etc. Remote objects are program resources accessed using remote services access tools such as an Object Request Broker (ORB) or Java RMI invocation. In contrast, local objects are locally stored with the program under development.
With reference now to the figures, wherein like reference numerals refer to like and corresponding parts throughout, and in particular with reference to
While the invention will be described in the general context of application programs that run on an operating system in conjunction with a personal computer, those skilled in the art will recognize that the invention may also be implemented in combination with other program modules. Generally, program modules include routines, programs, components, data structures, etc. that perform particular tasks or implement particular abstract data types. Moreover, those skilled in the art will appreciate that the invention may be practiced with other computer system configurations, including multiprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframe computers, and the like.
The exemplary data processing system illustrated in
A number of program modules may be stored in the drives and system memory 50, including an operating system 14, application program modules 16, and program data 18. In accordance with the depicted embodiment, a set of one or more IDE program resources 17 are further included as applications within system memory 50. As explained in further detail below, IDE program resources 17 include source code development utilities and supporting programs and instructions enabling a programmer to develop source code in a distributed environment.
A user may enter commands and information into personal computer 15 through a keyboard 46 and pointing device, such as a mouse 48. Other input devices (not shown) may include a microphone, joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to processing unit 4 through a serial port interface 39 that is coupled to the system bus, but may be connected by other interfaces, such as a universal serial bus. A monitor 24 or other type of display device is also connected to system bus 5 via an interface, such as a video adapter 36.
Personal computer 15 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 49. The remote computer 49 may be a server, a router, a peer device or other common network node, and typically includes many or all of the elements described relative to personal computer 15. The logical network connections depicted in
When used in a LAN networking environment, personal computer 15 is connected to LAN 51 through a network interface 42. When used in a WAN networking environment, personal computer 15 typically includes a modem 44 or other means for establishing communications over WAN 53, such as the Internet. The modem 44, which may be internal or external, is connected to system bus 5 via serial port interface 39. In a networked environment, program modules depicted relative to personal computer 15, or portions thereof, may be stored in one or more remote (i.e., network distributed) memory storage devices. It will be appreciated that the network connections shown are exemplary and other means of establishing a communications link between the computers may be used.
In accordance with the depicted embodiment, application programs 16 further includes IDE program resources 17 for facilitating software development. As explained in further detail with reference to
Referring to
Source code file 64 comprises a series of statements defining the data structures and actions the computer is to implement using the data structures. These statements are composed of various programming language tokens, which are combined to form declarations and definitions that describe the entities that make up the computer program. Identifiers are utilized to identify particular entities in the program, such as function names, variable names, class names, macro names and template names. Those of ordinary skill in the art will recognize that various entities and identifier mechanisms are used in various object-oriented programming languages. Although not depicted in
In general, user input 54 takes the form of statements in the syntax of the programming language supported by IDE 55, but may also include input from various menus, dialogs, wizards, and other UI controls provided by user interface 62. As related to a preferred embodiment of the present invention, a given program module as embodied by source code file 64 is entered by the developer as part of a software development “project.” Such projects may be Java, C++, or similar object-oriented programming language which may include one or more class modules which each define one or more objects. Projects may also be developed in non-object oriented (procedural) languages such as C.
The system and method of the present invention are related to the text entry/editing performed during development of source code file 64. Specifically, and as shown in the depicted embodiment, the user interface 62 used by source code editor 60 is further communicatively associated with a type-ahead facility in the form of a code-completion module 65. Code-completion module 65 includes keyword lookup and retrieval functions and employs electronic and/or program modules and processing means enabling it to be invoked and utilized in support of source code text entry. Code-completion module 65 is preferably invoked by user interface 62 or other source editor prompt input and responsive thereto performs a type-ahead or code-completion search in which, for example, a latest-entered text string entered into source code file 64 is compared with keywords obtained or derived from project-linked artifacts and included in a keyword compare pool. To this end, code-completion module 65 typically performs a string-matching function and returns a dialog box, or the like, displaying a list of one or more possible keywords, in the form of qualified names for object types, classes, methods, etc. from which the developer may select as the correct entry.
While the result of the code-completion function is implemented at the user interface level by displaying a UI dialog as described above, the system and method of the present invention are particularly related to the contribution mechanism utilized by a type-ahead or code-completion module such as that depicted in
With reference to
As noted above, the keyword compare pool 76 referenced by lookup module 74 receives keyword contributions 66 from local artifact contribution sources. Consistent with IDE code-completion convention, the local keyword contributions are obtained from local artifact sources 78 that are generally characterized as obtained or derived independently of IDE remote program interfacing (i.e. interfacing requiring object request brokering such as implemented by CORBA) and are typically linked as part of the present program project. Local artifact sources 78 typically include resources such as object type and class information from classes programmably incorporated into the runtime environment (e.g. Java Runtime Environment for Java applications), in the CLASSPATH, or in other projects that are programmably linked to the source editor program module development without IDE ORB facilitation.
The present invention substantially enhances the code-completion facility utilized in IDEs such as IDE 55 by incorporating a remote object contribution mechanism absent from known IDEs. Specifically, and as shown in
With reference to
For illustrative purposes intended to characterize IDLs as conventionally deployed in an IDE,
As explained above, the generated stubs are truncated extensions of the programs that are compiled into them and appear to the local calling program to be the respective program being called for a service. Stub files 100 are compiled by a language-specific compiler (not depicted) and linked to the client application making the call. In this manner the IDL generation of stubs provides comprehensive remote program resources that may be utilized during compilation and/or program runtime. However, the foregoing described stub generation processing requires significant processing resources and time. As illustrated in
Specifically, and referring again to
Proceeding as illustrated at steps 118 and 120, responsive to a type-ahead or equivalent code-completion invoke signal, the lookup module retrieves matching keywords from the augmented keyword pool. Such keywords may include local object artifacts if the requested resource (as identified in a partial string, for example) corresponds to a locally available resource and/or remote object artifacts if matches to the partial string correspond to keywords obtained or derived from the remote object interface resources (e.g. from an ORB interface in an IDE).
The process depicted in
Proceeding as shown at step 134, a remote object interface definition repository such as an IDE Interface Repository is accessed such as by a contribution module 85 having a remote object retrieval mechanism. In the depicted embodiment, and as shown at step 136, the preferred remote object retrieval mechanism is a predictive algorithm module that generates established or likely object related keywords such as method and stub names derived from the interface definitions within one or more IDL source files. As previously explained, resources such as interface definitions 94 within IDL source file 92 include remote artifacts from which keywords are obtained or predictively derived such as depicted at step 136. In a preferred embodiment, predictive algorithm module 102 employs a predictive algorithm in which the naming convention followed by a stub generation tool such as IDL compiler 96 and/or code generator 98 is utilized to predict language-specific keywords from the remote object description data included in IDL source code file 92. For example, for a service within interface definitions 94 named “foo,” the IDL conversion tool comprising IDL compiler and/or code generator may include pre-programmed naming convention instructions for generating a Java class named “fooService.” In such a case, predictive algorithm module 102 preferably includes language-specific (Java in this case) naming convention rules conforming to the IDL conversion naming convention rules such that a keyword “fooService” is predictively generated. The remote object keywords predicted or otherwise obtained or derived from IDL source code file 92 are then delivered and inserted by the remote object contribution mechanism into the type-ahead keyword pool (step 138) and the process ends as shown at step 140.
The disclosed methods may be readily implemented in software using object or object-oriented software development environments that provide portable source code that can be used on a variety of computer or workstation hardware platforms. In this instance, the methods and systems of the invention can be implemented as a routine embedded on a personal computer such as a Java or CGI script, as a resource residing on a server or graphics workstation, as a routine embedded in a dedicated source code editor management system, or the like. Whether software or hardware is used to implement the systems in accordance with this invention is dependent on the speed and/or efficiency requirements of the system, the particular function, and the particular software or hardware systems or microprocessor or microcomputer systems being utilized. The computer controlled code-completion systems and methods described above, however, can be readily implemented in hardware and/or software using any known or later-developed systems or structures, devices and/or software by those skilled in the applicable art without undue experimentation from the functional description provided herein together with a general knowledge of the computer arts.
While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention. These alternate implementations all fall within the scope of the invention.
The present application is related to co-pending U.S. patent application No. ______, titled “SYSTEM AND METHOD FOR REVEALING REMOTE OBJECT STATUS IN AN INTEGRATED DEVELOPMENT ENVIRONMENT,” filed concurrently herewith, and incorporated herein by reference in its entirety.