The present invention relates to publish/subscribe systems, and more particularly to automatically updating the display state of the user interface of a client device in a publish/subscribe system.
A publish/subscribe system is an effective way of disseminating information from “publishers” to multiple users or “subscribers.” A publisher generates messages, also referred to as events, which contain a topic and some data content. A subscriber, also referred to herein as a “client,” provides, ahead of time, a criterion, also referred to as a subscription, that specifies the information, based on published messages, that the system is required to deliver to that subscriber client in the future. In a publish/subscribe system, publishers and subscribers are anonymous in that publishers do not necessarily know the number of subscribers or their locations; and subscribers do not necessarily know the locations of the publishers.
In the publish/subscribe system, subscribers typically receive only a subset of the total messages published. The messages may be selected for reception and processing using topic-based or content-based filtering. In a topic-based system, messages are published to “topics” or named logical channels. Subscribers in a topic-based system will receive all messages published to the topics to which they subscribe, and all subscribers to a topic will receive the same message. The publisher is responsible for defining the classes of messages to which subscribers can subscribe. The messages may be filtered using the subscription criterion which can be tested on each message independent of any other message. For example, a filtered published message might be “topic=Detroit Tigers & winning” for all messages related to the topic of the Detroit Tigers baseball team winning.
In a content-based system, messages are only delivered to a subscriber if the attributes or content of those messages match the constraints (subscription criterion) defined by the subscriber. The subscriber is responsible for classifying the messages.
In many publish/subscribe systems, publishers post messages to an intermediary message broker and subscribers register subscriptions with that broker, letting the broker perform the filtering.
Subscriber clients, including mobile computing clients, may use what are referred to as “macro components” in connection with the publish/subscribe system. A macro component is a bundle of components in a self-contained single object. Macro components in the context of a publish/subscribe system may be used to express events of interest to the message broker, provide the implementation to act upon those events of interest as well as provide the user interface components to convey the information of the event to the end user.
In certain computing environments, such as a mobile computing environment, the size of the display screen of the subscriber client is limited. As a result, only one message from the publish/subscribe system may be shown to the user of the subscriber client at a time. Typically, the particular message that is displayed to the user is controlled by a container, referred to as a “user interface container.” The user interface container controls the display state of the user interface of the subscriber client. The display state refers to the user interface components that are currently being used to display the content of a published message to the end user.
Traditionally, the user interface container updates the display state of the user interface upon receiving a request from the macro component to update the display state of the user interface. Each macro component may be associated with one or more events of interests. Once one of these events of interest are published, the macro component may then request the user interface container to update the display state of the user interface so that the user interface components provided by the macro component can be used to convey the received message to the end user. However, such a technique requires the macro components to use the appropriate application programming interface to communicate with the user interface container as well as to put the burden on the macro components to initiate the process in updating the display state of the user interface.
Alternatively, the user interface container may pre-load all of the macro components thereby determining which display state is associated with which macro component when a particular event is published by a publisher. However, such a process is time-consuming.
In one embodiment of the present invention, a method for updating a display state of a user interface comprises inspecting a file containing definitions for one or more macro components, where the file comprises a listing of one or more events associated with each of the one or more macro components. The method further comprises creating an event callback function for each of the one or more macro components listed in the file to update the display state of the user interface to be a display state of a macro component in response to having one of its associated one or more events published. Additionally, the method comprises detecting an event published by the publisher. In addition, the method comprises executing, by a processor, the event callback function associated with the macro component in response to the detected event corresponding to one of its associated one or more events.
Other forms of the embodiment of the method described above are in a system and in a computer program product.
The foregoing has outlined rather generally the features and technical advantages of one or more embodiments of the present invention in order that the detailed description of the present invention that follows may be better understood. Additional features and advantages of the present invention will be described hereinafter which may form the subject of the claims of the present invention.
A better understanding of the present invention can be obtained when the following detailed description is considered in conjunction with the following drawings, in which:
The present invention comprises a method, system and computer program product for updating the display state of the user interface of a subscriber client. In one embodiment of the present invention, a macro component definition file is inspected to obtain the listing of events associated with each macro component listed in the macro component definition file. An event callback function is created for each macro component listed in the macro component definition file, where the callback function will update the displayed user interface of the subscriber client to be the display state of the macro component when one its associated events is published by the publisher. Upon detecting a published event, the event callback function associated with the published event is executed thereby automatically updating the display state of the user interface of the subscriber client to be the display state of the macro component associated with the published event. In this manner, the display state of the user interface is updated without requiring the macro components to initiate the process in updating the display state of the user interface and without the user interface container incurring the time expense of pre-loading the macro components to determine which display state is associated with which macro component.
In the following description, numerous specific details are set forth to provide a thorough understanding of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced without such specific details. In other instances, well-known circuits have been shown in block diagram form in order not to obscure the present invention in unnecessary detail. For the most part, details considering timing considerations and the like have been omitted inasmuch as such details are not necessary to obtain a complete understanding of the present invention and are within the skills of persons of ordinary skill in the relevant art.
Referring now to the Figures in detail,
Subscriber 103 may be any type of computing device (e.g., portable computing unit, personal digital assistant (PDA), smartphone, desktop computer system, workstation, Internet appliance and the like) configured with the capability of subscribing to receive messages from one or more publishers 101. A more detailed description of the hardware configuration of an illustrative subscriber 103 is provided below in connection with
Referring again to
While
Referring now to
Referring again to
Subscriber 103 may further include a communications adapter 209 coupled to bus 202. Communications adapter 209 of subscriber 103 interconnects bus 202 with an outside network thereby enabling subscriber 103 to communicate with publisher 101.
I/O devices may also be connected to subscriber 103 via a user interface adapter 210 and a display adapter 211. Keyboard 212, mouse 213 and speaker 214 may all be interconnected to bus 202 through user interface adapter 210. Data may be inputted to subscriber 103 through any of these devices. A display monitor 215 may be connected to system bus 202 by display adapter 211. In this manner, a user is capable of inputting to subscriber 103 through keyboard 212 or mouse 213 and receiving output from subscriber 103 via display 215 or speaker 214.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” ‘module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.
Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the C programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
Aspects of the present invention are described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to product a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the function/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the function/acts specified in the flowchart and/or block diagram block or blocks.
As stated in the Background section, in certain computing environments, such as a mobile computing environment, the size of the display screen of the subscriber client is limited. As a result, only one message from the publish/subscribe system may be shown to the user of the subscriber client at a time. Typically, the particular message that is displayed to the user is controlled by a container, referred to as a “user interface container.” The user interface container controls the display state of the user interface of the subscriber client. The display state refers to the user interface components that are currently being used to display the content of a published message to the end user. Traditionally, the user interface container updates the display state of the user interface upon receiving a request from the macro component to update the display state of the user interface. However, such a technique requires the macro components to use the appropriate application programming interface to communicate with the user interface container as well as to put the burden on the macro components to initiate the process in updating the display state of the user interface. Alternatively, the user interface container may pre-load all of the macro components thereby determining which display state is associated with which macro component when a particular event is published by a publisher. However, such a process is time-consuming.
The principles of the present invention provide a means for updating the display state of the user interface of the subscriber without requiring the macro components to initiate the process in updating the display state of the user interface and without the user interface container incurring the time expense of pre-loading the macro components to determine which display state is associated with which macro component as discussed below in connection with
Referring to
The following provides a brief description of these software components. A more detailed description of these software components is provided below in conjunction with
Referring again to
Each macro component 302 is a bundle of components in a self-contained object. In the context of the publish/subscribe system, each macro component 302 may be used to express events of interest to message broker engine 301, provide the implementation to act upon those events of interest as well as provide the user interface components to convey the information of the event to the end user.
Furthermore,
User interface container 303 includes a user interface engine 304 configured to communicate with message broker engine 301. User interface engine 304 is configured to update the display state of the user interface of subscriber 103 as discussed below in connection with
Referring to
Referring to
Each record 501 includes information relating to the identification (identified by “ID”) of macro component 302, whether the macro component 302 is to be lazily-loaded (identified by “lazyLoad”) and the events for which the macro component 302 is to be the primary receiver (identified by “displayEvents”). As shown in
In one embodiment, macro component definition file 500 resides in the memory (e.g., memory 206), disk unit 208 or cache (not shown in
Returning to
In step 403, user interface engine 304 identifies those macro components 302 in macro component definition file 500 that are to be lazily-loaded. For example, referring to
In step 404, user interface engine 304 stores the identifications of macro components 302 identified to be lazily-loaded along with the events they are to be the primary receivers in a data structure as illustrated in
Referring to
Returning to
In step 406, user interface engine 304 subscribes with message broker engine 301 to receive published events that are associated with macro components 302 to be lazily-loaded. For instance, referring to
In step 407, user interface engine 304 detects an event published by publisher 101.
In step 408, a determination is made by user interface engine 304 as to whether any macro component 302 to be lazily-loaded is a primary receiver for the detected event. In one embodiment, user interface engine 304 determines whether any macro component 302 to be lazily-loaded is a primary receiver for the detected event by performing a table-lookup of data structure 600 to identify an event that matches the detected event. For example, if user interface engine 304 detected “Event 1,” then user interface engine 304 would identify that event in data structure 600 as being associated with “component 1” which is the identification of macro component 302A. In this manner, user interface engine 304 may identify the particular macro component 302 to be lazily-loaded that is the primary receiver of a detected event. If, however, user interface engine 304 does not identify an event in data structure 600 that matches the detected event, then there are no macro components 302 to be lazily-loaded that are a primary receiver of the detected event.
If user interface engine 304 does not identify a macro component 302 to be lazily-loaded as being a primary receiver of the detected event, then, in step 409, user interface engine 304 executes the callback function associated with the detected event (event detected in step 407) for the non-lazily loaded macro component (previously loaded in step 405) to update the displayed user interface to allow the display state of the loaded macro component 302 to be the actively displayed state.
If, however, user interface engine 304 identifies a macro component 302 to be lazily-loaded that is a primary receiver of the detected event, then, in step 410, user interface engine 304 loads said macro component 302 to be lazily-loaded.
In step 411, user interface engine 304 removes the entry containing the identification of macro component 302 (macro component 302 loaded in step 410) along with the associated detected event in data structure 600.
In step 412, user interface engine 304 executes the callback function associated with the lazily-loaded macro component to update the displayed user interface to allow the display state of the loaded macro component 302 to be the actively displayed state.
In this manner, the display state of the user interface is updated without requiring the macro components to initiate the process in updating the display state of the user interface and without the user interface container incurring the time expense of pre-loading the macro components to determine which display state is associated with which macro component.
In some implementations, method 400 may include other and/or additional steps that, for clarity, are not depicted. Further, in some implementations, method 400 may be executed in a different order presented and that the order presented in the discussion of
Although the method, system and computer program product are described in connection with several embodiments, it is not intended to be limited to the specific forms set forth herein, but on the contrary, it is intended to cover such alternatives, modifications and equivalents, as can be reasonably included within the spirit and scope of the invention as defined by the appended claims.