SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
Globalcode – Open4education
Diego Cardoso
Clean Architecture com ASP.NET Core
16 de Julho – 2019
Globalcode – Open4education
Trilha .Net
Diego Cardoso
Julho de 2019
Clean Architecture com ASP.NET Core
• OrgulhosoFilho, Marido e Pai
• Graduadoem Sistemasda Informaçãona FSA
• Pós-Graduadoem Arquiteturade Softwarena FIAP
• CertificadoMicrosoft:MCTS
• Trabalhona GFT (Sorocaba)
• +13 anos Analisando,Codificandoe Migrando
• Entusiastacom foco em Arquiteturae MetodologiasÁgeis
• Apaixonadopor Musica - guitarristaenferrujadonas horasvagas
Globalcode – Open4education
GFT – Temos vagas
Mande seu currículo pra gente:
Oportunidades.Brasil@gft.com
facebook.com/gft.br
linkedin.com/company/gft-group
blog.gft.com/br
www.twitter.com/gft_br
@gft_tech
www.gft.com/br
@GFT-LATAM-Meetup
Globalcode – Open4education
Agenda
Who is the Architect ?
Clean Architecture
Evolutionary Architecture
Trends for 2019
Globalcode – Open4education
Who is the Architect ?
Globalcode – Open4education
Architect - Skills
1
2
3
4
1
3
Translate Journeys to Requirements
Middleware / Components
Libraries / Frameworks / Assets
Data persistence / cache
Energize team members
Create learning paths
2 Communicative / Presentation
4 Simplify component design
5 Infrastructure / Security 5 Innovate and create assets
Technical Skills Soft Skills
Globalcode – Open4education
CLean =
DDD + Hexagonal +
Onion + CQRS
How to put them all together and keep Clean(Lean) ?
Globalcode – Open4education
Recap: Flow of Controls
Consumers Infrastructure
Application Core
User Interface
File System
Database
Email / SMS
Queue
Globalcode – Open4education
Persistence
Clear Architecture
App Services
Consumers Infrastructure
User Interface
API Consumer
CLI
Infrastructure
Domain
Application Core
App Services
Presentation
Globalcode – Open4education
Persistence
Domain Driven Design
App Services
Infrastructure
Domain
Application Core
App Services
Overview
Entities
Value Objects
Enumerations
Aggregate Root
Logic
Exceptions
Key Points
- Use data annotations sparingly
- Use commands for logic
- Use events for data propagation
only when necessary
- Use immutable VO and commands
Globalcode – Open4education
Persistence
Application Services
App Services
Infrastructure
Domain
Application Core
App Services
Overview
Key Points
- Use CQRS to simply your overall design
- MediatR to manage requests, responses,
commands, queries, notifications and
events
- Work with VMs and DTOs
- FailFast with FluentValidation and Valit
- Create custom application exceptions
Interfaces
View Models
Events
Validators
Logic
Exceptions
Globalcode – Open4education
Persistence
Persistence
App Services
Infrastructure
Domain
Application Core
App Services
Overview
Key Points
- Independent of the database
- Conventions over configuration
- Use Fluent API configuration over data
annotations
- CodeFirst and Migrations
- Use an extension to automatically apply all
entity type configurations
Repository
Cache
Seeding
Configurations
Transactions
Migrations
Globalcode – Open4education
Persistence
Infrastructure
App Services
Infrastructure
Domain
Application Core
App Services
Overview
Key Points
- Implement interfaces(contracts) from
Application Layer
- No layer depends on Infrastructure Layer
- Move configuration outside the code
repository (e.g.: Consul or Azure KeyVault)
Clients
Email
System Clock
File System
Queue
Anything External
Globalcode – Open4education
Clean Arch with .NET Core
Client
Persistence:
Repo = IQueryService + IPersitence
EFCore
Dapper
MongoDB Driver and etc
Infrastructure:
Dependency Isolation
Autofac for IoC
Middleware:
Authentication
Authorization
Analytics
Log
Package Msg
API .NET Core
Tests:
Nunit / Xunit / xBehave
FluentAssertion
Code Quality:
Sonar / R# / ts-clean-code
Globalcode – Open4education
Any fool can write code that a
computer can understand.
Good programmers write code
that humans can understand.
Martin Fowler
Globalcode – Open4education
Evolutionary Architecture
Incremental :
• Small and quick increments
• Hide implements behind interfaces
• Become reactive over predictive
An Attitude:
• Bring the pain forward
• Frequent releases
• Guide improvements based on Fitness Functions
Infrastructure
• Immutability
• Replaceability
• Assembility (container)
• Solid infra to deliver and
rollback product versions
Globalcode – Open4education
Trends for 2019
Julho/2019 #Thanks
/diegosmorf
Diego Cardoso
Clean Architecture com ASP.NET Core

Contenu connexe

Tendances

Tendances (7)

Android maven Road to flutter| Mavenizing Flutter for web
Android maven Road to flutter| Mavenizing Flutter for webAndroid maven Road to flutter| Mavenizing Flutter for web
Android maven Road to flutter| Mavenizing Flutter for web
 
CDRTool: CDR mediation and rating engine for OpenSIPS
CDRTool: CDR mediation and rating engine for OpenSIPSCDRTool: CDR mediation and rating engine for OpenSIPS
CDRTool: CDR mediation and rating engine for OpenSIPS
 
Gerrit Analytics applied to Android source code
Gerrit Analytics applied to Android source codeGerrit Analytics applied to Android source code
Gerrit Analytics applied to Android source code
 
This Week in Neo4j - 9th June 2018
This Week in Neo4j - 9th June 2018This Week in Neo4j - 9th June 2018
This Week in Neo4j - 9th June 2018
 
apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...
apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...
apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...
 
[Webinar] Automating Developer Workspace Construction for the Nuxeo Platform ...
[Webinar] Automating Developer Workspace Construction for the Nuxeo Platform ...[Webinar] Automating Developer Workspace Construction for the Nuxeo Platform ...
[Webinar] Automating Developer Workspace Construction for the Nuxeo Platform ...
 
2018 July - The Month in PHP
2018 July - The Month in PHP2018 July - The Month in PHP
2018 July - The Month in PHP
 

Similaire à TDC SP 2019 - Trilha .NET - Clean Architecture

Similaire à TDC SP 2019 - Trilha .NET - Clean Architecture (20)

Dagster @ R&S MNT
Dagster @ R&S MNTDagster @ R&S MNT
Dagster @ R&S MNT
 
ISC Cloud13 Sill - Crossing organizational boundaries in cloud computing
ISC Cloud13 Sill - Crossing organizational boundaries in cloud computingISC Cloud13 Sill - Crossing organizational boundaries in cloud computing
ISC Cloud13 Sill - Crossing organizational boundaries in cloud computing
 
OGF standards for cloud computing
OGF standards for cloud computingOGF standards for cloud computing
OGF standards for cloud computing
 
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOpsMeetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOps
 
Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e...
 Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e... Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e...
Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e...
 
Balaji Resume
Balaji ResumeBalaji Resume
Balaji Resume
 
Cloud Native Application Integration With APIs
Cloud Native Application Integration With APIsCloud Native Application Integration With APIs
Cloud Native Application Integration With APIs
 
Leveraging HybridMultiCloud for Devops and Automation Platform
Leveraging HybridMultiCloud for Devops and Automation PlatformLeveraging HybridMultiCloud for Devops and Automation Platform
Leveraging HybridMultiCloud for Devops and Automation Platform
 
Breaking the Monolith
Breaking the MonolithBreaking the Monolith
Breaking the Monolith
 
Orchestration, Automation and Virtualisation (OAV) in GÉANT
Orchestration, Automation and Virtualisation (OAV) in GÉANTOrchestration, Automation and Virtualisation (OAV) in GÉANT
Orchestration, Automation and Virtualisation (OAV) in GÉANT
 
Sistema de Notificações com SignalR TDC 2014
Sistema de Notificações com SignalR TDC 2014Sistema de Notificações com SignalR TDC 2014
Sistema de Notificações com SignalR TDC 2014
 
Platform governance, gestire un ecosistema di microservizi a livello enterprise
Platform governance, gestire un ecosistema di microservizi a livello enterprisePlatform governance, gestire un ecosistema di microservizi a livello enterprise
Platform governance, gestire un ecosistema di microservizi a livello enterprise
 
Google Cloud Platform Solutions for DevOps Engineers
Google Cloud Platform Solutions  for DevOps EngineersGoogle Cloud Platform Solutions  for DevOps Engineers
Google Cloud Platform Solutions for DevOps Engineers
 
2019 Global Azure Bootcamp: AzureDevops + NET Core + Clean Architecture
2019 Global Azure Bootcamp: AzureDevops + NET Core + Clean Architecture2019 Global Azure Bootcamp: AzureDevops + NET Core + Clean Architecture
2019 Global Azure Bootcamp: AzureDevops + NET Core + Clean Architecture
 
Digital Reinvention by NRB
Digital Reinvention by NRBDigital Reinvention by NRB
Digital Reinvention by NRB
 
Application Modernisation with PKS
Application Modernisation with PKSApplication Modernisation with PKS
Application Modernisation with PKS
 
Application Modernisation with PKS
Application Modernisation with PKSApplication Modernisation with PKS
Application Modernisation with PKS
 
[WSO2 Integration Summit Stuttgart 2019] Role of Integration in an API Driven...
[WSO2 Integration Summit Stuttgart 2019] Role of Integration in an API Driven...[WSO2 Integration Summit Stuttgart 2019] Role of Integration in an API Driven...
[WSO2 Integration Summit Stuttgart 2019] Role of Integration in an API Driven...
 
Introduction to Data Models & Cisco's NextGen Device Level APIs: an overview
Introduction to Data Models & Cisco's NextGen Device Level APIs: an overviewIntroduction to Data Models & Cisco's NextGen Device Level APIs: an overview
Introduction to Data Models & Cisco's NextGen Device Level APIs: an overview
 
InterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloud
InterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloudInterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloud
InterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloud
 

Plus de Diego Gabriel Cardoso

Plus de Diego Gabriel Cardoso (11)

2024 Facens Semana Academica Carreira e o mercado de TI
2024 Facens Semana Academica Carreira  e o mercado de TI2024 Facens Semana Academica Carreira  e o mercado de TI
2024 Facens Semana Academica Carreira e o mercado de TI
 
Facens - Plugin - A Evolução na carreira de TI
Facens - Plugin -  A Evolução na carreira de TIFacens - Plugin -  A Evolução na carreira de TI
Facens - Plugin - A Evolução na carreira de TI
 
Facens - Plugin - Usando Inteligência Artificial para aprimorar seus conheci...
Facens - Plugin -  Usando Inteligência Artificial para aprimorar seus conheci...Facens - Plugin -  Usando Inteligência Artificial para aprimorar seus conheci...
Facens - Plugin - Usando Inteligência Artificial para aprimorar seus conheci...
 
2020 05-tech saturday-devsecops-#2-v03
2020 05-tech saturday-devsecops-#2-v032020 05-tech saturday-devsecops-#2-v03
2020 05-tech saturday-devsecops-#2-v03
 
DevSecOps - Colocando segurança na esteira
DevSecOps - Colocando segurança na esteiraDevSecOps - Colocando segurança na esteira
DevSecOps - Colocando segurança na esteira
 
DevSecOps: Colocando segurança na esteira
DevSecOps: Colocando segurança na esteiraDevSecOps: Colocando segurança na esteira
DevSecOps: Colocando segurança na esteira
 
DevSecOps: Colocando segurança na esteira
DevSecOps: Colocando segurança na esteiraDevSecOps: Colocando segurança na esteira
DevSecOps: Colocando segurança na esteira
 
2019 MVPConf Entenda como DevOps pode ajudar a visão e controle sobre desenvo...
2019 MVPConf Entenda como DevOps pode ajudar a visão e controle sobre desenvo...2019 MVPConf Entenda como DevOps pode ajudar a visão e controle sobre desenvo...
2019 MVPConf Entenda como DevOps pode ajudar a visão e controle sobre desenvo...
 
2019 Facens Semana Tecnologia- Arquitetura distribuída na Nuvem
2019 Facens Semana Tecnologia- Arquitetura distribuída na Nuvem2019 Facens Semana Tecnologia- Arquitetura distribuída na Nuvem
2019 Facens Semana Tecnologia- Arquitetura distribuída na Nuvem
 
TDC SP 2017 Trilha .NET - TechWar: Threads, ThreadPools e Tasks em C#
TDC SP 2017 Trilha .NET - TechWar: Threads, ThreadPools e Tasks em C#TDC SP 2017 Trilha .NET - TechWar: Threads, ThreadPools e Tasks em C#
TDC SP 2017 Trilha .NET - TechWar: Threads, ThreadPools e Tasks em C#
 
TDC2016 - SP - Trilha Xamarin - Entrega Contínua com Xamarin #MonteSuaEsteira
TDC2016 - SP - Trilha Xamarin - Entrega Contínua com Xamarin #MonteSuaEsteiraTDC2016 - SP - Trilha Xamarin - Entrega Contínua com Xamarin #MonteSuaEsteira
TDC2016 - SP - Trilha Xamarin - Entrega Contínua com Xamarin #MonteSuaEsteira
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

TDC SP 2019 - Trilha .NET - Clean Architecture

  • 1. Globalcode – Open4education Diego Cardoso Clean Architecture com ASP.NET Core 16 de Julho – 2019
  • 2. Globalcode – Open4education Trilha .Net Diego Cardoso Julho de 2019 Clean Architecture com ASP.NET Core
  • 3. • OrgulhosoFilho, Marido e Pai • Graduadoem Sistemasda Informaçãona FSA • Pós-Graduadoem Arquiteturade Softwarena FIAP • CertificadoMicrosoft:MCTS • Trabalhona GFT (Sorocaba) • +13 anos Analisando,Codificandoe Migrando • Entusiastacom foco em Arquiteturae MetodologiasÁgeis • Apaixonadopor Musica - guitarristaenferrujadonas horasvagas
  • 4. Globalcode – Open4education GFT – Temos vagas Mande seu currículo pra gente: Oportunidades.Brasil@gft.com facebook.com/gft.br linkedin.com/company/gft-group blog.gft.com/br www.twitter.com/gft_br @gft_tech www.gft.com/br @GFT-LATAM-Meetup
  • 5. Globalcode – Open4education Agenda Who is the Architect ? Clean Architecture Evolutionary Architecture Trends for 2019
  • 7. Globalcode – Open4education Architect - Skills 1 2 3 4 1 3 Translate Journeys to Requirements Middleware / Components Libraries / Frameworks / Assets Data persistence / cache Energize team members Create learning paths 2 Communicative / Presentation 4 Simplify component design 5 Infrastructure / Security 5 Innovate and create assets Technical Skills Soft Skills
  • 8. Globalcode – Open4education CLean = DDD + Hexagonal + Onion + CQRS How to put them all together and keep Clean(Lean) ?
  • 9. Globalcode – Open4education Recap: Flow of Controls Consumers Infrastructure Application Core User Interface File System Database Email / SMS Queue
  • 10. Globalcode – Open4education Persistence Clear Architecture App Services Consumers Infrastructure User Interface API Consumer CLI Infrastructure Domain Application Core App Services Presentation
  • 11. Globalcode – Open4education Persistence Domain Driven Design App Services Infrastructure Domain Application Core App Services Overview Entities Value Objects Enumerations Aggregate Root Logic Exceptions Key Points - Use data annotations sparingly - Use commands for logic - Use events for data propagation only when necessary - Use immutable VO and commands
  • 12. Globalcode – Open4education Persistence Application Services App Services Infrastructure Domain Application Core App Services Overview Key Points - Use CQRS to simply your overall design - MediatR to manage requests, responses, commands, queries, notifications and events - Work with VMs and DTOs - FailFast with FluentValidation and Valit - Create custom application exceptions Interfaces View Models Events Validators Logic Exceptions
  • 13. Globalcode – Open4education Persistence Persistence App Services Infrastructure Domain Application Core App Services Overview Key Points - Independent of the database - Conventions over configuration - Use Fluent API configuration over data annotations - CodeFirst and Migrations - Use an extension to automatically apply all entity type configurations Repository Cache Seeding Configurations Transactions Migrations
  • 14. Globalcode – Open4education Persistence Infrastructure App Services Infrastructure Domain Application Core App Services Overview Key Points - Implement interfaces(contracts) from Application Layer - No layer depends on Infrastructure Layer - Move configuration outside the code repository (e.g.: Consul or Azure KeyVault) Clients Email System Clock File System Queue Anything External
  • 15. Globalcode – Open4education Clean Arch with .NET Core Client Persistence: Repo = IQueryService + IPersitence EFCore Dapper MongoDB Driver and etc Infrastructure: Dependency Isolation Autofac for IoC Middleware: Authentication Authorization Analytics Log Package Msg API .NET Core Tests: Nunit / Xunit / xBehave FluentAssertion Code Quality: Sonar / R# / ts-clean-code
  • 16. Globalcode – Open4education Any fool can write code that a computer can understand. Good programmers write code that humans can understand. Martin Fowler
  • 17. Globalcode – Open4education Evolutionary Architecture Incremental : • Small and quick increments • Hide implements behind interfaces • Become reactive over predictive An Attitude: • Bring the pain forward • Frequent releases • Guide improvements based on Fitness Functions Infrastructure • Immutability • Replaceability • Assembility (container) • Solid infra to deliver and rollback product versions
  • 19. Julho/2019 #Thanks /diegosmorf Diego Cardoso Clean Architecture com ASP.NET Core