Introduction:
Did you ever posed the question: How large software in industrial scale systems are designed ?
Here I'll explain to you the most 10 common software architectural patterns one by one.
Before beginning the software development, we have to understand the requirement, then we have to choose a suitable architecture that will provide us the desired functionality and quality attributes.
What is the meaning of Architectural Pattern and why it's a very essential step ?
1. Layered pattern:
This pattern can be used to structure programs that can be decomposed into groups of subtasks, each of them is at a particular level of abstraction. Each layer provides services to the next higher layer.Layered pattern |
As you can see in figure 'Layered pattern' The most commonly found 4 layers of a general information system are :
- Presentation layer (also known as UI layer)
- Application layer (also known as service layer)
- Business logic layer (also known as domain layer)
- Data access layer (also known as persistence layer)
The power of the layered architecture pattern is the separation of concerns among components which means that components within a specific layer deal only with logic that pertains to that layer.
This type of component classification makes it easy to build ,effective roles and responsibility models into your architecture, and also makes it easy to develop, test, govern, and maintain applications using this architecture pattern due to well-defined component interfaces and limited component scope.
The layered pattern architectures have been around since the beginning of digital computers (since the early 1960s), There is many examples of using this pattern in the systems you use every day, let's take for example the famous OSI seven-layer model that facilitates communication between computers. Here each layer provides a higher level of functionality than the layer below it
OSI model |
2-Client-server pattern:
Client Server model |
3-Master-slave pattern:
Master-Slave pattern is also used for user interfaces and servers. In both cases the master listens for commands coming either from the user or from clients. When a command is received, a slave is launched to execute the command while the master resumes listening for more commands (such as the "suspend the last command" command.)
- In database replication, the master database is regarded as the authoritative source, and the slave databases are synchronized to it.
- Peripherals connected to a bus in a computer system (master and slave drives).
4-Pipe-filter pattern:
This pattern can be used to structure systems which produce and process a stream of data. Each processing step is enclosed within a filter component. Data to be processed is passed through pipes. These pipes can be used for buffering or for synchronization purposes.We use the Pipes and Filters architectural style to divide a larger processing task into a sequence of smaller, independent processing steps (Filters) that are connected by channels (Pipes).
- Compilers. The consecutive filters perform lexical analysis, parsing, semantic analysis, and code generation.
- Workflows in bioinformatics
5-Broker pattern:
Broker pattern |
6-Peer-to-peer pattern:
- File-sharing networks such as Gnutella and G2)
- Multimedia protocols such as P2PTV and PDTP.
7-Event-bus pattern:
This pattern primarily deals with events and has 4 major components; event source, event listener, channel and event bus. Sources publish messages to particular channels on an event bus. Listeners subscribe to particular channels. Listeners are notified of messages that are published to a channel to which they have subscribed before.- Android development
- Notification services
- Dbus communication
- Model: Contains the core functionality and data
- View: Displays the information to the user (more than one view may be defined)
- Controller: Handles the input from the user. This is done to separate internal representations of information from the ways information is presented to, and accepted from, the user. It decouples components and allows efficient code reuse.
- Architecture for World Wide Web applications in major programming languages.
- Web frameworks such as Django and Rails.
9. Blackboard pattern:
- blackboard: a structured global memory containing objects from the solution space knowledge
- source: specialized modules with their own representation control
- component: selects, configures and executes modules.
- Reusability
- Changeability
- Robustness.
Usage:
- speech recognition
- vehicle identification and tracking
- protein structure identification
- sonar signals interpretation.