Stream-based programming processes data in a stream using encapsulated modules that communicate through an external messaging system. Each module is self-contained and can be used in any order, making it useful for distributed and web-based systems. Data is sent through ports and the messaging system handles program flow. The modular design allows for easier debugging and upgrading.
Stream-based programming is a method of designing applications and computer architectures that differs from traditional structured methods of application design in that data is intended to be processed in a stream by unrelated components and uses an external messaging system to to communicate . In stream-based programming, the focus is on transforming data using different components, which are essentially encapsulated modules or functions that have no direct connection to the other program components. Each of the data streams and other events is handled by an external message passing system which is no different than some types of network protocols, where a packet of information (IP) is delivered to a module through the use of an abstract door. This component-based design view allows an application to have separately developed code modules that just need to respond to a system message, process an IP, and then release the IP into the system. This approach is useful on distributed systems, Internet- and networked systems, and Web-based program architectures such as e-commerce servers.
One of the fundamental building blocks of flow-based programming is the idea of an isolated node, process, or module. This can be thought of as a piece of program source code that has no direct dependencies on other modules, making the module almost a self-contained piece of the application that can be called whenever needed. Each component does not rely on being called sequentially with another component, so the components of an application can be organized and used in any order, allowing for multiple unique data streams to exist as information moves through the system .
Each of the individual modules in stream-based programming accepts data through an abstract interface known as a port, which functions much like a data port within a computer network. Data is sent to a port through a buffer that is small in size but turns multiple IPs into one stream that is constantly being sent to the port. A single port can address multiple instances of a single component, making the framework easy to use on a distributed system or for parallel processing.
The data contained in an information packet is maneuvered through the forms by an external messaging system. In stream-based programming, this messaging system is separate from modules and IPs and only handles program flow through the use of buffers attached to ports. The messaging system basically has no knowledge of what the modules are or are doing, and no real concern about what data is contained within the IPs the modules are processing.
The divisions and modularity of each of the components that make up flow-based programming applications lend themselves well to processes such as debugging and team-oriented development. Much of the code is encapsulated, so the source code has high reusability potential. This also means that upgrading or scaling an application that uses flow-based programming can be easier than a more integrated application, as the messaging system, modules and port system can be changed independently without affecting the larger program.
Protect your devices with Threat Protection by NordVPN