Design is the bridge between the requirements and the code. A good design makes the later stages easy, while a poor design makes them costly.

Basic Concepts of Software Design

Software design is the process of converting the SRS into a plan of how the system will be built. It has two levels. In high-level design, or architectural design, the system is divided into modules and the relations among them are decided. In low-level design, or detailed design, the internal logic of each module is worked out. The outputs are design documents that the coders use. A design should be correct, efficient, simple, and easy to maintain, and it should be traceable to the requirements.

Definition: Software design. The process of converting the requirements of a system into a description of its structure and the logic of its components, from which it can be coded.

Design Principles

Problem partitioning splits a large problem into smaller ones. Abstraction shows what a component does without showing how. Top-down and bottom-up approaches decide the order of designing. Modularity divides the system into modules with clear interfaces, each of which can be built and tested alone. Information hiding keeps decisions that are likely to change inside one module. Divide and conquer keeps each part small enough to understand. The size of a module is important, since too small a module increases the cost of the interfaces, and too large a one is hard to understand.

Architectural Design

Architectural design defines the major components of the system, their responsibilities and how they communicate. It decides the structure of the system, such as layers or client-server, the control among the parts, and the data that they share. The common architectural styles are the layered style, with presentation, logic and data layers, the client-server style, in which many clients use a central server, the pipe and filter style, in which data flow through a chain of processing steps, the repository style, in which components share a central database, and the model-view-controller style, which separates the data, the display and the control. The architecture is described with diagrams of the components and their connections, and it affects the performance, security and maintainability of the final system.

Table 3.1: Architectural styles

Style Description Example
Layered Layers use services of the layer below Web application
Client-server Clients request, server provides Email
Pipe and filter Data pass through filters Compiler
Repository Components share one data store Hospital records
MVC Separates data, view and control Web frameworks

Example 3.1: Choosing an architecture

Problem: A college wants a result portal in which students see results in a browser, rules are applied to the marks, and the data are kept in a database. Suggest an architecture.

Solution:

  1. Display, rules and data are three separate concerns.
  2. A layered architecture with a presentation layer, a business layer and a data layer keeps them apart.

Result: A three-layer architecture, deployed as client-server, is suitable.

Common mistakes

  • Making modules too large or too small.
  • Choosing an architectural style without checking the requirements for performance and security.
  • Allowing the presentation layer to access the database directly, which breaks the layers.

Key takeaways

  • High-level design gives modules and their relations, and low-level design gives the logic of each module.
  • Modularity, abstraction and information hiding are key design principles.
  • Common styles are layered, client-server, pipe and filter, repository and MVC.
  • The architecture affects performance, security and maintainability.

Practice questions

  1. Distinguish high-level and low-level design.
  2. What is architectural design?
  3. Name two architectural styles.

Answers to the practice questions

  1. High-level design divides the system into modules and their relations, low-level design details the logic inside each module.
  2. Defining the major components of the system, their responsibilities and how they communicate.
  3. Layered and client-server (also pipe and filter, repository and MVC).

Sources

  • Official BCA syllabus Advanced Software Engineering, course code 25BCA405DS01, Unit III