SlideShare a Scribd company logo
Principles of Application Architecture
9:25am/ Ballroom B
PRELIMINARIES
• Who am I?
• Steve Barbour
• @steverb
• steverb.com
• Why should you listen to me?
• You shouldn’t
• Ground rules for this talk
• I do NOT have all the answers
• Discussion and disagreement are welcome
• Keep it civil
• We do have a time limit
WHAT IS APPLICATION
ARCHITECTURE?
• High level breakdown of system into its parts.
• Things that are hard to change.
• Mostly concerned with the public interfaces, not the private
implementation.
• Whatever the important stuff is.
WHY SHOULD I CARE?
BAD ARCHITECTURE
• Overly Complex
• Error Prone
• Fragile
• Hard to understand
• Rigid
GOOD ARCHITECTURE
• Simple as possible
• Correct
• Robust
• Understandable
• Flexible
CONTINUUM
• The line between architecture and craftsmanship is blurry
• System
• Application
• Modules/Classes
• Functions
KEY PRINCIPLES / SOLID
SINGLE RESPONSIBILITY
• A component should have only one (business) reason
to change.
• Having separate components that do not overlap in
functionality makes the system/application easier to
understand, reason about, test and change.
THE MODEM CLASS
Public interface Modem
{
public void Dial (string phoneNumber);
public void Hangup();
public void Send (char c);
public char Recv();
}
OPEN/CLOSED
• Entities should be open for extension but closed for
modification
• Open for Extension – Behavior can be extended
• Closed for Modification – Extending behavior doesn’t require
source changes to the entity.
• In C#, think abstract classes, or implementing interfaces.
THE SQUARE CIRCLE
PROBLEM
Void DrawAllShapes(Shapes list[])
{
foreach(shape in Shapes)
{
switch(shape.type)
{
case square:
DrawSquare(shape);
break;
case circle:
DrawCircle(shape);
break;
}
}
}
THE LISKOV SUBSTITUTION
PRINCIPLE
• Subtypes must be substitutable for their base types.
• “A model, viewed in isolation cannot be validated.”
• “The validity of a model can be expressed only in terms of its
clients.”
• The IS-A relationship applies to behaviors.
THE RECTANGLE AND THE
SQUARE
public class Rectangle
{
private Point topLeft;
private double width;
private double height;
public virtual double Width{get; set;}
public virtual double Height{get; set;}
}
THE RECTANGLE AND THE
SQUARE- CONT
public class Square:Rectangle
{
public override double Width
{
set
{
base.Width = value;
base.Height = value;
}
}
}
INTERFACE SEGREGATION
• No client should be forced to depend on methods they don’t
use.
• Regular door and a timed door…
DEPENDENCY INVERSION
• High level modules should not depend on low level modules.
They should both depend on abstractions
• Abstractions should not depend on details. Details should
depend on abstractions.
GOOD PRACTICES
• Don’t Repeat Yourself (DRY)
• You Ain’t Gonna Need It (YAGNI)
• Keep it stupid simple (KISS)
• Keep the design consistent within each layer.
• Prefer composition to inheritance.
• Be explicit about communication.
• Keep data formats consistent.
• Separate crosscutting code.
• Only talk to your immediate friends (LoD)?
BAD PRACTICES
• Premature Generalization
• Premature Optimization
• Pattern all the things!
• No non-functional requirements
• The one true way to do it
• Resume driven development
• Einstein syndrome
• Fire and forget
• Quality is job #987
PATTERNS
ARCHITECTURAL STYLES /
PATTERNS
• Patterns that are mostly concerned with how applications are
structured and developed.
• Principles that shape an application.
• You can and probably will mix and match styles.
• Conway’s Law
• “Software will reflect the organization that created it.”
LAYERS
• Functionality in each layers is related by common
responsibility.
• Communication is explicit and loosely coupled.
• Benefits
• Abstraction
• Isolation
• Manageability
• Reusability
• Testability
CLIENT/SERVER
• Segregates the system into two applications, client makes
requests to the server.
• Classically, the server is a database with application logic in
stored procedures.
• Benefits
• Security
• Centralized Access
• Maintainance
N-TIER / 3-TIER
• Like layers, but physically separated.
• Tiers are completely separate from other tiers and only
communicate with the tiers immediately adjacent.
• Benefits
• Maintainability
• Scalability
• Flexibility
• Availability
MESSAGE BUS
• Receive and send messages using a common bus.
• Communication is explicit and loosely coupled.
• Pub/Sub, Message Queueing.
• Benefits
• Extensibility
• Low Complexity
• Flexibility
• Loose Coupling
• Scalability
• Application Simplicity
MICROKERNEL
• Core System + Plug-ins
• Core traditionally contains minimal functionality
• Benefits
• Extensibility
• Ease of Deployment
• Testability
SERVICE ORIENTED
ARCHITECTURE
• Boundaries are explicit.
• Services are autonomous.
• Services share schema and contract, not class.
• Service compatibility is based on policy (transport, protocol
and security).
• Benefits
• Loose Coupling
• Ease of deployment (kinda)
• Testable
• Scalable
• Now for something completely different.
MICROSERVICES
• Functionality provided as (web) services
• Boundaries are explicit.
• Services are autonomous.
• Might not expose schema or contract.
• Generally little, restish services.
• Benefits
• Loose Coupling
• Ease of deployment (kinda)
• Testable
• Scalable
SO MANY ARCHITECTURAL
PATTERNS
• Monolithic (Big Ball of Mud)
• Blackboard (Shared Memory)
• Hexagonal
• CQRS
• Event Driven
• Peer to Peer
• REST
• Shared Nothing Architecture (Sharding)
• Space Based Architecture (Good Luck)
ARCHITECTURAL DESIGN
• How to document and communicate?
• How much documentation do we need?
• When do we design the architecture?
• How much time should we spend architecting?
WE HAVE ONLY SCRATCHED
THE SURFACE
• Software Architecture and Design from Microsoft Patterns and
Practices.
• Patterns of Enterprise Application Architecture by Martin Fowler.
• Martin Fowler's Catalog of Patterns
• Martin Fowler's Site, anything by Martin Fowler really.
• Agile Principles, Patterns and Practices in C# by Robert C. Martin
• Head First Design Patterns - A little light, but a good intro.
• Wikipedia
• O’Reilly
SERIOUSLY? YOU’RE NOT
DONE YET?
• @steverb
• steverb.com
• me@steverb.com
EXTRA SLIDES IN CASE I
TALK WAY TOO FAST
DOMAIN LOGIC PATTERNS
• Transaction Script - Organizes business logic by procedures
where each procedure handles a single request from the
presentation layer.
• Domain Model - An object model of the domain that
incorporates both behavior and data.
• Table Module - A single instance that handles the business
logic for all rows in a database table or view.
• Service Layer - Defines an application's boundary with a layer
of services that establishes a set of available operations and
coordinates the application's response in each operation.
DATA ACCESS PATTERNS
• Row Data Gateway - An object that acts as a Gateway to a single
record in a data source. There is one instance per row.
• Table Data Gateway - An object that acts as a gateway to a
database table. One instance handles all the rows in the table.
• Data Mapper - A layer of mappers that moves data between
objects and a database while keeping them independent of one
another and of the mapper itself.
• Active Record - An object that wraps a row in a database table or
view, encapsulates the database access, and adds domain logic on
that data.
• Command Query Responsibility Segregation - Use a model to
update data that is different from the model used to read data.
PRESENTATION PATTERNS
• Model View Controller - Splits user interface interaction into three
distinct roles.
• Page Controller - An object that handles a request for a specific
page or action on a web site.
• Front Controller - A controller that handles all requests for a web
site.
• Template View - Renders information into HTML by embedding
markers in an HTML page.
• Transform View - A view that process domain data element by
element and transforms it into HTML.
• Two Step View - Turns domain data into HTML in two steps: first by
forming some kind of logical page, then rendering the logical page
into HTML.
• Application Controller - A centralized point for handling screen
navigation and the flow of an application.

More Related Content

PDF
Solid principles, Design Patterns, and Domain Driven Design
PDF
Domain-Driven Design with ASP.NET MVC
PDF
Clean architecture with ddd layering in php
PPTX
CQRS recipes or how to cook your architecture
PDF
DDD Basics - Context mapping
PDF
Breaking Dependencies to Allow Unit Testing
PPTX
Domain Driven Design
PDF
Clean architecture with asp.net core
Solid principles, Design Patterns, and Domain Driven Design
Domain-Driven Design with ASP.NET MVC
Clean architecture with ddd layering in php
CQRS recipes or how to cook your architecture
DDD Basics - Context mapping
Breaking Dependencies to Allow Unit Testing
Domain Driven Design
Clean architecture with asp.net core

What's hot (20)

PPTX
How to Implement Domain Driven Design in Real Life SDLC
PPTX
Clean architecture
PPTX
An Introduction to Domain Driven Design in PHP
PPTX
Onion Architecture / Clean Architecture
PDF
Tactical DDD (just better OOP?) - PHPBenelux 2017
PDF
The Developers World
PPTX
Introducing Domain Driven Design - codemash
PPTX
Akka.Net Overview
PDF
Command Query Responsibility Segregation (CQRS)
PPTX
Domain Driven Design
PPTX
Domain Driven Design(DDD) Presentation
PDF
Advanced Application Architecture Symfony Live Berlin 2018
PPTX
iOS Beginners Lesson 2
PPTX
Fundamentals of Akka - Webinar
PPTX
04 managing the database
PPTX
Entity framework code first
PDF
Advanced application architecture
PDF
Learn Entity Framework in a day with Code First, Model First and Database First
PPTX
Application architecture jumpstart
KEY
Learning iOS and hunting NSZombies in 3 weeks
How to Implement Domain Driven Design in Real Life SDLC
Clean architecture
An Introduction to Domain Driven Design in PHP
Onion Architecture / Clean Architecture
Tactical DDD (just better OOP?) - PHPBenelux 2017
The Developers World
Introducing Domain Driven Design - codemash
Akka.Net Overview
Command Query Responsibility Segregation (CQRS)
Domain Driven Design
Domain Driven Design(DDD) Presentation
Advanced Application Architecture Symfony Live Berlin 2018
iOS Beginners Lesson 2
Fundamentals of Akka - Webinar
04 managing the database
Entity framework code first
Advanced application architecture
Learn Entity Framework in a day with Code First, Model First and Database First
Application architecture jumpstart
Learning iOS and hunting NSZombies in 3 weeks
Ad

Viewers also liked (12)

PDF
Domain-Driven Design (Artur Trosin Product Stream)
PDF
Architecting iOS Project
PPTX
Automation of functional tests using JMeter Part II (in Polish)
PDF
Beyond design patterns and principles - writing good OO code
PPTX
Implementing DDD with C#
PDF
DDD patterns that were not in the book
PPTX
Why Domain-Driven Design and Reactive Programming?
PDF
Go-jek's Go-Food Chatbot
PDF
Domain-driven design - tactical patterns
PPTX
Domain Driven Design in the Browser - Cameron Edwards
PPTX
Domain Driven Design Quickly
PDF
Principles of microservices velocity
Domain-Driven Design (Artur Trosin Product Stream)
Architecting iOS Project
Automation of functional tests using JMeter Part II (in Polish)
Beyond design patterns and principles - writing good OO code
Implementing DDD with C#
DDD patterns that were not in the book
Why Domain-Driven Design and Reactive Programming?
Go-jek's Go-Food Chatbot
Domain-driven design - tactical patterns
Domain Driven Design in the Browser - Cameron Edwards
Domain Driven Design Quickly
Principles of microservices velocity
Ad

Similar to Architecture Principles CodeStock (20)

PDF
Алексей Веркеенко "Symfony2 & REST API"
PDF
Microservices Architecture
PPTX
Service Architectures at Scale
PPTX
Entity Framework: To the Unit of Work Design Pattern and Beyond
PPTX
DevOps2828282838382826q5719q9762827.pptx
PDF
Lecture07_1_AAẨchitectureDesignforst.pdf
PPT
Mis assignment (database)
PDF
Architecture Design in Software Engineering
PPTX
ASP.NET Core Demos Part 2
PPTX
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuri
PPTX
Introduction to Microservices
PPTX
Adbms 1 object oriented modeling
PPTX
Чурюканов Вячеслав, “Code simple, but not simpler”
PPTX
The "Why", "What" and "How" of Microservices
PPTX
10 architectural design (1)
PPTX
10 architectural design
PDF
A Presentation on Architectual Design by Students of Engineering
PDF
Microservices: The Best Practices
PPTX
MVC Website Pattern The Controller, Task, Repository, Command Pattern
PPTX
Lessions Learned - Service Oriented Architecture
Алексей Веркеенко "Symfony2 & REST API"
Microservices Architecture
Service Architectures at Scale
Entity Framework: To the Unit of Work Design Pattern and Beyond
DevOps2828282838382826q5719q9762827.pptx
Lecture07_1_AAẨchitectureDesignforst.pdf
Mis assignment (database)
Architecture Design in Software Engineering
ASP.NET Core Demos Part 2
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuri
Introduction to Microservices
Adbms 1 object oriented modeling
Чурюканов Вячеслав, “Code simple, but not simpler”
The "Why", "What" and "How" of Microservices
10 architectural design (1)
10 architectural design
A Presentation on Architectual Design by Students of Engineering
Microservices: The Best Practices
MVC Website Pattern The Controller, Task, Repository, Command Pattern
Lessions Learned - Service Oriented Architecture

Recently uploaded (20)

PDF
System and Network Administration Chapter 2
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
System and Network Administraation Chapter 3
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Nekopoi APK 2025 free lastest update
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
L1 - Introduction to python Backend.pptx
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Essential Infomation Tech presentation.pptx
System and Network Administration Chapter 2
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
System and Network Administraation Chapter 3
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Operating system designcfffgfgggggggvggggggggg
CHAPTER 2 - PM Management and IT Context
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
How to Choose the Right IT Partner for Your Business in Malaysia
Understanding Forklifts - TECH EHS Solution
Nekopoi APK 2025 free lastest update
Wondershare Filmora 15 Crack With Activation Key [2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
L1 - Introduction to python Backend.pptx
How Creative Agencies Leverage Project Management Software.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Essential Infomation Tech presentation.pptx

Architecture Principles CodeStock

  • 1. Principles of Application Architecture 9:25am/ Ballroom B
  • 2. PRELIMINARIES • Who am I? • Steve Barbour • @steverb • steverb.com • Why should you listen to me? • You shouldn’t • Ground rules for this talk • I do NOT have all the answers • Discussion and disagreement are welcome • Keep it civil • We do have a time limit
  • 3. WHAT IS APPLICATION ARCHITECTURE? • High level breakdown of system into its parts. • Things that are hard to change. • Mostly concerned with the public interfaces, not the private implementation. • Whatever the important stuff is.
  • 4. WHY SHOULD I CARE?
  • 5. BAD ARCHITECTURE • Overly Complex • Error Prone • Fragile • Hard to understand • Rigid
  • 6. GOOD ARCHITECTURE • Simple as possible • Correct • Robust • Understandable • Flexible
  • 7. CONTINUUM • The line between architecture and craftsmanship is blurry • System • Application • Modules/Classes • Functions
  • 9. SINGLE RESPONSIBILITY • A component should have only one (business) reason to change. • Having separate components that do not overlap in functionality makes the system/application easier to understand, reason about, test and change.
  • 10. THE MODEM CLASS Public interface Modem { public void Dial (string phoneNumber); public void Hangup(); public void Send (char c); public char Recv(); }
  • 11. OPEN/CLOSED • Entities should be open for extension but closed for modification • Open for Extension – Behavior can be extended • Closed for Modification – Extending behavior doesn’t require source changes to the entity. • In C#, think abstract classes, or implementing interfaces.
  • 12. THE SQUARE CIRCLE PROBLEM Void DrawAllShapes(Shapes list[]) { foreach(shape in Shapes) { switch(shape.type) { case square: DrawSquare(shape); break; case circle: DrawCircle(shape); break; } } }
  • 13. THE LISKOV SUBSTITUTION PRINCIPLE • Subtypes must be substitutable for their base types. • “A model, viewed in isolation cannot be validated.” • “The validity of a model can be expressed only in terms of its clients.” • The IS-A relationship applies to behaviors.
  • 14. THE RECTANGLE AND THE SQUARE public class Rectangle { private Point topLeft; private double width; private double height; public virtual double Width{get; set;} public virtual double Height{get; set;} }
  • 15. THE RECTANGLE AND THE SQUARE- CONT public class Square:Rectangle { public override double Width { set { base.Width = value; base.Height = value; } } }
  • 16. INTERFACE SEGREGATION • No client should be forced to depend on methods they don’t use. • Regular door and a timed door…
  • 17. DEPENDENCY INVERSION • High level modules should not depend on low level modules. They should both depend on abstractions • Abstractions should not depend on details. Details should depend on abstractions.
  • 18. GOOD PRACTICES • Don’t Repeat Yourself (DRY) • You Ain’t Gonna Need It (YAGNI) • Keep it stupid simple (KISS) • Keep the design consistent within each layer. • Prefer composition to inheritance. • Be explicit about communication. • Keep data formats consistent. • Separate crosscutting code. • Only talk to your immediate friends (LoD)?
  • 19. BAD PRACTICES • Premature Generalization • Premature Optimization • Pattern all the things! • No non-functional requirements • The one true way to do it • Resume driven development • Einstein syndrome • Fire and forget • Quality is job #987
  • 21. ARCHITECTURAL STYLES / PATTERNS • Patterns that are mostly concerned with how applications are structured and developed. • Principles that shape an application. • You can and probably will mix and match styles. • Conway’s Law • “Software will reflect the organization that created it.”
  • 22. LAYERS • Functionality in each layers is related by common responsibility. • Communication is explicit and loosely coupled. • Benefits • Abstraction • Isolation • Manageability • Reusability • Testability
  • 23. CLIENT/SERVER • Segregates the system into two applications, client makes requests to the server. • Classically, the server is a database with application logic in stored procedures. • Benefits • Security • Centralized Access • Maintainance
  • 24. N-TIER / 3-TIER • Like layers, but physically separated. • Tiers are completely separate from other tiers and only communicate with the tiers immediately adjacent. • Benefits • Maintainability • Scalability • Flexibility • Availability
  • 25. MESSAGE BUS • Receive and send messages using a common bus. • Communication is explicit and loosely coupled. • Pub/Sub, Message Queueing. • Benefits • Extensibility • Low Complexity • Flexibility • Loose Coupling • Scalability • Application Simplicity
  • 26. MICROKERNEL • Core System + Plug-ins • Core traditionally contains minimal functionality • Benefits • Extensibility • Ease of Deployment • Testability
  • 27. SERVICE ORIENTED ARCHITECTURE • Boundaries are explicit. • Services are autonomous. • Services share schema and contract, not class. • Service compatibility is based on policy (transport, protocol and security). • Benefits • Loose Coupling • Ease of deployment (kinda) • Testable • Scalable • Now for something completely different.
  • 28. MICROSERVICES • Functionality provided as (web) services • Boundaries are explicit. • Services are autonomous. • Might not expose schema or contract. • Generally little, restish services. • Benefits • Loose Coupling • Ease of deployment (kinda) • Testable • Scalable
  • 29. SO MANY ARCHITECTURAL PATTERNS • Monolithic (Big Ball of Mud) • Blackboard (Shared Memory) • Hexagonal • CQRS • Event Driven • Peer to Peer • REST • Shared Nothing Architecture (Sharding) • Space Based Architecture (Good Luck)
  • 30. ARCHITECTURAL DESIGN • How to document and communicate? • How much documentation do we need? • When do we design the architecture? • How much time should we spend architecting?
  • 31. WE HAVE ONLY SCRATCHED THE SURFACE • Software Architecture and Design from Microsoft Patterns and Practices. • Patterns of Enterprise Application Architecture by Martin Fowler. • Martin Fowler's Catalog of Patterns • Martin Fowler's Site, anything by Martin Fowler really. • Agile Principles, Patterns and Practices in C# by Robert C. Martin • Head First Design Patterns - A little light, but a good intro. • Wikipedia • O’Reilly
  • 32. SERIOUSLY? YOU’RE NOT DONE YET? • @steverb • steverb.com • me@steverb.com
  • 33. EXTRA SLIDES IN CASE I TALK WAY TOO FAST
  • 34. DOMAIN LOGIC PATTERNS • Transaction Script - Organizes business logic by procedures where each procedure handles a single request from the presentation layer. • Domain Model - An object model of the domain that incorporates both behavior and data. • Table Module - A single instance that handles the business logic for all rows in a database table or view. • Service Layer - Defines an application's boundary with a layer of services that establishes a set of available operations and coordinates the application's response in each operation.
  • 35. DATA ACCESS PATTERNS • Row Data Gateway - An object that acts as a Gateway to a single record in a data source. There is one instance per row. • Table Data Gateway - An object that acts as a gateway to a database table. One instance handles all the rows in the table. • Data Mapper - A layer of mappers that moves data between objects and a database while keeping them independent of one another and of the mapper itself. • Active Record - An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data. • Command Query Responsibility Segregation - Use a model to update data that is different from the model used to read data.
  • 36. PRESENTATION PATTERNS • Model View Controller - Splits user interface interaction into three distinct roles. • Page Controller - An object that handles a request for a specific page or action on a web site. • Front Controller - A controller that handles all requests for a web site. • Template View - Renders information into HTML by embedding markers in an HTML page. • Transform View - A view that process domain data element by element and transforms it into HTML. • Two Step View - Turns domain data into HTML in two steps: first by forming some kind of logical page, then rendering the logical page into HTML. • Application Controller - A centralized point for handling screen navigation and the flow of an application.