6.7. Design#

After the specifications have been decided, the software design stage defines how the software will be structured to fulfill those specifications. The design should be a blueprint of how the application will be built.

The design must be informative enough so that development tasks can be assigned to individuals or teams in the organisation to complete. The design documents usually are a combination of:

6.7.1. Elements of a Design#

System Architecture#

System architecture outlines how the system’s high-level components database, application servers, front-end work together.

The best way to do this is with a diagram, since it allows everyone on the team to understand the big picture quickly, rather than having to read a long description.

Example

From the Netflix Tech Blog https://netflixtechblog.com/netflix-billing-migration-to-aws-part-iii-7d94ab9d1f59

../../_images/billing_mysql_db_architecture.jpeg

Data Model#

Data model is where the database tables and columns are defined. You can write the specifications or create diagrams. Common diagram types are UML class diagrams and entity-relationship diagrams.

Example:

  • A users table with id, username, password_hash, email.

  • A reviews table referencing a users table if each review is linked to an author.

  • A comments table referencing both reviews (via review_id) and users (via user_id) for comment ownership.

Modules and Functions#

The code can and should be broken down into smaller modules or components that can be assembled together to form the larger application.

A highly detailed design would also specify which functions are to be built and how they should behave such as parameters and return values.

6.7.2. Examples#

Specification

“Passwords must be stored using a salted SHA256 hash.”

Design

“Create an auth module with a function hash_password(password) that uses hashlib.sha256 for hashing. Store the resulting hash in the users table.”

6.7.3. Glossary#

Blueprint#

A plan that describes how an application will be built.

Block diagram#

A diagram that shows the high-level architecture or components of a system.

Class diagram#

A diagram that shows models, objects, and their relationships.

User workflow sequence#

A description or diagram of how users move through a system.

System architecture#

The high-level structure of a system, including components such as databases, application servers, and front ends.

Data model#

A definition of the database tables, columns, and relationships used by an application.

Entity-relationship diagram#

A diagram showing database entities and the relationships between them.

Module#

A smaller part of a codebase that can be assembled with other parts to form a larger application.