System design is all about planning the systems architecture where the developers have to take some high-level decisions. The developers organize the whole system into subsystems further allocate these subsystems to hardware and software.
During the development of software, the system design stage occurs after the analysis stage. The analysis stage concentrates on what should be done whereas the system design stage concentrates on how it should be done.
Before structuring the architecture of a system, you can take a survey of several systems with similar architecture and draw up their corresponding problems. You can structure an additional architecture combining the information received from the survey. You may not get a solution to all the problems by surveying the previous system but you can resolve many of your problems
Decisions to Devise System Design
- Prepare estimate of systems performance
- Design a reuse plan
- Organize system into subsystems
- Identify concurrency
- Allocate subsystems to hardware
- Manage datastore
- Handle Global resources
- Choose a software control strategy
- Handle boundary conditions
- Select Architectural Style
Estimate System Performance
Before going into design details, you must draw up a rough estimate regarding the performance of the system. You don’t have to be accurate just check whether the system is feasible or not.
Don’t get into many details and don’t be more calculative. Apply your common sense and be fast to make simplifying assumptions.
Designing a Reuse Plan
Reuse is an important feature of object orientation and it is often easy to reuse thing that already exists rather than creating them from scratch.
It is not that following the object-oriented technology you have to develop reusable thing as it would require a lot of experience. Very few developers create new reusable thing rest reuse the existing ones.
While developing software what we can reuse? We can reuse libraries, framework and patterns. Well reusing the models is the most practical form of reuse.
1. Libraries
A library has a collection of classes that can be used in many contexts. In a library, classes must be organized so well that it is easy for the user to find them. Classes must be thoroughly described so that the user gets what he is searching for.
There are many more points for a good reusable library:
- Classes in the library should be arranged around a theme and the classes should show complete behavior.
- Names and signatures of polymorphic operations must be consistent across all the classes in the library
- Library classes must be extensible so that user can easily define subclasses.
2. Frameworks
The framework of an application is an outline of the program which when elaborate helps in constructing the complete application. During elaboration, the users specialize the program by setting its behavior, specific towards an individual application.
Generally, the class library accompanies framework and it is specific to the category of application.
3. Pattern
Pattern encompasses a few classes and relationships whereas the framework is a view of the entire subsystem. Different patterns point to different phases in the lifecycle of software development.
Organizing System into Subsystem
It is a common sense that one can not design the entire system at once. So, the developers have to break the entire system into subsystems. A subsystem is not a class, function, or an object; it is a group of class, association, operations, events. Every subsystem shares a small interface with another subsystem.
Each subsystem has to provide a service to other subsystems from the proper functioning of an application. When it comes to breaking of a system to subsystem it can be organized in two ways as a sequence of the horizontal layer or a sequence of vertical partition.
1. Layers
In the layered system, the layers are designed such that a layer is built in terms of the layer below it whereas it provides the basis for implementing the layer above it.
For example, consider designing the graphical interface i.e. an application window which is implemented using screen operation which in turn is implemented using pixel operations. The layered system can be of two forms of closed layer architecture and open layer architecture.
In the closed layer architecture, each layer is implemented in terms of the immediate layer below it. If any changes are made to a layer it only affects a layer next to it and thereby reduces dependencies between the layers. It is easy to make changes in close layer architecture.
In open layer architecture, a layer can be implemented taking basis as any lower layer i.e. you go to any depth. It’s one advantage is that you don’t need to redefine the operation for each layer. But it has a disadvantage is that if you make any change in a layer then it will affect several layers.
2. Partitions
Breaking the system into subsystems with vertical partition provides several independent systems that are weakly coupled and each subsystem provides one type of service.
For example, in an operating system, you have a file manager, memory management, process control. Each serves a different purpose but avoids more dependencies.
Well, you can divide your system into subsystems by combining the layer and partition technique.
Identify Concurrency
If we talk of the real world all the objects are concurrent. But when we implement object in the system a single processor can support many objects if all of them are not active at a time. Although a single processor supports many objects.
Objects that are active mutually can be folded to a single thread of control.
Identify Inherent Concurrency
Inherent concurrency occurs when two distinct objects receive events at the same point of time without any interaction. The two inherently concurrent objects can be implemented in a single hardware unit.
Allocate Subsystem to Hardware
Now, after decomposing a system into a subsystem you have to allocate subsystems to the hardware unit. A hardware unit can be a processor or a functional unit.
First, you have to prepare a rough estimate of what hardware resources would be required for a good performance. Then decide whether you allocate the subsystem to a hardware or software.
Allocate task to the processors for various software subsystems. Checkout the connectivity between the physical units in which you have implemented subsystems.
Managing Data Store
Data structures, database, files are the kind of data stores that you can use individually or in combination. Each has its own accessing time, cost, reliability and many other trade-offs which are considered for choosing appropriate data store for the subsystems.
Managing Global Resources
It is the responsibility of a system designer to discover the global resources of the system. The system designer must also build a mechanism to access and control global resources.
Global resources could be physical units such as processors, space such as disk space, logical names such as class names or file names. It could also to access to the shared database.
Determine a Software Control Strategy
It is not important that you should implement the same control flow for all subsystem but it is better to choose a single kind of control flow for the entire system.
There are two kinds of control flow external control flow and internal control flow.
1. External Control Flow
The external control flow is further classified into three types of procedure-driven control flow, event-driven and concurrent. The procedure driven control flow the procedure makes a call for external input and wait for the input to arrive. When the input arrives, the control resumes to the procedure that had requested for the input. Here the control lies within the program code.
In event-driven control, the control lies in the dispatcher. The system developer attaches procedures of the application to the events and whenever the events occur the dispatcher call out the procedure (call back). The procedure calls dispatcher to send the input and transfer the control to dispatcher rather than holding the control until input arrives.
In the concurrent control, the control lies with several independent objects concurrently. When an object with a task waits for some input the other objects with task keeps on executing.
2. Internal Control Flow: In the internal control flow the control lies inside the process.
Handling Boundary Conditions
Apart from the steady-state behavior of the system, the developers must also address the boundary condition of the system like initialization, termination and failure.
A system must be able to initialize the global variables, guardian object, constant data, class hierarchy by itself. Termination of the system is easier. It must release the resources the reserved resources, however, the system with concurrent tasks must inform the other task about the termination of the system.
An unorganized termination of a system is termed as failure. Failure may arise due to the errors or exhaustion of the resources or a system breakdown. So, a developer should design a system with a perfect exit plan on the occurrence of any error.
Set Architectural Style
You can choose the architectural style based on the features of your application. You can use the architectural style as a starting point for designing the system it reduces your efforts. Below we have discussed some architectural styles:
- Batch transformation architecture executes the transformation on the entire input set at once
- Continuous transformation architecture performs continuous execution on the inputs arriving one after other.
- Interactive interface architecture is one where external interaction is more
- Dynamic simulation architecture is one which simulates the evolving of the real-world object.
- The real-time system architecture is one which has constraints over timing.
- Transaction manager architecture which involves updating, storing the concurrent transaction from a physically distinct location.
So, this is all about system designing. We have studied the steps required to be followed by the developer while designing a system.
Manoj Kumar says
Very Informative and Useful Article on System Design. I really Appreciate to author for writing such an informative article.