Software Design
Principles
for Evolving
Architectures
Firat Atagun
Principles
DRY – Don’t repeat yourself.
Every knowledge in a system must have a single authoritative,
unambiguous representation. – Pragmatic Programmers
YAGNI – You aren’t gonna need it.
Embrace principle of last responsible moment
Postpone decisions until you can’t postpone them any further.
Courage is postponing the decisions tomorrow to tomorrow. – Kent Beck.
KISS- Keep it simple and stupid
Simple keeps focus
Inherent & Accidental Complexity
Good software design hides inherent complexity and avoids accidental
complexity.
Principle of Cohesion
High cohesion & Low Coupling
Removing and reducing coupling creates better design.
Avoid long methods
• Hard to test
• Hard to reason
• Hard to debug
• Hard to change
• Increases coupling, decreases cohesion
SLAP – Single level of abstraction principle and compose method
pattern to the rescue.
Principle of least knowledge (Law of Demeter)
Consumer of a method or a class shouldn’t know the inner implementation
details.
SOLID Principles
Single Responsibility Principles: A class or method should have
only one reason to change.
Open-Closed Principle: A class should be open for extension but
closed for modification.
Liskov Substitution Principle: Classes that implements the same
interface or base class can be substituted.
Interface Segregation Principle: Interfaces should be specialized but
not too special.
Dependency inversion (Inversion of control): Depend on
abstractions not implementations.
Architecture
What is architecture?
Architecture is set of design decisions that are hard to
change.
Shared understanding of a system between the people who
are leading the project.
“Describe me with 4 objects how system works” – Kent Beck.
Avoid big up front design
Time
Understanding
Features based on Value and Architectural impacts
Reversibility
Last Responsible Moment
YAGNI
Minimize Framework and Libraries
Users/ External Quality
Software/ Internal Quality
Design Stamina
Architectural
Patterns
Presentation Layer
Business Layer
Service Layer
Persistence Layer
Closed
Closed
Open
Layered Architecture
Monolith
Feature based Slicing
F1 F2 F3 F4 .. FN
Cross cutting concerns
Microkernel Architecture
Core System
Plugin
Plugin
Plugin
Plugin
Event Driven Architecture
Event Processors
ESB, Queue, Hub
Mediator Topology
Event Driven Architecture
Event processors.
Broker Topology
Microservices Architecture
Layered Event Driven Microkernel MicroService
Agility
Deployment
Testability
Performance
Scalability
Development
Comparison

Software design principles for evolving architectures