SlideShare uma empresa Scribd logo
1 de 36
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.

Mais conteúdo relacionado

Mais procurados

How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLCAbdul Karim
 
Clean architecture
Clean architectureClean architecture
Clean architecture.NET Crowd
 
An Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPAn Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPChris Renner
 
Onion Architecture / Clean Architecture
Onion Architecture / Clean ArchitectureOnion Architecture / Clean Architecture
Onion Architecture / Clean ArchitectureAttila Bertók
 
Tactical DDD (just better OOP?) - PHPBenelux 2017
Tactical DDD (just better OOP?) - PHPBenelux 2017Tactical DDD (just better OOP?) - PHPBenelux 2017
Tactical DDD (just better OOP?) - PHPBenelux 2017Matthias Noback
 
Introducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemashIntroducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemashSteven Smith
 
Command Query Responsibility Segregation (CQRS)
Command Query Responsibility Segregation (CQRS)Command Query Responsibility Segregation (CQRS)
Command Query Responsibility Segregation (CQRS)Derek Comartin
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignLalit Kale
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationOğuzhan Soykan
 
Advanced Application Architecture Symfony Live Berlin 2018
Advanced Application Architecture Symfony Live Berlin 2018Advanced Application Architecture Symfony Live Berlin 2018
Advanced Application Architecture Symfony Live Berlin 2018Matthias Noback
 
iOS Beginners Lesson 2
iOS Beginners Lesson 2iOS Beginners Lesson 2
iOS Beginners Lesson 2Calvin Cheng
 
Fundamentals of Akka - Webinar
Fundamentals of Akka - WebinarFundamentals of Akka - Webinar
Fundamentals of Akka - WebinarKnoldus Inc.
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code firstConfiz
 
Advanced application architecture
Advanced application architectureAdvanced application architecture
Advanced application architectureMatthias Noback
 
Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstJibran Rasheed Khan
 
Application architecture jumpstart
Application architecture jumpstartApplication architecture jumpstart
Application architecture jumpstartClint Edmonson
 
Learning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeksLearning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeksCalvin Cheng
 

Mais procurados (20)

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

Destaque

Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)IT Arena
 
Automation of functional tests using JMeter Part II (in Polish)
Automation of functional tests using JMeter Part II (in Polish)Automation of functional tests using JMeter Part II (in Polish)
Automation of functional tests using JMeter Part II (in Polish)Tieto Corporation
 
Beyond design patterns and principles - writing good OO code
Beyond design patterns and principles - writing good OO codeBeyond design patterns and principles - writing good OO code
Beyond design patterns and principles - writing good OO codeMatthias Noback
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#Pascal Laurin
 
DDD patterns that were not in the book
DDD patterns that were not in the bookDDD patterns that were not in the book
DDD patterns that were not in the bookCyrille Martraire
 
Why Domain-Driven Design and Reactive Programming?
Why Domain-Driven Design and Reactive Programming?Why Domain-Driven Design and Reactive Programming?
Why Domain-Driven Design and Reactive Programming?VMware Tanzu
 
Domain-driven design - tactical patterns
Domain-driven design - tactical patternsDomain-driven design - tactical patterns
Domain-driven design - tactical patternsTom Janssens
 
Domain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron EdwardsDomain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron EdwardsHakka Labs
 
2011 iska - tim m - domain driven design
2011   iska - tim m - domain driven design2011   iska - tim m - domain driven design
2011 iska - tim m - domain driven designTim Mahy
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design QuicklyMariam Hakobyan
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocitySam Newman
 

Destaque (13)

Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)
 
Architecting iOS Project
Architecting iOS ProjectArchitecting iOS Project
Architecting iOS Project
 
Automation of functional tests using JMeter Part II (in Polish)
Automation of functional tests using JMeter Part II (in Polish)Automation of functional tests using JMeter Part II (in Polish)
Automation of functional tests using JMeter Part II (in Polish)
 
Beyond design patterns and principles - writing good OO code
Beyond design patterns and principles - writing good OO codeBeyond design patterns and principles - writing good OO code
Beyond design patterns and principles - writing good OO code
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#
 
DDD patterns that were not in the book
DDD patterns that were not in the bookDDD patterns that were not in the book
DDD patterns that were not in the book
 
Why Domain-Driven Design and Reactive Programming?
Why Domain-Driven Design and Reactive Programming?Why Domain-Driven Design and Reactive Programming?
Why Domain-Driven Design and Reactive Programming?
 
Go-jek's Go-Food Chatbot
Go-jek's Go-Food ChatbotGo-jek's Go-Food Chatbot
Go-jek's Go-Food Chatbot
 
Domain-driven design - tactical patterns
Domain-driven design - tactical patternsDomain-driven design - tactical patterns
Domain-driven design - tactical patterns
 
Domain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron EdwardsDomain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron Edwards
 
2011 iska - tim m - domain driven design
2011   iska - tim m - domain driven design2011   iska - tim m - domain driven design
2011 iska - tim m - domain driven design
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design Quickly
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocity
 

Semelhante a Architecture Principles CodeStock

Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Fwdays
 
Service Architectures at Scale
Service Architectures at ScaleService Architectures at Scale
Service Architectures at ScaleRandy Shoup
 
Entity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and BeyondEntity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and BeyondSteve Westgarth
 
Architecture Design in Software Engineering
Architecture Design in Software EngineeringArchitecture Design in Software Engineering
Architecture Design in Software Engineeringcricket2ime
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2Erik Noren
 
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuri
Architecture   - December 2013 - Avinash Ramineni, Shekhar VeumuriArchitecture   - December 2013 - Avinash Ramineni, Shekhar Veumuri
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuriclairvoyantllc
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Adbms 1 object oriented modeling
Adbms 1 object oriented modelingAdbms 1 object oriented modeling
Adbms 1 object oriented modelingVaibhav Khanna
 
Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”EPAM Systems
 
The "Why", "What" and "How" of Microservices
The "Why", "What" and "How" of Microservices The "Why", "What" and "How" of Microservices
The "Why", "What" and "How" of Microservices INPAY
 
10 architectural design
10 architectural design10 architectural design
10 architectural designAyesha Bhatti
 
10 architectural design (1)
10 architectural design (1)10 architectural design (1)
10 architectural design (1)Ayesha Bhatti
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best PracticesPavel Mička
 
MVC Website Pattern The Controller, Task, Repository, Command Pattern
MVC Website Pattern The Controller, Task, Repository, Command PatternMVC Website Pattern The Controller, Task, Repository, Command Pattern
MVC Website Pattern The Controller, Task, Repository, Command Patternandrewjutton
 
Lessions Learned - Service Oriented Architecture
Lessions Learned - Service Oriented Architecture Lessions Learned - Service Oriented Architecture
Lessions Learned - Service Oriented Architecture Helge Olav Aarstein
 
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service FabricTokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service FabricTokyo Azure Meetup
 
SOA1-Background.ppt SOFTWARE ORIENTED SERVICES AND ARCHITECTURE
SOA1-Background.ppt SOFTWARE ORIENTED SERVICES AND ARCHITECTURESOA1-Background.ppt SOFTWARE ORIENTED SERVICES AND ARCHITECTURE
SOA1-Background.ppt SOFTWARE ORIENTED SERVICES AND ARCHITECTUREAnyaForger34
 
Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices M A Hossain Tonu
 

Semelhante a Architecture Principles CodeStock (20)

Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API"
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Service Architectures at Scale
Service Architectures at ScaleService Architectures at Scale
Service Architectures at Scale
 
Entity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and BeyondEntity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and Beyond
 
Mis assignment (database)
Mis assignment (database)Mis assignment (database)
Mis assignment (database)
 
Architecture Design in Software Engineering
Architecture Design in Software EngineeringArchitecture Design in Software Engineering
Architecture Design in Software Engineering
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2
 
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuri
Architecture   - December 2013 - Avinash Ramineni, Shekhar VeumuriArchitecture   - December 2013 - Avinash Ramineni, Shekhar Veumuri
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuri
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Adbms 1 object oriented modeling
Adbms 1 object oriented modelingAdbms 1 object oriented modeling
Adbms 1 object oriented modeling
 
Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”
 
The "Why", "What" and "How" of Microservices
The "Why", "What" and "How" of Microservices The "Why", "What" and "How" of Microservices
The "Why", "What" and "How" of Microservices
 
10 architectural design
10 architectural design10 architectural design
10 architectural design
 
10 architectural design (1)
10 architectural design (1)10 architectural design (1)
10 architectural design (1)
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best Practices
 
MVC Website Pattern The Controller, Task, Repository, Command Pattern
MVC Website Pattern The Controller, Task, Repository, Command PatternMVC Website Pattern The Controller, Task, Repository, Command Pattern
MVC Website Pattern The Controller, Task, Repository, Command Pattern
 
Lessions Learned - Service Oriented Architecture
Lessions Learned - Service Oriented Architecture Lessions Learned - Service Oriented Architecture
Lessions Learned - Service Oriented Architecture
 
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service FabricTokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
 
SOA1-Background.ppt SOFTWARE ORIENTED SERVICES AND ARCHITECTURE
SOA1-Background.ppt SOFTWARE ORIENTED SERVICES AND ARCHITECTURESOA1-Background.ppt SOFTWARE ORIENTED SERVICES AND ARCHITECTURE
SOA1-Background.ppt SOFTWARE ORIENTED SERVICES AND ARCHITECTURE
 
Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices
 

Último

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 

Último (20)

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 

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.