1. Field of the Invention
The present invention relates to the field of software code generation and, more particularly, to automatically generating software code for a user interface (UI) for multiple operating environments from a single description document.
2. Description of the Related Art
Software applications often require configuration information to be input by a user. This information is most often collected via a user interface (UI), such as a graphical user interface (GUI). Current business practices often require a software application to be written for use in a variety of operating environments, such as for the Web or for a command-line environment. These various operating environments typically utilize different interface conventions, requiring a software programmer to rewrite the UI code for each target run-time environment.
Few tools exist to assist a programmer in handling this need for modifying the code for a UI to function in various operating environments. For example, the C standard library contains a parsing function, getopt( ), for use in a command-line environment. However, use of the getopt( ) function requires that the programming language of the base software application support C library functions and that the command-line arguments received adhere to the syntax guidelines set forth by the Institute of Electrical and Electronics Engineers (IEEE).
The conventional approach of rewriting UI code to handle multiple operating environments is tedious and time-consuming. Further, this practice creates a situation where modifying the UI contents and/or implementing changes to an environment's interface conventions becomes a monumental undertaking. The extra time required to produce multiple interfaces can also impede an application's release and/or functionality.
What is needed is a solution that allows for a UI to be defined generically so that multiple user interfaces can be generated for various operating environments. That is, a UI can be described by a meta-language in a definition document and then processed by an engine that generates the UI code for selected target operating environments. Ideally, this solution would utilize a standardized meta-language with a declaratively-specified model, such as the user interface markup language (UIML), to describe the UI.
There are shown in the drawings, embodiments which are presently preferred, it being understood, however, that the invention is not limited to the precise arrangements and instrumentalities shown.
In regard to the present invention, the software development environment 105 can include a configuration description document 110 and a user interface (UI) generation engine 115. The configuration description document 110 can describe a desired configuration of UI elements in a standardized meta-language, such as XML. The configuration description document 110 can also be written in accordance with a declaratively-specified configuration model, such as the user interface markup language (UIML).
It should be noted that use of both a standardized meta-language and declaratively-specified configuration model enables the UI generation engine to produce target operating environment-specific UI code 130. The generated UI code 130 can be optionally adjusted using standard software development tools. By using such a standardized high-level language to describe the UI, the UI generation engine 115 can create a one-to-many relationship between the configuration description document 110 and the UI code 130. Conventional approaches produce a one-to-one relationship between a description and the resultant code.
The UI generation engine 115 can be a software component of the software development environment 105 that translates the configuration description document 110 into target operating environment-specific UI code 130. As used herein, the term “target operating environment” describes the final operating environment that the generated UI code is meant to run in and is unrelated to the operating environment used in the software development environment 105. For example, the development environment 105 can be WINDOWS-based and the UI generation engine 115 can produce code for a command-line operating environment such as UNIX.
To perform these translations, the UI generation engine 115 can contain multiple target operating environment code generators 120. A target operating environment code generator 120 can be a software component of the UI generation engine 115 configured to convert the contents of the configuration description document 110 into the appropriate software code for its specific operating environment.
Each target operating environment code generator 120 can pertain to a different type and/or configuration of operating environment. For example, code generators 120 can exist for WINDOWS 98, WINDOWS XP, and WINDOWS VISTA as well as LINUX and SOLARIS. In another example, the target environment can also refer to a personal computer environment, a mobile computing environment, an embedded computing environment, and the like. In still another example, the target environment can refer to a Graphical User Interface (GUI) environment, a voice user interface (VUI) environment, a multimodal environment, and the like. The granularity at which the target operating environment is defined and implemented is arbitrary in that the disclosed solution can operate to create interfaces targeted at any definable environment.
The solution of environment 105 is extensible in that additional generators 120 can be added to the UI generation engine 115 to generate an interface from the configuration description document 110 for a new execution environment. In one embodiment, one or more of the generators 120 can be configured to developer preferences. For example, developer preferences can establish whether a GUI generator 120 is to create dockable toolbars or application ribbons from a related element specified in the configuration description document 110. In another example, user preferences can establish whether a VUI generator 120 is to generate VUI prompts for Dual Tone Multi-Frequency (DTMF) only input, voice only input, or either DTMF or voice input.
As shown in this example, the target operating environment code generators 120 consists of a command-line UI code generator 122, a widget-based UI code generator 124, and a Web UI code generator 126. As used herein, the term “widget” is used to generically describe the components of a UI, such as buttons, scroll bars, sliders, text boxes, and the like.
Each target operating environment code generator 120 can produce target operating environment-specific UI code 130. As shown in this example, the command-line UI code generator 122 produces command-line UI code 132, the widget-based UI code generator 124 produces widget-based UI code 134, and the Web UI code generator 126 produces Web UI code 136.
In an alternate embodiment, the UI generation engine 115 can include an interface (not shown) where a user can perform administrative tasks, such as adding or removing the target operating code generators 120 to be used by the generation engine 115.
It should be noted that the contents of document 200 are only to provide a simple example of a possible representation of a configuration description document written in XML; document 200 is not meant to be interpreted as an exact embodiment.
Consistent with XML documents, the description document 200 can contain a variety of tags 205 and 210 that can be recognized and translated by the UI generation engine. A section containing configuration data can be denoted by specialized beginning and ending tags 205.
UI elements can be defined in the section using interface element tags 210. In this example, the interface element tags 210 define a true/false element, a multiple choice element, and a text box element. The interface element tags 210 can include attributes that define the behavior of the specific interface element, such as a default value 215.
Command-line interface 305 can represent the UI created when executing the UI code produced by a command-line code generator. The command-line code generator can translate the configuration description document into the proper software code for execution in a command-line operating environment.
As shown in the above example, the command-line interface 305 window displays a user-typed command that initiates a chessboard game.
Widget-based interface 310 can represent the UI created when executing the UI code produced by a widget-based code generator. The widget-based code generator can translate the configuration description document into the proper software code for execution in an operating environment that supports widgets, such as ECLIPSE.
The specific widgets used within the interface 310 to represent interface element tags of the description document can depend upon the translation algorithm of the widget-based code generator. In this example, the interface element tag “trueFalse” has been translated as a checkbox widget 315. Other widgets with similar functions, such as radio buttons and switches, could have been used as well. Selection of widgets for use by the code generator can be based upon a variety of factors, such as target operating environment capabilities, widget support, error handling of the host application, preferences established by a developer, and the like.
Web browser interface 320 can represent the UI created when executing the UI code produced by a Web code generator. The Web code generator can translate the configuration description document into the proper software code for execution in a Web browser, such as INTERNET EXPLORER or OPERA.
As with the widget-based interface 310, the specific Web page elements used in the Web browser interface 320 can depend upon the translation algorithm of the Web code generator. In this example, the interface element tag “multipleChoice” has been interpreted as a selectable list in the widget-based interface 310 and a group of radio buttons in the Web browser interface 320.
The present invention may be realized in hardware, software, or a combination of hardware and software. The present invention may be realized in a centralized fashion in one computer system, or in a distributed fashion where different elements are spread across several interconnected computer systems. Any kind of computer system or other apparatus adapted for carrying out the methods described herein is suited. A typical combination of hardware and software may be a general purpose computer system with a computer program that, when being loaded and executed, controls the computer system such that it carries out the methods described herein.
The present invention also may be embedded in a computer program product, which comprises all the features enabling the implementation of the methods described herein, and which when loaded in a computer system is able to carry out these methods. Computer program in the present context means any expression, in any language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: a) conversion to another language, code or notation; b) reproduction in a different material form.
This invention may be embodied in other forms without departing from the spirit or essential attributes thereof. Accordingly, reference should be made to the following claims, rather than to the foregoing specification, as indicating the scope of the invention.