Deferred state mutation

An embodiment provides deferred state mutation. Information defining action chains implementing part of a client application is received. The received information includes an explicit computer executable instruction to modify a global state associated with each action chain. Computer executable instructions are automatically generated for each of the action chains to create respective private views of the global state for each of the action chains. A separate implicit computer executable instruction is automatically associated with each of the explicit computer executable instructions. The implicit computer executable instructions are executed during runtime of the client application instead of the respective explicit computer executable instructions.

BACKGROUND

When a process is executing in a computing environment using shared variables or other data, it can be difficult to ensure proper operation when other processes also use the shared data. Conflicts can arise where the process is operating in parallel with one or more of the other processes, or when the process may not be guaranteed to have uninterrupted execution. One area where shared data conflicts can occur is in web application development. An example of a type of web application is a browser based application that can use HyperText Markup Language (HTML), Javascript™, etc. languages to implement a “stateless” approach to execution.

There are various protocols and standards within browser based applications, such as Service Oriented Architecture (SOA), Representational State Transfer (REST), etc. that allow complex systems to be designed as web applications. As more features, functionality and complexity are introduced into web applications, the likelihood of data conflict issues grows, yet such intermittent errors can be difficult to reproduce and correct. This may be especially true in a web application development phase where multiple different human developers create functionality independently, and where the functionality is intended for execution by a single user as a coherent or integrated experience at an execution phase. The functionality may be, for example, for online purchasing of goods or services where product browsing, comparison, purchasing, record-keeping, and other functions can be performed seemingly concurrently to the user, or without the user having to wait for completion of a particular function.

SUMMARY

An embodiment provides deferred state mutation. Information defining action chains implementing part of a client application is received. The received information includes an explicit computer executable instruction to modify a global state associated with each action chain. Computer executable instructions are automatically generated for each of the action chains to create respective private views of the global state for each of the action chains. A separate implicit computer executable instruction is automatically associated with each of the explicit computer executable instructions. The implicit computer executable instructions are executed during runtime of the client application instead of the respective explicit computer executable instructions.

An embodiment provides a non-transitory processor-readable storage device including instructions for a method of providing deferred state mutation, the method comprising: receiving information defining action chains implementing part of a client application, wherein the received information includes an explicit computer executable instruction to modify a global state associated with each action chain; automatically generating computer executable instructions for each of the action chains to create respective private views of the global state for each of the action chains; and automatically associating a separate implicit computer executable instruction with each of the explicit computer executable instructions, wherein the implicit computer executable instructions are executed during runtime of the client application instead of the respective explicit computer executable instructions.

DETAILED DESCRIPTION OF EMBODIMENTS

In a highly parallel system, multiple processes may update shared state simultaneously, resulting in potential conflicts. A process can be a portion of code that is executed to perform a predetermined function. Although specific functions may be discussed, such as a user interacting with a client application's user interface, it should be apparent that features described herein may be adaptable for use with any other functionality, as desired. Conventionally, the problem of multiple parallel processes simultaneously updating shared state was either not handled at all or sophisticated programming mechanisms, such as locks, mutexes, or critical sections, were used. Writing code that uses such sophisticated programming mechanisms requires the developer to be have sophisticated programming skills. Various embodiments address these issues without using sophisticated programming mechanisms in a manner that enables an unsophisticated developer to create the code. Deferred state mutation enables an unsophisticated developer to create computer executable instructions for a client application while avoiding the potential conflicts. This allows each process to have a consistent view of the shared state, and a predictable way to update that shared state when a respective process completes.

In event driven applications, processes respond to events to perform certain actions. Since events can occur simultaneously and the processing of those events can occur asynchronously, any state that may be mutated in response to an event can and typically will be in contention.

When designing and implementing event handlers, it can be very difficult to account for the fact that other external handlers can be mutating state that are used simultaneously. For example, take the following exemplary pseudo code:

Assume, for example, that initially state A has the value 3 and state B has the value 2 providing a result of 5 when the instruction “set result=sum(A,B)” is executed (also referred to as “the set”). Further, assume that the state A was changed, or mutated, for example from 3 to 2, by a separate handler or process after the set but prior to the print. In this case, the nonsense 2+2=5 may be printed by the “print A, ‘+’, B, ‘=’, result” instruction.

The above example illustrates in a simple example, the problems with shared variable A which can be written to by two or more processes or handlers. First, there is an issue of what is the current value of A, as the two processes are running asynchronously (e.g., first process:onAdditionButtonClick, and the second process writing to A). The second issue is when process detects there is a bug, e.g., we get printed “2+2=5” instead of “3+2=5”, determining what was the initial value of A and B at the start of the pseudo code so processing can roll back to a known starting point.

In the current development environment there can be very many processes running asynchronously and accessing many shared variables, or to put it another way, a variable may be shared asynchronously by two or more processes. Thus, there is a need, for debugging purposes, of snapshotting a variable before it goes through being modified. By modified in one embodiment, this means being written to, as opposed to only being read. In one embodiment, this snapshot can be accomplished by not modifying the original shared variable value, but creating a local copy for the process that wants to do a modification. There will be a local copy for each process that wants to do an asynchronous change to the original shared variable value. The process local variable can be rolled back, if needed for debugging, to the original shared variable value. At some point all the local copies are resolved to a final value which will replace the original shared variable value. In one embodiment the local copy is created by a smart wrapper which only creates a local copy when a variable is being written to and not when being read.

According to one embodiment, state is captured prior to the event handler being executed. That state can then be isolated from other handlers. According to one embodiment, it can be freely mutated only by that handler and those mutations are visible to future actions of that same handler. When the handler completes, that state is merged back into the larger system. While conflicts can still exist during this merge, they occur after logical processing has occurred and can thus be better tracked and managed.

FIG. 1depicts action chains110,120,130executing in parallel, according to one embodiment. Note that although functions or action chains may be described as executing in “parallel” it is well-known that the idea of parallel execution is commonly used to describe time-sliced processing using a single processor where at a micro-execution level only one action chain at a time is being executed. However, at a higher macro-execution level such as the application instruction level it appears that action chains are acting concurrently or in parallel. In general, embodiments described herein may be adaptable to any execution scheme such as single or multi-processor architectures, multi-threaded, multi-pipelined, time shared processing, distributed or networked (e.g., cloud) processing, etc.

The action chains110,120,130are chains of actions111,112,121-125, and131-133. The boxes represent the actions111,112,121-125, and131-133and the arrows represent the flow of control from one action to another in the respective action chains. For example, the execution is performed in the direction of the arrow. Actions can be performed serially in an action chain as indicated by a first single box connected with a second single box with an arrow. Actions can also be performed in parallel as indicated by the three boxes122-124for the second action chain120. More specifically, execution from the first action121in the second chain120can fork into three parallel actions122-124and then join again in a lower action125. Alternatively, one or more actions may be conditionally executed so that not all of the actions in the chain will be performed on each invoking of the action chain. One or more actions can be the children of a previous action. For example, the first action121in the second action chain120is the parent and the three actions122-124that branch from it are the children. In other examples, action111is the parent of action112and action131is the parent of action133.

Actions can perform various types of processing. For example, one action may read a value from a variable. Another action may write a value to a variable. In another example, there may be a desire to obtain several stock prices that are under a certain threshold and to provide one alert if any of them are under a certain threshold. In this case, an action may fork several other actions where each of those actions request stock prices in parallel. Once the stock prices have been obtained, an action they join into may determine which are below the threshold and provide that information in a single alert. In still another example, a web page may be designed to allow a user to buy several songs by selecting “buy” buttons below each of the songs displayed in a list. Selecting a “buy” button triggers an event that starts an action. Each of the actions can process the buys in parallel.

According to various embodiments, each of the action chains are isolated by partitions141,142,143(also referred to as “isolations”) from each other as represented by the lines separating the action chains. In other words, each action chain has a private view of the state it operates on. For example, Y represents a global state. Examples of state include variables and data streams. Each action chain is provided its own private view of the global state when the action chain begins execution. For example, Y1is the first action chains private view of Y, Y2is the second action chains private view of Y, and Y3is the third action chains private view of Y.

In one embodiment the views Y1, Y2, Y3can be implemented using variables that are local to each of the three action chain110,120,130isolations141,142,143. Thus, each local variable Y1, Y2, Y3can be modified by its respective action chain110,120,130without modifying global state Y. In effect the global state Y has been snapshotted and is the original state for Y1, Y2, Y3in case an action chain has a bug and the state of that action chain can be rolled back to the start state for debugging purposes. The views Y1, Y2, Y3are examples of mutable states because they represent a version of the state Y and can be modified by the respective action chains. The action chains are examples of processes. Note that Y3is created at a different time than Y1and Y2. Thus, at action131of the third action chain103, Y may be read only so the value of global variable Y can be used. At action132, global variable Y is written to and before this happens a local copy Y3is created and Y3not Y is written to. Thus, in one embodiment, local variables are created dynamically. In one embodiment, at the end160of the action chain a conflict resolution170is run to determine from the final values of Y1, Y2, and Y3, what is the new value for global state Y. In one embodiment, the last variable Y1, Y2, or Y3written to is the new value for global state Y.

A user interface of a design time visual development tool, according to one embodiment, enables an unsophisticated human developer to create visual representations of the action chains. For example, the user interface can display icons of boxes and arrows. The developer can drag and drop icons of boxes and arrows joining the boxes to create visual representations of the action chains. The tool generates the computer executable instructions for a client application based on the visual representations of the action chains. Typically, the generated computer executable instructions implement a user interface for the client application. The action chains are referred to as a “declarative system” because they are created by wiring together atomic boxes to do simple actions using, for example, arrows and boxes. This hides many of the complexities of the computer instructions from the developers, including the complexities involved in parallel processing. The developers are known as “declarative developers” or “declarative programmers.” Such declarative developers do not understand how to use sophisticated programming techniques such as locks, mutexes, partitions, and critical sections (also referred to as “protected sections”).

According to various embodiments, the declarative programmer (also referred to herein as “unsophisticated developer,” and “unsophisticated human developer”) specifies explicit computer executable instructions by creating the action chains via the tool. However, according to various embodiments, the tool automatically generates at least one implicit computer executable instruction that is executed during run time to replace at least one of the explicit computer executable instructions that was specified during design time. For example, instead of executing an explicit computer executable instruction assigning a value to the shared state Y, an implicit computer executable instruction to assign that same value to the private view Y1is executed.

The implicit computer executable instructions are hidden from the declarative programmer. For example, although, execution of the implicit instruction replaces execution of the explicit instruction, the declarative programmer continues to see the explicit computer executable instructions if they display the action chains that they created.

The tool can configure the client application's instructions with different modes for displaying the client application's instructions. For example, a first mode can be used for unsophisticated programmers and a second mode can be used for sophisticated programmers. The first mode displays the explicit instructions and hides the implicit instructions from the unsophisticated programmer. The second mode displays the actual instructions of the client application including the implicit instructions. Either of the modes can be used to display the source code instructions of the client application or to display the instructions as they are being executed as part of debugging.

Assume for the sake of illustration that Y has the value of 3 when the action chains start150. Y1, Y2, and Y3will then have the value of 3. Assume that the first action chain changes Y to 4. Each of the action chains include an explicit computer executable instruction to modify the variable Y, that instruction is changed by the tool for the respective action chains to implicit computer executable instructions to instead modify variables Y1, Y2, and Y3respectively. For example, when each of the action changes explicit instructions modify Y, the actual implicit instructions instead modify Y1, Y2, and Y3respectively. In another example, assume that Y has the value of 3 when the action chains start. When the explicit computer executable instruction of the first chain modifies Y from the value of 4, an implicit computer instruction instead modifies Y1to 4, leaving the value of Y as 3. Further, the values of Y2and Y3remain 3 since they are isolated from the first action chain.

When execution of the action chains end, the values of Y1, Y2, and Y3will be resolved (also referred to as “merged” or “rationalized”). According to one embodiment, the value of the last action chain is saved. For example, if the third action chain was the last to complete, Y would be assigned the value of Y3. Typically, there is no further use for the state Y so the values of Y1, Y2, and Y3do not matter.

The words “mutation” and “change” can be used interchangeably. For example, mutating a state means changing the state. More specifically, changing the value of the variable Y from 3 to 4 is an example of mutating or changing it.

Without the isolations141-143and the private views Y1, Y2, Y3, when one of the action chains, such as action chain110, explicit computer executable instructions modifies Y to the value of 4, the other action chains, such as action chains120,130, will also obtain the value 4 when they access Y. Thus, without the isolations141-143implementing the private views, the operations of each action chain will affect the others in unanticipated ways. To further complicate matters, different developers may create different action chains. Therefore, no one developer could possibly know what types of operations are being performed on a global view by other action chains.

Although for the sake of simplicity, the action chains, as depicted inFIG. 1, appear to start and end at the same time. However, they most likely start at different times and they take different amounts of time to execute.

One embodiment provides for taking a “snapshot” (i.e., storing the state) of all or a portion of the data space or executing environment of an execution object. In an embodiment relating to web applications the execution object is referred to as an “action chain” and it is a series of programmatic actions along with logical flow such as sequential, branching, conditional, or other instruction execution sequences. An action chain can be associated with a user interface (UI) control, browser tab, browser page, or any other desired item, object or event.

An embodiment, “deferred state mutation,” is an approach of automatically changing a developer specified computer executable instruction, such as Y=Y+1, that modifies a global variable Y into a tool generated computer executable instruction, such as Y1=Y1+1, that modifies a local variable Y1instead. The mutation of the global variable is then deferred until after the action chains110,120,130modifying that global variable have ended170their execution, thus, conflicts between the action chains' updates of the global variable are prevented. A developer specified computer executable instruction is also referred to herein as an “explicit computer executable instruction” and a tool generated computer executable instruction is also referred to herein as an “implicit computer executable instruction.” The developer and tool generated instructions are non-transitory computer readable instructions that are stored on a non-transitory processor-readable storage device, according to one embodiment.

In one embodiment, prior to executing an action chain, a determination is made as to whether any shared data (e.g., global variables) could be modified or used by other action chains. If so, the shared data that might be changed is stored. Snapshots are also taken for other action chains that might modify or use shared data. At the end of execution of the action chains that can cause a conflict, a decision is made as to which of the conflicting values should actually be used to update the shared value. The decision can be made on simple criteria such as the first, or last value changed. Or other criteria can be used. In a preferred embodiment, the resolution of the conflict is handled by environment code, or instructions. Environment code provides control of execution whereby implicit instructions that are created by the development environment replace explicit instructions that are specified by the unsophisticated human developer. The environment code controls the execution of the unsophisticated human developer specified code so that the unsophisticated human developer does not need to be concerned with data conflicts while they are writing their respective portions of a client application. The environment code can also be used to merge170the values of the local variables Y1, Y2, Y3into corresponding a global variable Y, as discussed herein.

FIG. 2depicts a block diagram of a system100, according to one embodiment.

The system200includes a design time visual development tool210, a client application250, server applications230,240, and a network220. The tool210, the client application250, and the server applications230,240communicate over a network230. The client application250, according to one embodiment, is executed by the tool210.

The tool210provides a user interface (UI)211that enables unsophisticated developers the facilities for creating action chains251. Action chains110,120,130depicted inFIG. 1are examples of action chains251depicted inFIG. 2. The client application251includes a user interface252that is implemented with action chains251created with the user interface211. The web pages of the user interfaces211,252can be displayed via browsers executing in respective computer systems executing or communicating with the tool210and the client application250. Computer instructions of the action chains251can result in requesting and obtaining information from one or more of the server applications230,240.

The action chains251are executed in response to events. According to one embodiment, the event that cause an action chain to start executing are the direct or indirect result of a user selecting a user interface control in the user interface252. Examples of user interface controls include buttons, tabs, data entry fields, radio buttons, items in a list that can be selected, and so on. Examples of events include detecting that a user selected a user interface control of the client application's user interface. Other examples of events that can occur in response to selection of a user interface control include detecting that data has been requested, data has arrived, an operation started or completed, or a phase of an operation is about to be started or has completed. Events are well known in the art.

Further, since the events that cause action chains are triggered in response to a user selecting a user interface control, the instructions of the client application250and the action chains do not control when an action chain starts.

The boundaries of the direct and indirect results of an action are well defined because the action chains are event driven. More specifically, the boundaries of the instructions in the client computer executable instructions that handle (also known as an “event handler”) the event directly or indirectly are determinable. A developer can create code (also known as a “subscriber”) that subscribes to an event handler. Since the boundaries of an action's result are determinable and known, the global variables used, directly or indirectly, by an event chain can also be determined.

The boundaries, as discussed herein, and the private views provide isolation between the event chains. The isolations141-143are depicted as lines between the event chains110,120,130inFIG. 1.

Since the events that start execution of the action chains are either directly or indirectly triggered as the result of a user selecting a user interface control, it is impossible to anticipate when the action chains are executed.

Various embodiments provided cloud capabilities. For example, a developer can use the tool210to create the client application250over the cloud. More specifically, the client application250, the server applications230,240, and the tool210are web applications that communicate over the network220.

FIG. 3depicts an implementation of snapshots, according to one embodiment.

A snapshot of global variables used by an action chain is taken when the action chain starts execution.FIG. 3depicts an example of three wrappers, i.e.,301,302, and303a/303bfor the respective action chains110,120,130depicted inFIG. 1. Assume that the global variables are X, Y, and Z. In this example, for each action chain,110,120,130, a wrapper or a proxy is used to interface with the global variables X, Y, and Z. That wrapper or proxy is used to isolate, for example, the private views Y1, Y2, Y3of the respective three action chains from the global state of Y. For action chain130, the wrapper303acreates a local copy of global variable X, i.e., local copy X3, but not of global variables Y and Z, because at this point in time, in this example, Y and Z are read only. Thus, the wrapper303ajust passes through the values of Y and Z. At a subsequent time, when Y is written to, wrapper303b[in this embodiment, wrapper303aand303bare the same wrapper code just executed at different points in time] creates a local copy Y3. Action chain130uses at this time [action chain132] its local copy of X, i.e., X3, and Z is just passed through again as it is read only. The wrapper or proxy provides an association between the shared variable Y and the private views Y1, Y2, Y3that can be used as part of replacing an explicit computer executable instruction to modify Y with respective implicit computer executable instructions to modify Y1, Y2, and Y3instead during the runtime execution the respective action chains251in the client application250.

Similarly, X1, X2, X3provide private views for the respective action chains to global variable X; and, Z1, and Z2provide private views for the respective action chains to global variable Z.

Although for the sake of illustration,FIG. 3depicts three sets of variables X, Y, and Z for the three respective snapshots, since X, Y, and Z are global variables for the client application, the Xs of each are the same variable, the Ys of each are the same variable, and the Zs of each are the same variable.

Snapshots and the associated wrappers can be nested. For example, if a first action chain starts another action chain, two snapshots will be taken—one snapshot for the parent action chain and a second snapshot for the child action chain. The second snapshot will be nested inside of the first snapshot. In an example, if an action chain starts two other action chains, three snapshots will be taken.

The action chains can read and write to the global variables X, Y, and Z via explicit computer executable instructions specified by a developer of the client application and execution of those explicit computer instructions are replaced with execution of appropriate implicit computer instructions to redirect those operations to the appropriate private views. For example, an explicit computer executable instruction, such as Y=Y+1, can be replaced with in implicit computer instructions to create the wrapper, obtain local storage for a private view Y1, assign Y1the value of Y, and Y1=Y1+1.

According to one embodiment, snapshots are only taken of variables that will be modified. Snapshots are not taken of read only variables.

According to one embodiment, a private view of a global variable is created just before the global variable is modified.

According to one embodiment, global variables are copied into a wrapper, thus, creating private views. Modifications to the variables are tracked to determine which variable states are changed. Creating private views can be detailed until their respective global variables are to be read, or until another process modifies them.

Referring toFIG. 2, the tool210can provide visual application building capabilities that the developer or team use via the cloud to build the action chains251that implement parts of the client application250. Visual Builder Cloud Service (VBCS) is modified to provide various visual application building capability embodiments discussed herein.

The tool210's user interface211generates computer executable instructions for building the client application250, during design time. The tool's user interface enables an unsophisticated human developer to create action chains with deferred state mutation capabilities for the client application, as discussed herein. The developer may select an option instructing the tool210to create action chains251with deferred state mutation capabilities. Alternatively, the tool210may automatically create computer executable instructions that provide deferred state mutation capabilities in response to the creation of action chains251using the tool210.

In an example, the tool's UI211lets a developer to customize or create a page for the client application's user interface252. An in illustration, a button was created.FIG. 4depicts a page400for creating an action chain for a button that will be part of the UI252, according to one embodiment. Page400can be displayed by selecting the startmyActionChain tab480. A description section can be added. The page400of UI211includes a palette410of actions to the left that can be added to the action chain440. The middle section420of the page400depicts a flow diagram that represents one or more sequences of actions in the action chain440. The diamonds441represent “if” statements or branch conditions for determining which of multiple alternate paths the execution of the action chain440can take.

The pallet410has three sections450,460,470labeled “general,” “logic,” and “navigation” as shown inFIG. 4. Each section450,460,470includes icons that represent actions that can be dragged and dropped into the middle section420to create the action chain440.

The general section450has three rows of icons. In the first row of the general section, the first icon451represents assign variables. For example, this icon451can be used for setting a variable to a different value. The second icon452in the first row, represents call action chain. This allows the developer to specify to a call another action chain from this action. The third icon453in the first row represents a call component method that lets the developer determine which UI component, like a button, on a page being created for the UI252to call.

The second row in the general section also includes three icons. The first icon454in the second row is the “call module function” icon. This enables a developer to define their own function in the java script of the page being created for the UI252. The call module function icon then allows the developer to create code that calls those functions. The second icon455in the second row is the “call REST end point” icon. This action allows the developer to create code that calls a REST end point to update data or request data.

The third row in the general section450also includes two icons. The first icon457in the third row is the “fire notification” icon. It can be used to put a message onto a page that the action chain is being used to implement. The second icon458in the third row is the “reset variables” icon. It can be used to reset the value of a state back to its default value.

The logic section460includes three icons461-463. This section enables the creation of logic flow in the action chain. The first icon461in the logic section represents an action for an “if” condition. The second icon462in the logic section represents a switch. The third icon463in the logic section represents a return. The third icon463can be used at the end of an action chain to return a specific outcome or value. The third icon463is useful when calling an action chain from another action chain.

The navigation section470includes three icons471-473. The first icon471in the navigation section enables the developer to create code that navigates to the previous page. The previous page in this case would be the previous page in the client computer250's browser's history. The second icon472in the navigation section enables the developer to create code that navigates to a page in a client application250during run time. For example, this icon472can be used to create computer executable code that navigates from an expense report page of the client application's UI252to an employee page of the client application's UI252. The third icon473in the navigation section enables the developer to create code that navigates to a URL that is not in the currently executing client application250.

FIG. 5depicts a web page500that the developer can use to map input parameters they want for that action chain, according to one embodiment. For example, inFIG. 5, the developer can click on “input Parameters”501that appears below myActionChain502to map input parameters.

Referring to the page500, an action chain has an identifier (ID) that can be specified in the Action Chain ID field503.

FIG. 6depicts a web page600that the unsophisticated developer can use to bind a UI component to component events, according to one embodiment. For example, the developer can drag a UI component from the pallet610on the left into the pane620in the middle. In this example, the dragged UI component is a button621.

FIG. 7depicts a web page700that includes a list of events710, according to one embodiment. If the developer selects the action tab630depicted in the page600, a list of events710, as depicted inFIG. 7, will be displayed in response. The developer can select one of the events displayed inFIG. 7to bind to the UI component, such as the representation of the button621, displayed in the middle pane620.

In addition, the developer can click on a representation of a UI component, such as the button621, to display properties for that UI component.

If the developer clicks on the action tab730in the page600inFIG. 6, the list of events710depicted inFIG. 7is displayed in response. The developer can select one of the events in the displayed list710to bind to the UI component, which in this illustration was a button621that the developer previously selected from web page600(FIG. 6).

The list of events710includes events such as unclick that is fired when a non-primary pointing device button is pressed and released over an element, blur that is fired when the element loses keyboard focus, click that is fired when the primary pointing device button is pressed and released over the element, contextmenu that is fired when the element's associated context menu is invoked, before it is displayed, double click (also referred to as “dblclick”) that is fired when a pointing device button is clicked twice over the element, drag that is fired continuously while dragging the element or a text selection, drag end that is fired when dragging is ended for the element or a text selection (whether because a pointing button is released or the drag operation is cancelled), and dragenter that is fired when a dragged element or text selection is moved over a valid drop target.

Referring toFIG. 2, although the tool's user interface211was illustrated in the context of creating a button for the client application250's user interface252, embodiments are well suited for other types of user interface controls, such as drop down menus, tabs, menus, radio buttons, lists and so on. An action chain can be triggered directly or indirectly as the result of a user interacting with a user interface control, as discussed herein.

An Illustration of a Method

FIG. 8depicts a flowchart of a method800for providing deferred state mutation, according to one embodiment.

At810, the method begins.

According to one embodiment, the tool's user interface211depicted inFIG. 2enables a developer to select whether to enable deferred state mutation. According to another embodiment, deferred state mutation is automatically provided without the developer specifying it.

At820, information is received that defines action chains110,120,130,251implementing part of a client application250depicted inFIGS. 1 and 2. The information defining the action chains is received at design time, as discussed herein. For example, icons depicted on a web page400(FIG. 4) of the tool210's user interface211(FIG. 2) can be dragged and dropped to create a flow diagram that represents one or more sequences of actions in the action chain440(FIG. 4), as discussed herein.

The received information includes an explicit computer executable instruction to modify a global state (also known as a “global variable”) associated with each action chain. An example of an explicit computer executable instruction is Y=Y+1 where Y is a global variable. The developer can specify the explicit computer execution instruction by typing explicit computer instruction “Y=Y+1” or could use some other mechanism, such as dragging and dropping visual representations, arrows to connect visual representations, typing in text and so on, to specify equivalent logic for the explicit computer instruction.

Web pages400-700(FIGS. 4-7) of the tool's user interface211(FIG. 2) provide other features enabling an unsophisticated developer to provide deferred state mutation capabilities, as discussed herein, for the user interface252(FIG. 2) that they are creating.

At830, computer executable instructions are automatically generated for each of the action chains to create respective private views of the global state for each of the action chains. For example, referring toFIGS. 1-3, computer executable instructions for creating private views Y1-Y3, X1-X3, Z1, and Z2of respective global variables Y, X, Z are generated. Examples of computer executable instructions for creating private views are wrappers301,302,303. Although, the wrappers are created during runtime of the client application250, the instructions that create the wrappers for a client application's user interface252can be part of the tool210, can be generated at design time by the tool210, or can be generated at runtime of the client application250based on instructions from the tool210.

At840, a separate implicit computer executable instruction is automatically associated with each of the explicit computer executable instructions where the implicit computer executable instructions are executed during runtime of the client application instead of the respective explicit computer executable instructions. The implicit computer executable instructions are generated during design time and are associated with respective explicit computer executable instructions during design time. An implicit computer executable instruction is a computer executable instruction that is an alternative to the explicit computer executable instruction specified by the developer of the client application250(FIG. 2). The implicit computer executable instruction can be created by logic (also referred to as “automatic computer executable instruction creation”) provided by the design time tool210(FIG. 2). This logic could be executed during design time or run time. The logic may reside at the design time tool210(FIG. 2), the client application250(FIG. 2), or in a library that is accessed by either or both the design time tool210(FIG. 2) and the client application250(FIG. 2).

Assume that the developer creating the client application250(FIG. 2) using the tool's UI211(FIG. 2) specified the explicit computer executable instruction Y=Y+1 for one action chain, such as110, and C=Y in another action chain, such as120(FIG. 1), where Y is a global variable. Also assume, in this illustration, that C is a local variable to the second action chain120(FIG. 1). The first action chain110's (FIG. 1) explicit computer executable instruction with the implicit computer instruction Y1=Y1+1 and the second action chain120's (FIG. 1) explicit computer executable instruction C=Y with C=Y2. In another embodiment, the explicit computer executable instruction is detected during runtime execution and execution is redirected to the implicit computer executable instruction.

In still another embodiment, the implicit computer executable instruction is created by using the explicit computer instruction as a template and substituting local variables for the global variables. For example, each of the occurrences of the global variables Y in Y=Y+1 are substituted with the local variable Y1. Further, the explicit computer executable instruction can be parsed to locate the global variables. The global variables can be in the wrapper and the corresponding private views can be determined. The private views can then be accessed instead of the global variables. The implicit computer executable instructions are then executed during runtime of the client application250instead of the respective explicit computer executable instructions.

At850, the method ends.

An embodiment provides for configuring the client application to execute, during the runtime, an implicit computer executable instruction instead of an associated explicit computer executable instruction. For example, referring toFIG. 2, the tool210configures the client application250to execute an implicit computer executable instruction instead of an explicit computer executable instruction, as discussed herein.

An embodiment provides for displaying, in response to a signal specifying a user request, at least one of the explicit computer executable instructions; and not displaying an implicit computer executable instruction that corresponds with the at least one explicit computer executable instruction.

An embodiment provides for during runtime of the client application, displaying a web page for the client application in a browser of a client device communicating with the client application; generating an event in response to detecting user selection of a user interface control depicted in the web page; and starting a particular action chain of the action chains in response to the event. For example, referring toFIGS. 2 and 10, a web page for the user interface252of the client application250executing on an application server1020can be displayed in a browser of a client device1085,1070,1070,1090communicating with the client application250. An event is generated in response to detecting a user selection of a user interface control depicted in the web page of the user interface252. A particular action chain in action chains251is started in response to the event.

An embodiment provides for creating a snapshot of global variables for the particular action in response to the starting of the particular action chain, wherein the snapshot includes local variables that are local to the particular action chain; and assigning values of the global variables to the local variables, wherein each of the local variables is assigned a value of one of the global variables. Referring toFIG. 3, examples of snapshots and wrappers, examples of local variables are X1-X3, Y1-Y3, Z1and Z3, and examples of global variables are X, Y, and Z.

An embodiment provides for creating a wrapper with associations between each of the global variables and one of the local variables; and assigning the values of the global variables to the local variables based on the associations.FIG. 3depicts wrappers301-303with global variables and local variables where for a given wrapper there is a one to one correspondence between the global variables X, Y, Z and local variables. More specifically, for wrapper301, global variable X is mapped just to local variable X1, global variable Y is mapped just to local variable Y1, and global variable Z is napped just to Z1. Therefore, at any given point during execution of an action chain chains, a global variable will be mapped to just one local variable for that action chain.

An embodiment provides for modifying a local variable instead of a corresponding global variable during the execution of the action chain. For example, referring toFIG. 1, during the execution of action chain110, the local variable Y1would be modified instead of the corresponding global variable Y. Similarly, during the execution of action chain120, the local variable Y2would be modified instead of the corresponding global variable Y.

An embodiment provides for isolating each of the action chains and the corresponding local variables in respective partitions, wherein each of the action chains are isolated in separate partitions. For example,FIG. 1depicts partitions141-143that isolate each of the action chains110,120,130and their respective local variables Y1, Y2, Y3.

An embodiment provides for executing the client application by a design time tool that performed the receiving, the automatically generating, and the automatically associating. For example, referring toFIGS. 2 and 8, the design time tool210can perform the receiving820, the automatically generating830, and the automatically associating840depicted inFIG. 8.

An embodiment provides for receiving information defining a plurality of parallel action chains110,120,130(FIG. 1) implementing part of a client browser application, wherein the received information includes an explicit computer executable instruction to modify a global state associated with one or more of the action chains; and automatically generating one or more environment instructions at a development phase for each of the one or more of the action chains110,120,130,251(FIGS. 1 and 2) to create respective private views X1-X3, Y1-Y3, Z1, and Z2(FIG. 1) of the global state X, Y, and Z (FIG. 1) for each of the one or more of the action chains, and for resolving a conflict in the global state. An example of a client browser application is client application250(FIG. 2). The client application250is a client browser application because it provides a user interface252(FIG. 2) of web pages that can be displayed in a browser of a client device, as discussed herein. An example of resolving a conflict in the global state is to prevent the conflict by creating the local variables, isolating them in respective partitions, and modifying local variables instead of corresponding global variables during the execution of their respective action chains. Further, the values of the local variables can be merged170(FIG. 1), as discussed herein.

An embodiment provides for creating a local variable by a smart wrapper when a global variable of an explicit computer executable instruction is being written to but not when the global variable is being read. For example, referring toFIG. 3, if an unsophisticated human developer specifies an explicit computer executable instruction to modify a value of the global variable Y at action132, a smart wrapper303bassociated with action132will create a local variable Y3. The local variable Y3is not created by wrapper303abecause action131does not assign a value to the corresponding global variable Y.

Illustration of a System

FIG. 9depicts a system900, according to one embodiment.

The page lifecycle manager901initializes and destroys parts of the state depending on which application UI is currently visible to the user. When it destroys state, it can save it to the persistence store (if configured) and when restoring state, it can load it from the persistence store.

Persistent Store902is where application state is persisted (on disk) between invocations of the application by the user.

State903provides the state in active use by the application (variables).

Components904provides the UI that includes buttons, text, images, etc. that the user interacts with.

Action Chains905provides the core flow of logic that drives the application (the processes).

Computer/Device907provides the browser or device that is controlling the UI.

The following is a description of the flow of operations911-421with respect to the entities901-907depicted in system900:

Operation911: The persistence store is used to initialize and save state between when the user is actively using the application.

Operation912: State changes are reflected on components. For example, a text field bound to some state).

Operation913: State changes can be triggered by components. For example, a text input updating state directly.

Operation914: The user interacts with the UI from their device907.

Operation915: Action chains can call methods on the UI, such as telling a map to zoom.

Operation916: UI can fire action chains to perform logic (i.e. button click).

Operation917: Action chains are used to call REST services and to get data into and out of the system via those services.

Operation918: Page lifecycle manager initializes and destroys state as the user navigates the application and displayed different UI.

Operation919: Page lifecycle manager can fire action chains in response to navigation. For example, the user interacting with the device907can cause a page to be entered and this can fire an action chain to do work in response to that.

Operation920: Action chains can cause navigation, such as activating different parts of the UI.

According to one embodiment, the user interface created by the system900can be executed in the browser of a client computer/device907. The client computer/device that the created user interface executes may be the same client computer/device907that was used to create the user interface or a different client computer/device. The created user interface can be executed on multiple client computer/devices at different times or simultaneously.

As discussed herein, a design time tool is used for creating the user interface. According to one embodiment, the JSON files are created as part of creating the user interface. The JSON files are transported to the browser of a client computer/device using a well-known method of communication and interpreted by runtime for execution.

With respect to Deferred State Mutation the execution flow, according to one embodiment is:

An action chain is invoked (typically by916). An action chain copies state via921. When the action chain completes, it merges the state back also by921.

Example Computer Environment

FIG. 10is a general block diagram of a system1000and accompanying computing environment usable to implement the embodiments of Figures depicted herein, according to one embodiment. The example system1000can support or running various hardware and/or software modules and associated methods discussed with reference toFIG. 9. Note that certain embodiments may be implemented using one or more standalone applications (for example, residing in a user device) and/or one or more web-based applications implemented using a combination of client-side and server-side code.

The general system1000includes user devices1060-1090, including desktop computers1060, notebook computers1070, smartphones1080, mobile phones1085, and tablets1090. The general system1000can interface with any type of user device, such as a thin-client computer, Internet-enabled mobile telephone, mobile Internet access device, tablet, electronic book, or personal digital assistant, capable of displaying and navigating web pages or other types of electronic documents and UIs, and/or executing applications. Although the system1000is shown with five user devices, any number of user devices can be supported.

A web server1010is used to process requests from web browsers and standalone applications for web pages, electronic documents, enterprise data or other content, and other data from the user computers. The web server1010may also provide push data or syndicated content, such as RSS feeds, of data related to enterprise operations.

An application server1020operates one or more applications. The applications can be implemented as one or more scripts or programs written in any programming language, such as Java, C, C++, C #, or any scripting language, such as JavaScript or ECMAScript (European Computer Manufacturers Association Script), Perl, PHP (Hypertext Preprocessor), Python, Ruby, or TCL (Tool Command Language). Applications can be built using libraries or application frameworks, such as Rails, Enterprise JavaBeans, or .NET. Web content can be created using HTML (HyperText Markup Language), CSS (Cascading Style Sheets), and other web technology, including templating languages and parsers.

The data applications running on the application server1020are adapted to process input data and user computer requests and can store or retrieve data from data storage device or database1030. Database1030stores data created and used by the data applications. In an embodiment, the database1030includes a relational database that is adapted to store, update, and retrieve data in response to SQL format commands or other database query languages. Other embodiments may use unstructured data storage architectures and NoSQL (Not Only SQL) databases.

In an embodiment, the application server1020includes one or more general-purpose computers capable of executing programs or scripts. In an embodiment, web server1010is implemented as an application running on the one or more general-purpose computers. The web server1010and application server1020may be combined and executed on the same computers.

An electronic communication network1040-1050enables communication between user computers1060-1090, web server1010, application server1020, and database1030. In an embodiment, networks1040-1050may further include any form of electrical or optical communication devices, including wired network1040and wireless network1050. Networks1040-1050may also incorporate one or more local-area networks, such as an Ethernet network, wide-area networks, such as the Internet; cellular carrier data networks; and virtual networks, such as a virtual private network.

The system1000is one example for executing applications according to an embodiment of the invention. In another embodiment, web server1010, application server1020, and optionally database1030can be combined into a single server computer application and system. In a further embodiment, virtualization and virtual machine applications may be used to implement one or more of the web servers1010, application server1020, and database1030.

In still further embodiments, all or a portion of the web and application serving functions may be integrated into an application running on each of the user computers. For example, a JavaScript application on the user computer may be used to retrieve or analyze data and display portions of the applications.

In a particular example embodiment, the user computing devices1060-1090run browsers, e.g., used to display the user interfaces. User interface may be viewed from a client computing device, such as a desktop computer1060, notebook computer1070, smartphone580, mobile phone1085, tablet1090, ofFIG. 10and/or other computing devices.

In a particular example embodiment, browsers of the desktop computer1060, notebook computer1070, smartphone1080, mobile phone1085, tablet1090ofFIG. 10connect to the Internet, represented by the wired network1040and/or wireless network1050as shown inFIG. 10, to access one or more network-coupled servers, databases, and/or associated cloud-based functionality, as represented by the modules ofFIG. 9. For example, one or more entities901,904,905, and906can reside on an application server1020. The client computer/device907may be implemented as one or more of user computing devices1060-1090. One or more databases1030as shown inFIG. 10may be used to host data, such as persistent store902and state903, associated withFIG. 9. The networks used forFIG. 9can be implemented as networks1040. For example, according to one embodiment, a network1040can be used to communicate between the client computer/device907and components904.

The network220inFIG. 2can include a portion of the wireless network1050or the wired network1040or both. The client application250inFIG. 2can reside on an application server1020and accessed from a user computing device1060-1090. The tool210and the server applications230,240can reside on a server1010or1020. The tool's user interface211and the client application's user interface252can be displayed on a user computing device1060-1090. The user interfaces211,252may be displayed with a browser executing in a user computing device1060-1090.

The client application250, according to one embodiment, is executed by the tool210. In this case, the client application250can reside in the tool210or in memory that the tool210accesses. The client application250can be accessed from one or more user computing devices1060-1090and the pages of the user interface252can be displayed in browsers of those respective user computing devices1360-1390.

FIG. 11is a general block diagram of a computing device1100usable to implement the embodiments described herein. While the computing device1100ofFIG. 11may be described as performing one or more of the steps in the embodiments herein, in other embodiments any suitable component or combination of components of the computing device1100or any suitable processor or processors associated with system1100may facilitate performing the steps.

FIG. 11illustrates a block diagram of an example computing system1100, which may be used for implementations described herein. For example, computing system1100may be used to implement user devices1060-1090, and server devices1010,1020ofFIG. 10as well as to perform the method implementations described herein. In some implementations, computing system1100may include a processor1102, an operating system1104, a memory1106, and an input/output (I/O) interface1108. In various implementations, processor1102may be used to implement various functions and features described herein, as well as to perform the method implementations described herein. While processor1102is described as performing implementations described herein, any suitable component or combination of components of system1100or any suitable processor or processors associated with system1100or any suitable system may perform the steps described. Implementations described herein may be carried out on a user device, on a server, or a combination of both.

Computing device1100also includes a software application1110, which may be stored on memory1106or on any other suitable storage location or computer-readable medium. Software application1110provides instructions that enable processor1102to perform the functions described herein and other functions. The components of computing system1100may be implemented by one or more processors or any combination of hardware devices, as well as any combination of hardware, software, firmware, etc.

For ease of illustration,FIG. 11shows one block for each of hardware processor1102, operating system1104, hardware memory1106, I/O interface1108, and software application1110. These blocks1102,1104,1106,1108, and1110may represent multiple processors, operating systems, memories, I/O interfaces, and software applications. In various implementations, computing system1100may not have all of the components shown and/or may have other elements including other types of components instead of, or in addition to, those shown herein.

A Computer Readable Medium and an Apparatus

Unless otherwise specified, any one or more of the embodiments described herein can be implemented using processor readable instructions which reside, for example, in non-transitory processor-readable storage device of a computer system or like device. The non-transitory processor-readable storage device can be any kind of physical memory that instructions can be stored on. Examples of the non-transitory processor-readable storage device include but are not limited to a disk, a compact disk (CD), a digital versatile device (DVD), read only memory (ROM), flash, and so on. As described above, certain processes and operations of various embodiments of the present invention are realized, in one embodiment, as a series of processor readable instructions (e.g., software program) that reside within non-transitory processor-readable storage device of a computer system and are executed by one or more processors of the computer system. When executed, the instructions cause a computer system to implement the functionality of various embodiments of the present invention. For example, the instructions can be executed by a processor. The processor is a hardware processor, such as a central processing unit, associated with the computer system. The non-transitory processor-readable storage device is hardware memory and the one or more processors are hardware processors. According to one embodiment, a non-transitory processor-readable storage device is a tangible physical device.

An embodiment provides a design time tool that provides deferred state mutation, comprising: one or more processors; and a non-transitory processor-readable storage device including instructions for: receiving information defining action chains implementing part of a client application, wherein the received information includes an explicit computer executable instruction to modify a global state associated with each action chain; automatically generating computer executable instructions for each of the action chains to create respective private views of the global state for each of the action chains; and automatically associating a separate implicit computer executable instruction with each of the explicit computer executable instructions, wherein the implicit computer executable instructions are executed during runtime of the client application instead of the respective explicit computer executable instructions.

CONCLUSION

Particular embodiments may be implemented in a computer-readable storage medium for use by or in connection with the instruction execution system, apparatus, system, or device. Particular embodiments can be implemented in the form of control logic in software or hardware or a combination of both. The control logic, when executed by one or more processors, may be operable to perform that which is described in particular embodiments. For example, a non-transitory medium such as a hardware storage device can be used to store the control logic, which can include executable instructions.

Particular embodiments may be implemented by using a programmed general purpose digital computer, by using application specific integrated circuits, programmable logic devices, field programmable gate arrays, optical, chemical, biological, quantum or nanoengineered systems, etc. Other components and mechanisms may be used. In general, the functions of particular embodiments can be achieved by any means as is known in the art. Distributed, networked systems, components, and/or circuits can be used. Cloud computing or cloud services can be employed. Communication, or transfer, of data may be wired, wireless, or by any other means.