The described technology relates generally to installable sub-applications and particularly to installable sub-applications using different logic models.
Many companies are now allowing their customers to remotely access their computer systems. These companies believe that the providing of such access will give the company an advantage over their competitors. For example, they believe that a customer may be more likely to order from a company that provides computer systems through which that customer can submit and then track their orders. The applications for these computer systems may have been developed by the companies specially to provide information or services that the customers can remotely access, or the applications may have been used internally by the companies and are now being made available to the customers. For example, a company may have previously used an application internally to identify an optimum configuration for equipment that is to be delivered to a particular customer's site. By making such an application available to the customer, the customer is able to identify the optimum configuration themselves based on their current requirements, which may not be necessarily known to the company. The rapid growth of the Internet and its ease of use has helped to spur making such remote access available to customers.
Because of the substantial benefits from providing such remote access, companies often find that various groups within the company undertake independent efforts to provide their customers with access to their applications. As a result, a company may find that these groups may have used very different and incompatible logic models. For example, one application may be based on a request-response logic model, and another application may be a legacy system that performs processing of data provided in a file. A company may want to provide the functionality of both applications to its customers through a single and consistent user interface so that these applications appear to the customers as a single “overall application.” It may, however, be very difficult, time consuming, and error prone to combine the functionality of both applications into a single application. It would thus be desirable to have a technique that would allow applications that use disparate logic models to provide the appearance of a single overall application.
A method and system for dispatching requests to sub-applications that use disparate logic models within the context of an application executing in a server environment is provided. The sub-applications form an application and share the same application context. The dispatching system allows sub-applications implemented with disparate logic models to share context information and thus function cooperatively as an application. The logic models may be the action-view model as described in U.S. patent application Ser. No. 09/753,037, entitled “Application Architecture,” filed on Dec. 28, 2000 and the interaction model as described in U.S. patent application Ser. No. 09/681,567, entitled “Method and System for Executing a Computer Program,” (now U.S. Pat. No. 6,944,851) filed concurrently with this application, both of which are hereby incorporated by reference. Other logic models may include workflow-based models. The term “logic model” refers to the overall architecture of a sub-application. In one embodiment, the dispatching system uses a common interface to interface with all sub-applications, regardless of their logic models. The common interface provides a service method or routine that the dispatching system invokes to effect processing by the sub-application. Each sub-application implements the common interface. In one embodiment, the dispatching system receives requests (e.g., HTTP requests), identifies the sub-applications that should process the received requests, and invokes the service routine of the identified sub-applications to process the received requests. Each sub-application may have an associated match criteria that indicates when the sub-application should process the requests. The dispatching system applies the match criteria of the sub-applications to received requests to determine whether the associated sub-applications should process the requests. For example, a match criteria may be a regular expression (e.g., “*.html”) that is applied to the uniform resource locator (“URL”) of an HTTP request. The dispatching system processes the sub-applications in an order that may be predefined. The dispatching system selects the first sub-application and applies the match criteria associated with the first sub-application to the received request. If a match is found, then the dispatching system invokes the service routine of the first sub-application. When the first sub-application completes its processing, the dispatching system then selects the second sub-application and applies the matching criteria associated with the second sub-application to the received request. The dispatching system continues this process until all the sub-applications have been processed. In one embodiment, a sub-application may return an indication that the dispatching system should not process any additional sub-applications for the received request. For example, a sub-application that implements user authentication may prevent additional sub-applications from being processed when the authentication sub-application cannot authenticate the user who sent the request. The dispatching system may also stop processing additional sub-applications when a sub-application provides a response to the received request. In this way, application programs that are independently developed using different logic models can be combined to provide an overall application with the dispatching system invoking the service routine of the sub-applications as indicated by the match criteria. Moreover, legacy applications can be encapsulated within the common interface so that they can be combined with sub-applications that use different logic models.
In one embodiment, the dispatching system during its initialization instantiates objects that implement the different sub-applications that compose the overall application. This initialization may be based on information stored in a configuration file. The configuration file, which may be in an XML format, may contain an entry for each sub-application. Each entry may identify an object class associated with the sub-application, initialization parameters associated with the sub-application, and the match criteria for the sub-application. During initialization, the dispatching system retrieves each entry and instantiates an object of the object class associated with that the sub-application. The object class defines a “service” method or routine that the dispatching system invokes to have the sub-application process requests. The dispatching system initializes the instantiated object with the initialization parameters of the configuration file. In one embodiment, the entries in the configuration file are ordered, and the dispatching system processes the sub-applications when a request is received in the specified order. The phrase “processing a sub-application” refers to evaluating the match criteria for that sub-application and invoking the service routine of that sub-application when a match is found.
The sub-applications share the same application context. This allows the sub-applications to share global data (as attributes) and to shared services such as database connections and connections to a workflow server. When a sub-application of an overall application is initialized, it is passed a configuration object through which the sub-application can access an application context object. The application context object provides methods for setting and getting the values of attributes associated with the application context. The application context object includes a lookup method to provide access to the shared services. The application context object also includes a method to retrieve a dispatcher object that is used to process and send the presentation data.
Table 1 contains an example portion of the configuration file for sub-applications. Lines 1-17 define the sub-applications. Lines 1-6 contain the definition of the Authenticate User 1 sub-application. The model element contains the name attribute for the name of the sub-application and a class-name attribute for the name of the class associated with the sub-application. The init-param element defines a parameter to be passed when the object that implements the sub-application is instantiated. The init-param element indicates that the parameter of “db” should be initialized to “user security.db.” Lines 19-22 define the match criteria for the sub-applications. Line 19 defines that the match criteria for the Authenticate User 1 sub-application. The pattern attribute indicates a match criteria of “*” and the model-ref attribute identifies the Authenticate User 1 sub-application.
Table 2 defines the methods of the interface implemented by the sub-applications in one embodiment. The dispatcher interacts with the sub-applications using this interface. One skilled in the art will appreciate that different methods may be included in the interface. For example, the interface may provide a match method that the dispatcher invokes to see if the match criteria of the sub-application matches the request.
Table 3 defines the methods of the interface for the application context.
The interface provides access to resources that include registered services, named objects managed by the application environment, the server environment, resource bundles, and the class loaders. Each overall application executes within its own context. Every sub-application within an overall application is passed a reference to the ApplicationContext instance giving it access to all resources available within the overall application.
From the above description, it will be appreciated that all the specific embodiments of the dispatching system have been described for purposes of illustration, various modifications may be made without deviating from the scope of the invention. One skilled in the art will appreciate that the sub-application can implement a wide variety of behaviors such as protocol translation, logging, business rules, authentication, and so on. Also, the dispatcher and sub-applications may operate in the framework described in U.S. patent application Ser. No. 09/753,037, entitled “Application Architecture” filed on Dec. 28, 2000. Accordingly, the invention is not limited except by the following claims.
Number | Name | Date | Kind |
---|---|---|---|
6012090 | Chung et al. | Jan 2000 | A |
6173327 | De Borst et al. | Jan 2001 | B1 |
6718535 | Underwood | Apr 2004 | B1 |
6732139 | Dillenberger et al. | May 2004 | B1 |
6732175 | Abjanic | May 2004 | B1 |
6813769 | Limprecht et al. | Nov 2004 | B1 |
7028312 | Merrick et al. | Apr 2006 | B1 |