A computing system often displays multiple user interface elements in order to provide the user with a rich user experience. In one common presentation paradigm, each user interface element is populated by a view model. A view model is a display logic component that transforms input data into an appropriate form for consumption by a user interface control that the displays the user interface element. In this paradigm, the input data comes from a data view component that provides a view on an underlying data set. In order to provide that view, the data view component uses a reference to bind to the underlying data set.
The underlying data set may be a data set within a local data cache. The local data cache keeps track of a reference count. When the data set is first referenced, the data cache begins the reference count with unity. Whenever a new reference is made to the data set, the reference count increments for that data set. Whenever an old reference to the data set is removed, the reference count for that data set decrements. If the reference count decrements to zero, then the data cache has the option of evicting or removing the data set from the data cache.
The subject matter claimed herein is not limited to embodiments that solve any disadvantages or that operate only in environments such as those described above. Rather, this background is only provided to illustrate one exemplary technology area where some embodiments described herein may be practiced.
At least some embodiments described herein relate to the use of a data view component to expose data to a user interface element display logic component. The data exposed by the data view component is from a data set within the data cache. The data view component is able to expose that data due to a binding with the data set.
In accordance with a first aspect described herein, the data view component receives a request from the user interface display logic component to access at least a portion of the data set. In response, the data view component requests the data set from the data cache. While waiting for the requested data set from the data cache, the data view component exposes at least a portion of a default data set (which could include a null data set) to the user interface element display logic. The default data set will not likely contain the data of interest to the user interface display logic component, but it will allow the user interface display logic component to cause default data to be displayed while awaiting population of the requested data. Once the data view component does bind to the requested data set, the requested data is then exposed to the user interface display logic component.
In accordance with a second aspect described herein, the data view component receives multiple requests to access different data sets from the user interface display logic component. In response to the first request, the data view component requests the first data set from the data cache. Also, in response to the second request, the data view component requests the second data set from the data cache. In response to the second request, the data view component ignores any results from the first request, and instead binds to the second data set when the second data set becomes available in the data cache for binding.
In accordance with a third aspect described herein, the data view component may change bindings to data sets in response to requests from the user interface element display logic component. When a first request is received from the user interface element display logic component, the data view is bound to the first data set. However, when a second request is received from the user interface element display logic component, the data view changes bindings to the second data set.
In accordance with a fourth aspect described herein, the data view component keeps track of the lifetime of the user interface element display logic component. In particular, when the data view component receives the request from the user interface element display logic component, the data view component also receives a lifetime reference object from the user interface element display logic component. The data view component binds to the data set in response to the request. However, when the user interface element display logic component no longer exists, the data view component receives notice of this by virtue of the data view component possessing the lifetime reference object. Accordingly, the data view component may appropriately release the binding to the data set.
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
In order to describe the manner in which the above-recited and other advantages and features of the invention can be obtained, a more particular description of the invention briefly described above will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. Understanding that these drawings depict only typical embodiments of the invention and are not therefore to be considered to be limiting of its scope, the invention will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:
At least some embodiments described herein relate to the use of a data view component to expose data to a user interface element display logic component. The data exposed by the data view component is from a data set within the data cache. The data view component is able to expose that data due to a binding with the data set.
In accordance with a first aspect described herein, the data view component receives a request from the user interface display logic component to access at least a portion of the data set. In response, the data view component requests the data set from the data cache. While waiting for the requested data set from the data cache, the data view component exposes at least a portion of a default data set (which could be a null data set) to the user interface element display logic. The default data set will not likely contain the data of interest to the user interface display logic component, but it will allow the user interface display logic component to cause default data to be displayed while awaiting population of the requested data. Once the data view component does bind to the requested data set, the requested data is then exposed to the user interface display logic component.
In accordance with a second aspect described herein, the data view component receives multiple requests to access different data sets from the user interface display logic component. In response to the first request, the data view component requests the first data set from the data cache. Also, in response to the second request, the data view component requests the second data set from the data cache. In response to the second request, the data view component ignores any results from the first request, and instead binds to the second data set when the data set becomes available in the data cache for binding.
In accordance with a third aspect described herein, the data view component may change bindings to data sets in response to requests from the user interface element display logic component. When a first request is received from the user interface element display logic component, the data view is bound to the first data set. However, when a second request is received from the user interface element display logic component, the data view changes bindings to the second data set.
In accordance with a fourth aspect described herein, the data view component keeps track of the lifetime of the user interface element display logic component. In particular, when the data view component receives the request from the user interface element display logic component, the data view component also receives a lifetime reference object from the user interface element display logic component. The data view component binds to the data set in response to the request. However, when the user interface element display logic component no longer exists, the data view component receives notice of this by virtue of the data view component possessing the lifetime reference object. Accordingly, the data view component may appropriately release the binding to the data set.
Thus, the data view component may improve the user experience by exposing a default data set until the requested data set is available, by exposing only the latest requested data set when there are multiple requests, by quickly switching bindings from one data set to another, and/or by safely releasing the binding once the user interface element display logic component ceases to exist.
Some introductory discussion of a computing system will be described with respect to
Computing systems are now increasingly taking a wide variety of forms. Computing systems may, for example, be handheld devices, appliances, laptop computers, desktop computers, mainframes, distributed computing systems, or even devices that have not conventionally been considered a computing system. In this description and in the claims, the term “computing system” is defined broadly as including any device or system (or combination thereof) that includes at least one physical and tangible processor, and a physical and tangible memory capable of having thereon computer-executable instructions that may be executed by the processor. The memory may take any form and may depend on the nature and form of the computing system. A computing system may be distributed over a network environment and may include multiple constituent computing systems.
As illustrated in
In the description that follows, embodiments are described with reference to acts that are performed by one or more computing systems. If such acts are implemented in software, one or more processors of the associated computing system that performs the act direct the operation of the computing system in response to having executed computer-executable instructions. For example, such computer-executable instructions may be embodied on one or more computer-readable media that form a computer program product. An example of such an operation involves the manipulation of data. The computer-executable instructions (and the manipulated data) may be stored in the memory 104 of the computing system 100. Computing system 100 may also contain communication channels 108 that allow the computing system 100 to communicate with other message processors over, for example, network 110. The computing system 100 also includes a display 112 for displaying user interfaces such as those described herein.
Embodiments described herein may comprise or utilize a special purpose or general-purpose computer including computer hardware, such as, for example, one or more processors and system memory, as discussed in greater detail below. Embodiments described herein also include physical and other computer-readable media for carrying or storing computer-executable instructions and/or data structures. Such computer-readable media can be any available media that can be accessed by a general purpose or special purpose computer system. Computer-readable media that store computer-executable instructions are physical storage media. Computer-readable media that carry computer-executable instructions are transmission media. Thus, by way of example, and not limitation, embodiments of the invention can comprise at least two distinctly different kinds of computer-readable media: computer storage media and transmission media.
Computer storage media includes RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other tangible medium which can be used to store desired program code means in the form of computer-executable instructions or data structures and which can be accessed by a general purpose or special purpose computer.
A “network” is defined as one or more data links that enable the transport of electronic data between computer systems and/or modules and/or other electronic devices. When information is transferred or provided over a network or another communications connection (either hardwired, wireless, or a combination of hardwired or wireless) to a computer, the computer properly views the connection as a transmission medium. Transmissions media can include a network and/or data links which can be used to carry or desired program code means in the form of computer-executable instructions or data structures and which can be accessed by a general purpose or special purpose computer. Combinations of the above should also be included within the scope of computer-readable media.
Further, upon reaching various computer system components, program code means in the form of computer-executable instructions or data structures can be transferred automatically from transmission media to computer storage media (or vice versa). For example, computer-executable instructions or data structures received over a network or data link can be buffered in RAM within a network interface module (e.g., a “NIC”), and then eventually transferred to computer system RAM and/or to less volatile computer storage media at a computer system. Thus, it should be understood that computer storage media can be included in computer system components that also (or even primarily) utilize transmission media.
Computer-executable instructions comprise, for example, instructions and data which, when executed at a processor, cause a general purpose computer, special purpose computer, or special purpose processing device to perform a certain function or group of functions. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language, or even source code. Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the described features or acts described above. Rather, the described features and acts are disclosed as example forms of implementing the claims.
Those skilled in the art will appreciate that the invention may be practiced in network computing environments with many types of computer system configurations, including, personal computers, desktop computers, laptop computers, message processors, hand-held devices, multi-processor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, mobile telephones, PDAs, pagers, routers, switches, and the like. The invention may also be practiced in distributed system environments where local and remote computer systems, which are linked (either by hardwired data links, wireless data links, or by a combination of hardwired and wireless data links) through a network, both perform tasks. In a distributed system environment, program modules may be located in both local and remote memory storage devices.
The user interface control 210 receives the control input data 201 from a user interface element display logic component 211 (also called hereinafter a “display logic component”). The display logic component 211 receives input data 202 and processes the input data 202 to thereby generate the control input data 201. Thus, the display logic component 212 uses the input data 202 to generate control input data 201 that is in a proper form for consumption by the user interface control 210. The processing performed by the business logic component 212 may be as simple as passing all or portions of the input data to its output unchanged, or may be quite complicated, or may be somewhere in between. The display logic component 211 may be a “viewmodel” or “view model” as the term is used in the MVVM presentation paradigm, or may be a “view” as the term is used in the MVC pattern.
A business logic component 212 performs business logic and feeds resulting business logic output data (including input data 202) to the display logic component 211. For purposes of this description, it is the input data 202 provided by the data view component 213 that is of most relevance to the principles described herein. The business logic component 212 may be a “model” as the term is used in the MVVM presentation paradigm or as the term is used in the MVC pattern.
A data view component 213 operates within the business logic component 212 and serves to provide a view of a corresponding data set by exposing that view upward (e.g., in the form of input data 202) to a corresponding display logic processing component 211. The data view component 213 has a reference 203 to the corresponding data set 251 in the data cache 240.
The data cache 240 holds a data set collection 250 that may be referred to by other objects, such as data view components. At first, the data set collection 250 may be empty. The data loader 260 takes care of communicating over a network 270 to an appropriate data source 280 when a requested data set is not currently in the data cache 240.
The data cache 240 also maintains a reference count for each of the data sets in the data set collection 250, and potentially makes decisions regarding eviction of a data set. For instance, the data cache 240 might remove of a data set from cache when there are no references to the data set, after potentially providing the most recently copy of the data set over the network 270 to a storage service (such as perhaps the data source 280 of
In one embodiment, the user interface control 210, the display logic processing component 211 and the business logic component 212 may be running on the same computing system (and perhaps the same machine), such as the computing system 100 of
In accordance with various embodiments described herein, the data view component may improve the user experience by exposing a default data set (such as a null data set) until the requested data set is available, by exposing only the latest requested data set when there are multiple requests, by quickly switching bindings from one data set to another, and/or by safely releasing the binding once the user interface element display logic component ceases to exist. Furthermore, this may be performed without requiring extensive coding on the part of application or extension developers that author applications or application extensions that use the data caching system.
For instance, the following code may be used by an application or extension developer to create the data cache 240 (line number is added for clarity):
Here, in line 1, the “EntityCache” is the data cache 240.
Further, the following represents the code for a view model class representing an example of the class from which the display logic component 211 may be instantiated (with line numbering added for clarity):
Line 11 is where the view model (an example of the display logic component 211) acquires a DataView (an example of the data view 213). Notice that the view model passes “container”, which is an indicator to DataView that it is to share the same lifetime as the enclosing view model. More regarding this container will be described below.
Line 12 is where the view model binds the value from the DataView. This is done in the constructor, and thus is performed a single time for the lifetime of the view model.
The “fetch” command (e.g., in line 18) is where the view model is bound or rebound to inputs. This “fetch” call results in the data cache 240 issuing a web request to populate the needed data set in the data cache 240 (assuming the data set is not already present in the data cache). For instance, in
The data view component then requests (act 302) the data set from the data cache. For instance, in
While waiting for the requested data set from the data cache, the data view component exposes (act 303) at least a portion of a default data set to the user interface element display logic component. With reference to
The data view component then receives (act 304) an indication from the data cache that the requested data set is available for binding. In response, the data view component binds (act 305) to the requested data set. For instance, in
Accordingly, a user interface control 210 may be quickly formulated and populated with temporary data, even while the real data of interest is being retrieved. The exposed portion of the default data set may be of the same type as the ultimately exposed portion of the requested data set. Thus, the user interface control may easily populate the user interface element.
The data view component then requests (act 402) the data set from the data cache. For instance, in
The data view component also refrains from honoring any responses to prior data view requests (act 403). For instance, referring to
Once the data view component receives the indication from the data cache that the later requested data set is ready for binding (act 404), the data view component binds (act 405) to the requested data set. For instance, in
The method 400 may be particularly useful when the data cache 240 responds with indications that various data sets are ready for binding in an order that is different than the order in which the data view component requested those data sets. Such might occur if, for example, the prior requested data set must be retrieved from the data source 280, and the second requested data set is already present in the data cache 240. Such might also occur if both data sets must be retrieved from the data source 280, but the later requested data source happens to be returned first.
Initially, the data view component 213 is not yet bound to a data set (“No” in decision block 502), and thus the data view component constructs a reference and points the reference to the data set (act 503). For instance, in
However, subsequently, the data view component may receive another request (act 501) to access at least a portion of a data set. For instance, in
Now, the data view component 213 is bound to a data set (“Yes” in decision block 502), and thus the data view component switches the reference to refer to the new data set (act 504). For instance, in
Thus, the method 500 may repeat any number of times to change the data set that is pointed to by the reference held by the data view component 213. This is all performed without the need to reconstruct the data view component.
Also, the data view component receives (act 602) a lifetime reference object. For instance, the lifetime reference object may have been passed as a parameter in the request (in act 601). However, the lifetime reference object may also otherwise be received as a result of the request and may be received from the display logic component. In one embodiment, lifetime reference objects expire immediately after the display logic component ceases to exist.
The data view component then binds (act 603) to the data set in response to the request (of act 601). For instance, in
If the display logic component that corresponds to the lifetime reference object were to ever cease to exist, the data view component would receive (act 604) notice that the display logic component no longer exists by virtue of the data view component possessing the lifetime reference object. For instance, in
Accordingly, the data view component may release (act 605) the binding to the data set. For instance, in
Furthermore, in
Thus, the principles described herein provide a data view component that may improve the user experience by exposing a default data set until the requested data set is available, by exposing only the latest requested data set when there are multiple requests, by quickly switching bindings from one data set to another, and/or by safely releasing the binding one the user interface element display logic component ceases to exist.
The present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is, therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.
This application claims the benefit of U.S. Provisional Application Ser. No. 61/974,126, filed Apr. 2, 2014, which provisional patent application is incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
61974126 | Apr 2014 | US |