0% found this document useful (0 votes)
354 views

Software Architecture Cheat Sheet For Daily Usage

The document discusses a software architecture cheat sheet for daily usage. It provides principles for loose coupling, high cohesion, and local changes. It also outlines design principles like the single responsibility principle and dependency inversion principle. The cheat sheet also includes guidelines for high-level design, environment, dependencies, and references additional resources on software architecture.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
354 views

Software Architecture Cheat Sheet For Daily Usage

The document discusses a software architecture cheat sheet for daily usage. It provides principles for loose coupling, high cohesion, and local changes. It also outlines design principles like the single responsibility principle and dependency inversion principle. The cheat sheet also includes guidelines for high-level design, environment, dependencies, and references additional resources on software architecture.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

24/8/2021 Software Architecture Cheat Sheet for Daily Usage | by Ali Zeynalli | Aug, 2021 | Medium

Get started Open in app

Ali Zeynalli
390 Followers About Follow

You have 2 free member-only stories left this month. Sign up for Medium and get an extra one

Software Architecture Cheat Sheet for Daily


Usage
Software Architecture smells and heuristics

Ali Zeynalli Aug 5 · 3 min read

https://azeynalli1990.medium.com/software-architecture-cheat-sheet-for-daily-usage-9923922ea75b 1/6
24/8/2021 Software Architecture Cheat Sheet for Daily Usage | by Ali Zeynalli | Aug, 2021 | Medium

Get started Open in app

Photo by Jacob Sapp on Unsplash

Having clean software architecture and staying conform to pre-defined design principles
from start of the project is one of the best ways to avoid possible technical debt in the
future of that software system. Clean Software Design is a key point for an effective
software product.

Let us have a look at some important principles, rules, guidelines that ensure a clean
software design:

Principles:

1. Loose Coupling — if classes use each other, they are coupled together. The less
classes are coupled, the easier is to change them.

2. High Cohesion — degree to which elements of a whole belong together. Components


of the class should be highly cohesive.

3. Only Local Changes — Changes, maintenance, extensions are only local. This leads to
no harming whole environment.

https://azeynalli1990.medium.com/software-architecture-cheat-sheet-for-daily-usage-9923922ea75b 2/6
24/8/2021 Software Architecture Cheat Sheet for Daily Usage | by Ali Zeynalli | Aug, 2021 | Medium

4. Easy to Remove — Software Components should be easily removeable.


Get started Open in app
5. Small Components — software system should be only of small components ideally
each doing only one task.

Class Design:

1. Single Responsibility Principle (SRP) — class should do only one task.

2. Open Closed Principle (OCP) — class should be extended not modified.

3. Liskov Substitution Principle (LSP) — derived classes must be substitutable for their


base classes.

4. Dependency Inversion Principle (DIP) — depend on abstractions, not on concretions.

5. Interface Segregation Principle (ISP) — interfaces should be fine-grained

6. Classes Should be Small.

7. Do stuff or know others, but not both.

Cohesion Principles:

1. Release Reuse Equivalency Principle (RREP) — only together releaseable components


should be bundled together.

2. Common Closure Principle (CCP) — classes that change together should be bundled
together.

3. Common Reuse Principle (CRP) — classes that are used together should be bundled
together.

Coupling Principles:

1. Acyclic Dependencies Principle (ADP) — no dependency cycles.

2. Stable Dependencies Principle (SDP) — depend on direction of stability.

3. Stable Abstractions Principle (SAP) — the more abstract, the more stable.

https://azeynalli1990.medium.com/software-architecture-cheat-sheet-for-daily-usage-9923922ea75b 3/6
24/8/2021 Software Architecture Cheat Sheet for Daily Usage | by Ali Zeynalli | Aug, 2021 | Medium

High-Level Design:
Get started Open in app

1. Keep Configurable Data at High Levels — constants or config datas should be kept in
high level.

2. Don’t Be Arbitrary — have a convention, principle, rule or guidelines and always


follow them.

3. Prefer Polymorphism To If/Else or Switch/Case.

4. Symmetry / Analogy — Favour symmetric designs (e.g. Load — Save) and designs
that follow analogies (e.g. same design as found in .NET framework).

5. Separate Multi-Threading Code — isolate multi-thread from rest of the code.

6. Code at Wrong Level of Abstraction — stay conform to existing abstraction layers.

7. Fields Not Defining State — fields holding data that does not belong to the state of the
instance but are to hold temporary data. Use local variables or extract to a class
abstracting the performed action.

8. Micro Layers — avoid unnecessary design layers.

Environment:

1. Project Build Requires Only One Step.

2. Executing Tests Requires Only One Step.

3. Source Control System — Always use a source control system.

4. Continuous Integration — Assure integrity with Continuous Integration.

5. Overridden Safeties — Do not override warnings, errors, exception handling

Dependencies:

1. Make Logical Dependencies Physical — If one module depends upon another, that
dependency should be physical not just logical. Don’t make assumptions.

2. Singletons / Service Locator — Make use of dependency injection.

https://azeynalli1990.medium.com/software-architecture-cheat-sheet-for-daily-usage-9923922ea75b 4/6
24/8/2021 Software Architecture Cheat Sheet for Daily Usage | by Ali Zeynalli | Aug, 2021 | Medium

3. Base Classes Depending On Their Derivatives — Base classes should work with any
Get started Open in app
derived class.

4. Feature Envy — The methods of a class should be interested in the variables and
functions of the class they belong to, and not the variables and functions of other
classes. Using accessors and mutators of some other object to manipulate its data, is
envying the scope of the other object (c).

5. Artificial Coupling — Things that don’t depend upon each other should not be
artificially coupled.

6. Hidden Temporal Coupling — If the order of some method calls is important, then
make sure that they cannot be called in the wrong order.

7. Transitive Navigation — (Law of Demeter), writing shy code. A module should know
only its direct dependencies.

Please have a look at my other blog series for deeper understanding of these rules,
principles, guidelines:

How to apply SOLID Software Design Principles to Spring Boot Application

How to apply Component Cohesion Principles to Spring Boot Application

Ultimate Guide to Clean Code with over 30 Java Refactoring Examples

10 Software Design Patterns used in Java Core Libraries

Software Architecture Patterns for Front-End Development

The Books like “Clean Code”, “Clean Coder” and “Clean Architecture” from R.C.Martin
are main sources for this article.

https://azeynalli1990.medium.com/software-architecture-cheat-sheet-for-daily-usage-9923922ea75b 5/6
24/8/2021 Software Architecture Cheat Sheet for Daily Usage | by Ali Zeynalli | Aug, 2021 | Medium

P.S. You can connect with me on twitter or linkedin.


Get started Open in app

Get an email whenever Ali Zeynalli publishes.

Your email

Subscribe

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information
about our privacy practices.

Software Architecture Software Design Software Engineering Clean Code Clean Architecture

About Write Help Legal

Get the Medium app

https://azeynalli1990.medium.com/software-architecture-cheat-sheet-for-daily-usage-9923922ea75b 6/6

You might also like