BACKGROUND OF THE INVENTION
The present invention is directed to software programming systems and, more particularly, to systems and methods that dynamically reconfigure a graphical user interface associated with an application based on the additional features available at run-time.
Software developers have realized the advantages of using modular concepts in the design of computer program logic. Software built using modular concepts are more portable to other hardware platforms, more compatible with other software and hardware interfaces, and tend to be more easily designed, tested, installed, and maintained. Software developers design the program logic as groups of separate software modules (components) that perform specialized tasks. The developers design each module to be as independent and abstract as possible from other modules.
Object-oriented programming promotes modular software design. Object-oriented programming allows the software developer to associate a packet of information with a set of methods (or functions) for manipulating the information. The information packet with its associated methods is collectively called an object. By accessing a particular object, the developer gains implicit access to the object's associated methods.
Object-oriented systems make a distinction between the description of an object and the object itself. More than one similar object may be described by the same general description. The object description is called a class because the description can be used to describe a type or “class” of similar objects. In other words, an object is an instance of a class. An example of an object-oriented programming language using objects and classes is Sun Microsystems™ Java™ object-oriented programming language described in a text entitled “Java 1.1 Developer's Guide,” 2nd ed., 1997 by Sams.net Publishing, Jamie Jaworski, Ed., which is hereby incorporated by reference. Sun, Sun Microsystems, the Sun logo, Java, and Java-based trademarks are trademarks or registered trademarks of Sun Microsystems Inc. in the United States and other countries.
Software developers conventionally provide to a customer all classes required by an application for run-time operation. However, an application may require classes that are not present at run-time. Consider, for example, a mail application that is integrated with a calendar module. The calendar module provides additional functions to the mail application, such as permitting the scheduling of appointments and events. The graphical user interface for the mail application might contain a schedule appointment button for invoking the appointment scheduling functions. A schedule appointment button would be useless. however, if the calendar classes are not available.
Software developers address this problem by creating two separate versions of the mail application: one integrated with the calendar, and one without it. This way, the software developers can meet the customers' needs by providing only those additional functions that the customers desire.
A problem with this solution is that it requires the software developer to create many versions of the same application with varying degrees of additional functionality, as desired by the customers. Otherwise, the software developer might create only a single version integrating all of the additional functionality. This, however, would increase the cost of software production and force customers that desire only the basic application to purchase the additional functionality.
Therefore, a need exists for providing customers with an application having only the desired functionality without requiring the creation of several versions of the application.
SUMMARY OF THE INVENTION
Systems and methods consistent with the present invention address this need by moving the additional functionality to separate classes or modules that may be sold separate from the basic application, determining at run-time what functionality is available, and modifying the graphical user interface associated with the application to display controls for the available functions.
A system consistent with the present invention dynamically constructs a graphical user interface associated with an application. A command class library stores command classes that represent additional functions to be integrated with the application. An execution unit attempts to instantiate the command classes at run-time of the application, determines which of the command classes were instantiated successfully, and constructs the graphical user interface such that the graphical user interface contains the additional functions of the successfully instantiated command classes.
BRIEF DESCRIPTION OF THE DRAWINGS
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, explain the objects, advantages, and principles of the invention. In the drawings:
FIG. 1 is a diagram of a computer system consistent with the present invention;
FIG. 2 is a diagram of a memory of FIG. 1 in an implementation consistent with the present invention;
FIG. 3 is a diagram of the command class library of FIG. 2 in an implementation consistent with the present invention;
FIGS. 4A, 4B, and 4C are a flowchart of run-time activity consistent with the present invention; and
FIGS. 5A, 5B, and 5C illustrate an example of a graphical user interface for a mail application that has been constructed in accordance with the present invention.
DETAILED DESCRIPTION
The following detailed description of the invention refers to the accompanying drawings. The same reference numbers in different drawings identify the same or similar elements. Also, the following detailed description does not limit the invention. Instead, the scope of the invention is defined by the appended claims and equivalents.
Systems and methods consistent with the present invention reconfigure the graphical user interface associated with a program based on the additional features determined to be available at run-time. That is, during execution, the program determines which classes are available and then constructs a graphical user interface to reflect all of the available classes. Each class typically represents one feature offered by the program. For example, one class for a mail program may represent a calendar function.
SYSTEM DESCRIPTION
FIG. 1 is a diagram of a system architecture for a computer system with which the invention may be implemented. The exemplary computer system of FIG. 1 is for descriptive purposes only. Although the description may refer to terms commonly used in describing particular computer systems, such as an IBM PS/2 personal computer, the description and concepts equally apply to other computer systems such as network computers, workstations, and even mainframe computers having architectures dissimilar to FIG. 1.
Furthermore, the implementation is described with reference to a computer system implementing the Java programming language, the Java™ runtime environment, and the Java™ Virtual Machine specifications, although the invention is equally applicable to other computer systems having similar requirements. Specifically, the present invention may be implemented with both object-oriented and non-object-oriented programming systems.
Computer system 1000 includes a central processing unit (CPU) 1050, which may be implemented with a conventional microprocessor, a random access memory (RAM) 1100 for temporary storage of information, and a read only memory (ROM) 1150 for permanent storage of information. A memory controller 1200 is provided for controlling RAM 1100.
A bus 1300 interconnects the components of computer system 1000. A bus controller 1250 is provided for controlling bus 1300. An interrupt controller 1350 is used for receiving and processing various interrupt signals from the system components.
Mass storage may be provided by diskette 1420, CD ROM 1470, or hard drive 1520. Data and software may be exchanged with computer system 1000 via removable media such as diskette 1420 and CD ROM 1470. Diskette 1420 is insertable into diskette drive 1410 which is, in turn, connected to bus 1300 by a controller 1400. Similarly, CD ROM 1470 is insertable into CD ROM drive 1460 which is, in turn, connected to bus 1300 by controller 1450. Hard disk 1520 is part of a fixed disk drive 1510 which is connected to bus 1300 by controller 1500.
User input to computer system 1000 may be provided by a number of devices. For example, a keyboard 1560 and mouse 1570 are connected to bus 1300 by controller 1550. It will be obvious to those reasonably skilled in the art that other input devices, such as a pen, a tablet, or speech recognition mechanisms, may be connected to bus 1300 and an appropriate controller and software, as required. DMA controller 1600 is provided for performing direct memory access to RAM 1100. User output may be generated by video controller 1650 which controls video display 1700.
Computer system 1000 also includes a communications adaptor 1900 which allows the system to be interconnected to additional computing resources via a local area network (LAN) or a wide area network (WAN), such as the Internet, schematically illustrated by bus 1910 and network 1950. Signals traveling through network 1950 can generally be referred to as “carrier waves,” which transport information. Although aspects of the present invention are described as being stored in memory in the form of instructions, one skilled in the art will appreciate that those aspects may be stored on other computer-readable media, such as secondary storage devices like hard disks, floppy disks, or CD ROM, or other forms of RAM or ROM, or a carrier wave.
Operation of computer system 1000 is generally controlled and coordinated by operating system software. The operating system controls allocation of system resources and performs tasks such as memory management, process scheduling, networking, and services, among other things.
FIG. 2 is a diagram of memory 2000 consistent with the present invention. Memory 2000 may include system RAM 1100 (FIG. 1), but may alternatively include other types of memories including any of the memories shown in FIG. 1.
Memory 2000 includes runtime system 2100, applications 2200, and data memory 2300. At the core of the Java runtime system 2100 is Java Virtual Machine (JVM) 2120. JVM 2120 is a microprocessor implemented in software that runs using the capabilities provided by the operating system and the computer hardware. The JVM is described, for example, in a text entitled “The Java Virtual Machine Specification,” by Tim Lindholm and Frank Yellin, Addison Wesley, 1996, which is hereby incorporated by reference. The runtime system 2100 also includes command class library 2140. Command class library 2140 will be described below with reference to FIG. 3.
Applications 2200 include programs executed by CPU 1050 and interpreted by JVM 2120. The programs include object-oriented applets, such as applets in the Java programming language, as well as other object-oriented programs, multiplatform programs, secure programs, distributed networking programs, multithreaded programs, web programs, etc. Some of the programs operate on objects stored in data memory 2300. Data memory 2300 stores data used by CPU 1050 and JVM 2120.
EXEMPLARY COMMAND CLASS LIBRARY
FIG. 3 is a diagram of command class library 2140. Command class library 2140 stores multiple command classes 3100-3400 that contain, if successfully instantiated, additional functionality for an application. Command class 3100, for example, includes constructor 3120 and package portion 3140. Constructor 3120 records a list of the identities of external packages (or items) upon which command class 3100 depends (i.e., other classes required to perform its functionality). Package portion 3140 contains conventional code of the Java programming language for instantiating these packages.
When invoked by JVM 2120, constructor 3120 attempts to locate any packages (or classes in a package) that it needs for successful instantiation of command class 3100. Constructor 3120 need not instantiate the packages found, it may only determine whether they exist. Package portion 3140 will instantiate the packages at a later time in a conventional manner, as required by the application.
If constructor 3120 fails to locate a package, constructor 3120 throws an Exception. The Exception informs JVM 2120 that instantiation of command class 3100 failed, and, therefore, the features offered by the command class are unavailable to the application user and should not be included in the graphical user interface.
SYSTEM OPERATION
FIGS. 4A-4C are a flowchart of run-time activity consistent with the present invention. FIGS. 5A-5C illustrate an example of a graphical user interface for a mail application that has been constructed in accordance with the present invention.
In executing an object-oriented programming language, such as the Java programming language, JVM 2120 performs many operations, including the execution of applications [step 4110]. While JVM 2120 will be described as performing the application execution, this activity is actually performed by CPU 1050 through the Java runtime system 2100.
At some point during application execution, JVM 2120 will encounter instructions for constructing a graphical user interface that permits a user to interact with the application [step 4120]. Upon encountering these instructions, JVM 2120 accesses command class library 2140 in order to attempt to instantiate the command classes containing the additional functionality available for the application. JVM 2120 invokes constructor 3120, for example, of command class 3100 (FIG. 3), using a “try-catch” clause [step 4130]. The try-catch clause allows the application to attempt to instantiate a command class and still continue to run in the event that an Exception is thrown because the command class could not be instantiated.
Once invoked, constructor 3120 attempts to locate the packages (classes) needed for successful instantiation of command class 3100 from the list constructor 3120 maintains [step 4140]. For each package successfully located, constructor 3120 returns, but discards, a pointer to the package. If a package cannot be located, constructor 3120 throws an Exception, such as:
|
public CalendarCommand throws ClassNotFoundException { |
|
if (getClass.getResouce(“/sunw/calendar/Calendar.class”) == null) |
|
throw new ClassNotFoundException(); |
for an unavailable Calendar command class.
If a single required package cannot be located, constructor 3120 declares the instantiation unsuccessful [step 4150] and reports the unsuccessful instantiation in the way of a thrown Exception to JVM 2120 [step 4210] (FIG. 4B). JVM 2120 then determines whether there are any remaining command classes to be instantiated [step 4220]. If one exists, JVM 2120 returns to step 4130 (FIG. 4A) to invoke the constructor for that command class.
If there are no remaining command classes to be instantiated, JVM 2120 determines whether any command class has been successfully instantiated [step 4230]. If no command classes were instantiated, then JVM 2120 displays a basic (or default) graphical user interface on video display 1700 (FIG. 1) with only the basic controls for proper operation of the application [step 4240]. FIG. 5A illustrates an example of a graphical user interface with basic controls for a mail application. The graphical user interface includes four basic controls depicted as buttons: In Box 5110, Out Box 5120, Trash 5130, and Send Mail 5140. These buttons invoke functions well known in the art.
If one or more command classes have been successfully instantiated, however, JVM 2120 displays the graphical user interface on video display 1700 with additional controls relating to the successfully instantiated command classes [step 4250]. FIG. 5B illustrates an example of a graphical user interface with additional controls for a mail application. The graphical user interface includes the four basic controls 5210-5240 and additional controls for a Spell Checker 5250 and a Thesaurus 5260. These buttons invoke functions well known in the art.
If in step 4150 (FIG. 4A) constructor 3120 successfully locates all of the required packages, constructor 3120 declares the instantiation successful, and reports the successful instantiation to JVM 2120 [step 4310] (FIG. 4C). In response, JVM 2120 reconfigures the graphical user interface to add one or more controls for the successfully instantiated command class [step 4320]. As described above, these controls make the services provided by the command class available to the user.
JVM 2120 then determines whether there are any remaining command classes to be instantiated [step 4330]. If one exists, JVM 2120 returns to step 4130 (FIG. 4A) to invoke the constructor for that command class. If there are no remaining command classes to be instantiated, however, JVM 2120 displays the graphical user interface on video display 1700 with additional controls relating to the successfully instantiated command classes [step 4340]. FIG. 5C illustrates an example of a graphical user interface with additional controls for a mail application. The graphical user interface includes the four basic controls 5310-5340 and additional controls for a Calendar 5350, a Spell Checker 5360, and a Thesaurus 5370. These buttons invoke functions well known in the art.
CONCLUSION
Systems and methods consistent with the present invention dynamically determine the form of a graphical user interface associated with an application based on a run-time determination of the available features.
The foregoing description of preferred embodiments of the present invention provides illustration and description, but is not intended to be exhaustive or to limit the invention to the precise form disclosed. Modifications and variations are possible in light of the above teachings or may be acquired from practice of the invention. The scope of the invention is defined by the claims and their equivalents.
For example, an implementation consistent with the present invention has been described as beginning with a basic graphical user interface and adding visual controls based on the additional features found available at run-time. However, this need not be the case. The graphical user interface could be initially loaded with all possible controls. Controls would then be removed from the interface based on the run-time determination of available additional features.
In addition, while the foregoing description described the generation of a graphical user interface, the description and concepts equally apply to other types of user interfaces, such as text-based user interfaces.