FIELD AND BACKGROUND OF THE INVENTION

Some embodiments described in the present disclosure relate to a computerized system for executing a software program and, specifically, but not exclusively, to an integrated development environment.

As used herewithin, each of the terms “software program” and “computer program” is used to mean a collection of data and computer instructions instructing one or more hardware processors how to operate in order to perform one or more identified tasks. A software program may be organized in one or more intercommunicating components, executed by the one or more hardware processors. Henceforth the terms “software program” and “computer program” are used interchangeably.

For brevity, henceforth the term “event” is used to mean “data event”, and the terms are used interchangeably.

As used herewithin, the term “event driven software program” refers to a software program whose control flow, i.e. the order in which data-processing steps of the software program are executed, is driven by data events received by the software program, and additionally or alternatively by other data events generated by one or more data-processing steps of the software program. The term “data-flow”, as used herewithin, refers to a sequence of data-processing steps in an identified order, ignoring the actual processing of data.

Software programs are increasingly becoming more complex than before, and there exist software programs comprising hundreds, thousands, and hundreds of thousands of separate computation tasks. The mere size of a software program makes it difficult for a software developer to understand how the software program operates, and consequently makes maintenance and further development of the software program more difficult and thus more expensive. In addition, common code organization practices increase the difficulty of understanding and maintaining software programs.

Commonly, a code base of a software program is organized into separate layers based on technological affinity. For example, user-interface code is kept separate from interfaces (API) code and from server business logic code and so on. This source code organization is not conductive to exploration and understanding of the core functionality of the software program, as functions from different layers of functionality are often executed one after the other in the same execution thread with no correlation to their order in the code base. In addition, code representing a data flow of a software program, and its conditional branching is interleaved with the code for executing data-processing steps, and further abstracted by modern software paradigms such as polymorphism and inversion-of-control. The result is that a data-flow, which in general can be perceived as a sequence of processing steps that are needed to perform a specific task, is hard to discern from the code. Applications that adhere to an event-driven architecture may be even harder to follow as the order of execution may depend on runtime order of processed events.

Not all man-made systems share such complexity related problems. One example would be modern cities, which arguably surpass other man-made systems in their complexity. Modern cities are built around a transportation infrastructure of highways, roads and streets. This built-in infrastructure standardizes transportation around the city and also allows to abstract the problem of orientating and navigating around the city into street maps. These maps are an abstraction of the transportation infrastructure. Street maps can be further enhanced and automated by computerized turn-by-turn navigation systems, simplifying further the task of navigating between any two points in the city. This example shows that a complex system built around an appropriate organizing principle can avoid many of the problems attributed to complexity.

Current large scale software systems do not have a comparable organizing principle that helps in understanding and navigating their processes and code bases. This results in high learning curves and lowers productivity of software teams responsible for developing and maintaining those systems.

SUMMARY OF THE INVENTION

It is an object of some embodiments of the present disclosure to describe a system, a method and mechanisms for modeling, design and execution of an event-driven software program based on a graph-based representation of the software program. This method and mechanisms can also be viewed as a new kind of event-driven software program architecture and an infrastructure that implements this architecture. In some embodiments the disclosed system and method are based on a concept of a routing graph. In such embodiments, the routing graph is a tree shaped graph, i.e. a directed acyclic graph where each child has at most a single parent. In such embodiments the routing graph comprises a plurality of routing nodes that route events to their children or back to their parent, and a plurality of data-processing nodes that process the events, producing additional events, and are leaves of the routing graph.

This graph structure of code functions resides within memory of a computer process or several computer processes, where computer processes may be run either by a single computing device or several such devices interconnected by networking, and is executed by a computer central processing unit (cpu), one or plural.

The routing graph effectively decouples a data-flow of a software program, executed by the plurality of routing nodes, from event data processing, executed by the plurality of data-processing nodes. A hierarchical structure of the routing graph allows to represent the software program as a graph of steps refined by task decomposition. The routing graph also allows to visualize and simulate a flow of events in the software program, separate from specific data processing steps taking place. The effect is a significant streamlining of the main aspects of software applications development, from application design to coding, maintenance and operations.

In addition, the routing graph nodes may serve as a scaffold containing generic functionality that may be implemented once and reused by one or more other software programs built on top of the routing graph. Having this functionality already implemented frees the software developers to focus on the specific tasks that need to be accomplished by the software program.

According to a first aspect of the invention, a system for executing a software program comprises at least one hardware processor adapted for: accepting a software program organized in a plurality of execution nodes comprising a plurality of data-processing nodes, each having a processing function of the software program, and a plurality of routing nodes for delivering program data between the plurality of data-processing nodes, where the plurality of execution nodes is organized in a directional acyclic graph (routing graph) having one root node of the plurality of routing nodes such that each of the plurality of execution nodes not the root node has a parent node of the plurality of routing nodes, each of the plurality of routing nodes has a plurality of child nodes of the plurality of execution nodes, and each of the plurality of data-processing nodes has no child nodes; and in each of a plurality of recursive steps, executing one of the plurality of execution nodes by: receiving an event comprising at least some of the program data from the execution node's parent node or from one of the execution node's plurality of child nodes; subject to the execution node being a routing node: providing the event to at least one child node of the execution node's plurality of child nodes, identified according to a routing classification of the execution node; executing the at least one child node in at least one other of the plurality of recursive steps; subject to failing to identify the at least one child node or at least one executed data-processing node descendant from the node in the routing graph, providing the event to the execution node's parent node for execution of the parent node in at least one additional other of the plurality of recursive steps; and subject to the execution node being a data-processing node: accepting the event according to an outcome of applying at least one acceptance test to the event; and subject to accepting the event, applying the data-processing node's processing function to the event's at least some of the program data to produce an outcome event and providing the execution node's parent node with the outcome event for execution of the parent node in at least one further additional other of the plurality of recursive steps.

According to a second aspect of the invention, a method for executing a software program comprises: accepting a software program organized in a plurality of execution nodes comprising a plurality of data-processing nodes, each having a processing function of the software program, and a plurality of routing nodes for delivering program data between the plurality of data-processing nodes, where the plurality of execution nodes is organized in a directional acyclic graph (routing graph) having one root node of the plurality of routing nodes such that each of the plurality of execution nodes not the root node has a parent node of the plurality of routing nodes, each of the plurality of routing nodes has a plurality of child nodes of the plurality of execution nodes, and each of the plurality of data-processing nodes has no child nodes; and in each of a plurality of recursive steps, executing one of the plurality of execution nodes by: receiving an event comprising at least some of the program data from the execution node's parent node or from one of the execution node's plurality of child nodes; subject to the execution node being a routing node: providing the event to at least one child node of the execution node's plurality of child nodes, identified according to a routing classification of the execution node; executing the at least one child node in at least one other of the plurality of recursive steps; subject to failing to identify the at least one child node or at least one executed data-processing node descendant from the node in the routing graph, providing the event to the execution node's parent node for execution of the parent node in at least one additional other of the plurality of recursive steps; and subject to the execution node being a data-processing node: accepting the event according to an outcome of applying at least one acceptance test to the event; and subject to accepting the event, applying the data-processing node's processing function to the event's at least some of the program data to produce an outcome event and providing the execution node's parent node with the outcome event for execution of the parent node in at least one further additional other of the plurality of recursive steps.

According to a third aspect of the invention, a software program product for executing a software program comprises: a non-transitory computer readable storage medium; first program instructions for accepting a software program organized in a plurality of execution nodes comprising a plurality of data-processing nodes, each having a processing function of the software program, and a plurality of routing nodes for delivering program data between the plurality of data-processing nodes, where the plurality of execution nodes is organized in a directional acyclic graph (routing graph) having one root node of the plurality of routing nodes such that each of the plurality of execution nodes not the root node has a parent node of the plurality of routing nodes, each of the plurality of routing nodes has a plurality of child nodes of the plurality of execution nodes, and each of the plurality of data-processing nodes has no child nodes; and second program instructions for in each of a plurality of recursive steps, executing one of the plurality of execution nodes by: receiving an event comprising at least some of the program data from the execution node's parent node or from one of the execution node's plurality of child nodes; subject to the execution node being a routing node: providing the event to at least one child node of the execution node's plurality of child nodes, identified according to a routing classification of the execution node; executing the at least one child node in at least one other of the plurality of recursive steps; subject to failing to identify the at least one child node or at least one executed data-processing node descendant from the node in the routing graph, providing the event to the execution node's parent node for execution of the parent node in at least one additional other of the plurality of recursive steps; and subject to the execution node being a data-processing node: accepting the event according to an outcome of applying at least one acceptance test to the event; and subject to accepting the event, applying the data-processing node's processing function to the event's at least some of the program data to produce an outcome event and providing the execution node's parent node with the outcome event for execution of the parent node in at least one further additional other of the plurality of recursive steps; wherein the first and second program instructions are executed by at least one computerized processor from the non-transitory computer readable storage medium.

With reference to the first and second aspects, in a first possible implementation of the first and second aspects of the present invention the routing classification of the execution node is selected from the group of routing classifications consisting of: sequential-routing, wherein subject to receiving the event from the execution node's parent node the at least one child node is a first child node of the execution node's plurality of child nodes in an identified order thereof and subject to receiving the event from a child node the at least child node is a consecutive child node following the child node in the identified order; parallel-one-shot-routing, wherein subject to receiving the event from the execution node's parent node the at least one child node consists of the execution node's plurality of child nodes, otherwise no at least one child node is identified; parallel-re-entrant-routing, wherein the at least one child node consists of the execution node's plurality of child nodes subject to a generation counter of the event being less than a maximum generation value, otherwise no at least one child node is identified; parallel-choose-branch-routing, wherein the at least one child node comprises the execution node's plurality of child nodes, subject to a check that that each descendent accepting data-processing node in the at least one child node is a single child node or a descendant of a single child node; and dual-routing, wherein: the execution node's plurality of child nodes is organized in a sequence of groups of child nodes, subject to receiving the event from the execution node's parent node the at least one child node consists of a first group of child nodes according to the sequence of groups of child nodes, and subject to receiving the event from a child node being a member of a group of child nodes, the at least one child node consists of another group of child nodes consecutive to the group of child nodes in the sequence of groups of child nodes.

With reference to the first and second aspects, in a second possible implementation of the first and second aspects of the present invention applying the at least one acceptance test to the event comprises comparing at least one data value of the event's at least some of the program data to at least one reference data value. Optionally, the event further comprises a plurality of metadata values indicative of a plurality of characteristics of the event. Optionally, the at least one hardware processor is further adapted for updating at least one of the plurality of metadata values according to the outcome of applying the at least one acceptance test to the event. Optionally, applying the at least one acceptance test to the event comprises at least one of: comparing at least one other of the plurality of metadata values to at least one reference metadata value, and comparing at least one data value of the payload record to at least one reference data value. Optionally, the at least one hardware processor is further adapted for: in at least one of the plurality of recursive steps when executing an identified execution node of the plurality of execution nodes where the identified execution node is one of the plurality of routing nodes: subject to the identified execution node receiving a first event from the identified execution node's parent node, recording an association between at least one metadata value of the event's plurality of metadata values and the at least one child node identified according to the routing classification of the identified execution node; and in at least one other of the plurality of recursive steps, when executing the identified node: subject to the identified execution node receiving a second event from the identified execution node's parent node and subject to the second event's plurality of metadata values comprising the at least one metadata value, identifying the at least one child node according to the recorded association instead of according to the respective routing classification of the identified execution node.

With reference to the first and second aspects, in a third possible implementation of the first and second aspects of the present invention the at least one hardware processor is further adapted for: accessing a description of the plurality of execution nodes comprising for each of the plurality of execution nodes an association between the execution node and the plurality of child nodes thereof; and generating an executable graph by generating for each of the plurality of execution nodes a plurality of node computer instruction according to the respective description thereof. Optionally, executing one of the plurality of execution nodes comprises executing the plurality of node computer instructions generated therefor. Optionally, accessing the description of the plurality of execution nodes comprises at least one of: retrieving at least one file from a non-volatile digital storage connected to the at least one hardware processor, and receiving at least one file via at least one digital communication network interface connected to the at least one hardware processor.

With reference to the first and second aspects, or the third implementation of the first and second aspects, in a fourth possible implementation of the first and second aspects of the present invention the description of the plurality of execution nodes comprises a description of at least one template execution node. Optionally, the respective description of at least one of the plurality of execution nodes comprises a reference to the description of the at least one template execution node and generating the respective plurality of node computer instruction for the at least one execution node is further according to the description of the at least one template execution node. Optionally, for at least one other of the plurality of execution nodes, generating the respective plurality of node computer instructions thereof comprises adding a plurality of wrapper computer instructions. Optionally, a respective processing function of at least one of the plurality of data processing nodes is a system function, selected from the list of system functions consisting of: handling an exception, unwinding a sequences of event, and session management. Optionally, the at least one hardware processor is further adapted for: accessing another description of another plurality of execution nodes comprising another plurality of data-processing nodes and another plurality of routing nodes and organized in another routing graph having another root node of the other plurality of routing nodes; and adding the other description of the other plurality of execution nodes to the description of the plurality of execution nodes such that the other root node is a child of one of the plurality of routing nodes. Optionally, the at least one hardware processor is further adapted for, while executing the plurality of recursive steps: accessing an updated description of another plurality of execution nodes, where the other plurality of execution nodes comprises at least one of: a new execution node not a member of the plurality of execution nodes and an updated execution node modifying one of the plurality of execution nodes, and additionally or alternatively the plurality of execution nodes comprises at least one removed execution node not a member of the other plurality of execution nodes; and generating an updated executable graph by modifying the executable graph according to the updated description of the other plurality of execution nodes.

With reference to the first and second aspects, or the third implementation of the first and second aspects, in a fifth possible implementation of the first and second aspects of the present invention the at least one hardware processor is further adapted for generating the description of the plurality of execution nodes comprising receiving from a user description data describing the plurality of execution nodes. Optionally, the at least one hardware processor receives the description data via at least one of: a file, an application programming interface (API) executed by the at least one hardware processor, and a user interface executed by the at least one hardware processor. Optionally, the at least one hardware processor is further adapted for displaying a visual representation of the routing graph on at least one display device connected to the at least one hardware processor. Optionally, the visual representation comprises a first display area for displaying at least some of the plurality of routing nodes and a second display area for displaying at least some of the plurality of data-processing nodes. Optionally, the user interface is executed in an integrated development environment (IDE) executed by the at least one hardware processor. Optionally, the IDE further comprises code for: providing a test event to an identified execution node of the routing graph; and comparing at least one test outcome of executing the plurality of recursive steps in response to the test event to at least one expected outcome. Optionally, the IDE further comprises code for debugging execution of the software program when executing the plurality of execution nodes.

With reference to the first and second aspects, in a sixth possible implementation of the first and second aspects of the present invention the at least one hardware processor comprises at least one first hardware processor and at least one second hardware processor. Optionally the routing graph comprises a plurality of sub-graphs, each comprising some of the plurality of routing nodes and some of the plurality of data-processing nodes. Optionally, for at least a first sub-graph of the plurality of sub-graphs, the first sub-graph's respective plurality of routing nodes and plurality of data-processing nodes are executed by the at least first hardware processor, for at least a second sub-graph of the plurality of sub-graphs, the second sub-graph's respective plurality of routing nodes and plurality of data-processing nodes are executed by the at least second hardware processor.

Other systems, methods, features, and advantages of the present disclosure will be or become apparent to one with skill in the art upon examination of the following drawings and detailed description. It is intended that all such additional systems, methods, features, and advantages be included within this description, be within the scope of the present disclosure, and be protected by the accompanying claims.

Unless otherwise defined, all technical and/or scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which embodiments belong. Although methods and materials similar or equivalent to those described herein can be used in the practice or testing of embodiments, exemplary methods and/or materials are described below. In case of conflict, the patent specification, including definitions, will control. In addition, the materials, methods, and examples are illustrative only and are not intended to be necessarily limiting.

