SlideShare una empresa de Scribd logo
1 de 16
Vidyasagar MSC
Onion Architecture :
ASP.NET
Cutting Layers without Crying
@IamVMac
ABOUT ME
• Coder by Profession | Gamer by Heart | Polyglot &
Pragmatic Programmer
• Microsoft MVP – Xbox | Intel Software Innovator |
Developer @ DELL
• @iAmVMac
• http://iamGa.Me
• http://about.me/mscvidyasagar
@IamVMac
What’s software architecture?
@IamVMac
Architectural Style
@IamVMac
Layered Architecture
Partitions the concerns of the application into
stacked groups (layers).
@IamVMac
@IamVMac
@IamVMac
@IamVMac
@IamVMac
@IamVMac
Traditional 3-layer
Architecture
Infrastructure /
DAL
Core / BLL
UI
DB
Utilities/Common/Shared
nHibernate /
LINQ to
SQL
ASP.NET
Log4Net
AutoMapper
StructureMa
p
@IamVMac
• Very easy for developers over time to put more and more business logic in the UI layer
• Counter-productive to build your application on top of a specific technology that is sure to
change over time
• Logic is easily scattered all over, locating code becomes a major effort.
• Developers over time struggle to determine where code should go… DAL? BLL? Utilities?
• Business logic has many tentacles extending from it (directly and indirectly)
• Library explosion: Makes it easy take a dependency without putting much thought into it, and
now it’s littered all over the code base
Problems with Traditional Architecture
The Onion Architecture to rescue
• Quoted by Jeffrey Palermo in 2008.
• relies heavily on the Dependency Inversion principle.
• The database is not the center. It is external.
@IamVMac
@IamVMac
DependencyResolution
Infrastructure
ProductRepository
<<class>>
Application Core
Application Services
Domain Services
Domain Model
IProductRepository
DB
IUserSession
HttpUserSession
<<class>>
ProductsController
Browser hits:
/Products/List
@IamVMac
•Everything unique to the business: Domain model, validation rules,
business workflows
•Defines all technical implementation (non-business) needs as
interfaces
•CANNOT reference any external libraries
•NO technology specific code
Core
•Provide implementations for Core interfaces
•Call web services, access a database
•CAN reference external libraries to provide implementations
•ONLY technology specific code (non-business) belongs in
infrastructure
Infrastructure
•Very thin layer, has no logic of its own
•Wires up Core interfaces to Infrastructure implementations.
•Runs startup/configuration logic
Dependency
Resolution
@IamVMac
@IamVMac

Más contenido relacionado

La actualidad más candente

Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net coreSam Nasr, MCSA, MVP
 
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Simplilearn
 
ITkonekt 2019 | Robert C. Martin (Uncle Bob), Clean Architecture and Design
ITkonekt 2019 | Robert C. Martin (Uncle Bob), Clean Architecture and DesignITkonekt 2019 | Robert C. Martin (Uncle Bob), Clean Architecture and Design
ITkonekt 2019 | Robert C. Martin (Uncle Bob), Clean Architecture and DesignErginBilgin3
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignRyan Riley
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepGuo Albert
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices Bozhidar Bozhanov
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architectureThe Software House
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsAraf Karsh Hamid
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices Amazon Web Services
 
Introducing Clean Architecture
Introducing Clean ArchitectureIntroducing Clean Architecture
Introducing Clean ArchitectureRoc Boronat
 
Domain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and MicroservicesDomain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and MicroservicesRadosław Maziarka
 
DevOps topologies
DevOps topologiesDevOps topologies
DevOps topologiesSushma
 

La actualidad más candente (20)

Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net core
 
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
 
Domain Driven Design
Domain Driven Design Domain Driven Design
Domain Driven Design
 
ITkonekt 2019 | Robert C. Martin (Uncle Bob), Clean Architecture and Design
ITkonekt 2019 | Robert C. Martin (Uncle Bob), Clean Architecture and DesignITkonekt 2019 | Robert C. Martin (Uncle Bob), Clean Architecture and Design
ITkonekt 2019 | Robert C. Martin (Uncle Bob), Clean Architecture and Design
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices
 
JPA For Beginner's
JPA For Beginner'sJPA For Beginner's
JPA For Beginner's
 
Introducing Clean Architecture
Introducing Clean ArchitectureIntroducing Clean Architecture
Introducing Clean Architecture
 
Domain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and MicroservicesDomain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and Microservices
 
DevOps explained
DevOps explainedDevOps explained
DevOps explained
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
DevOps topologies
DevOps topologiesDevOps topologies
DevOps topologies
 

Similar a Onion architecture

Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolithMarkus Eisele
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolithMarkus Eisele
 
Are you ready for Microservices
Are you ready for MicroservicesAre you ready for Microservices
Are you ready for MicroservicesAsiri Liyanage
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsBrad Williams
 
ITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interopITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interopITCamp
 
Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)ITCamp
 
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...ITCamp
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREAraf Karsh Hamid
 
ITCamp 2013 - Petru Jucovschi - Application ecosystems
ITCamp 2013 - Petru Jucovschi - Application ecosystemsITCamp 2013 - Petru Jucovschi - Application ecosystems
ITCamp 2013 - Petru Jucovschi - Application ecosystemsITCamp
 
Enterprise Java on Azure: From Java EE to Spring, we have you covered
Enterprise Java on Azure: From Java EE to Spring, we have you coveredEnterprise Java on Azure: From Java EE to Spring, we have you covered
Enterprise Java on Azure: From Java EE to Spring, we have you coveredEd Burns
 
20120621 creating rich, responsive display and editor
20120621 creating rich, responsive display and editor20120621 creating rich, responsive display and editor
20120621 creating rich, responsive display and editorBIWUG
 
Microsoft, Citrix and SCOM: EOL or a New Beginning ?
Microsoft, Citrix and SCOM:  EOL or a New Beginning ?Microsoft, Citrix and SCOM:  EOL or a New Beginning ?
Microsoft, Citrix and SCOM: EOL or a New Beginning ?eG Innovations
 
DevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile GamesDevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile GamesAndreas Katzig
 

Similar a Onion architecture (20)

Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Are you ready for Microservices
Are you ready for MicroservicesAre you ready for Microservices
Are you ready for Microservices
 
Microservices
MicroservicesMicroservices
Microservices
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.js
 
ITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interopITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interop
 
Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)
 
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
About 4Ward
About 4WardAbout 4Ward
About 4Ward
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SRE
 
ITCamp 2013 - Petru Jucovschi - Application ecosystems
ITCamp 2013 - Petru Jucovschi - Application ecosystemsITCamp 2013 - Petru Jucovschi - Application ecosystems
ITCamp 2013 - Petru Jucovschi - Application ecosystems
 
Enterprise Java on Azure: From Java EE to Spring, we have you covered
Enterprise Java on Azure: From Java EE to Spring, we have you coveredEnterprise Java on Azure: From Java EE to Spring, we have you covered
Enterprise Java on Azure: From Java EE to Spring, we have you covered
 
20120621 creating rich, responsive display and editor
20120621 creating rich, responsive display and editor20120621 creating rich, responsive display and editor
20120621 creating rich, responsive display and editor
 
UI frameworks
UI frameworksUI frameworks
UI frameworks
 
Microsoft, Citrix and SCOM: EOL or a New Beginning ?
Microsoft, Citrix and SCOM:  EOL or a New Beginning ?Microsoft, Citrix and SCOM:  EOL or a New Beginning ?
Microsoft, Citrix and SCOM: EOL or a New Beginning ?
 
DevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile GamesDevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile Games
 
Technology platform
Technology platformTechnology platform
Technology platform
 
Technology platform
Technology platformTechnology platform
Technology platform
 
Evolve 19 | Kevin Campton & Sharat Radhakrishnan | Industry Focus | Autodesk ...
Evolve 19 | Kevin Campton & Sharat Radhakrishnan | Industry Focus | Autodesk ...Evolve 19 | Kevin Campton & Sharat Radhakrishnan | Industry Focus | Autodesk ...
Evolve 19 | Kevin Campton & Sharat Radhakrishnan | Industry Focus | Autodesk ...
 

Más de Vidyasagar Machupalli

Serverless + Machine Learning – Bringing the best of two worlds together
Serverless + Machine Learning – Bringing the best of two worlds togetherServerless + Machine Learning – Bringing the best of two worlds together
Serverless + Machine Learning – Bringing the best of two worlds togetherVidyasagar Machupalli
 
Mobile and Serverless : an Untold Story
Mobile and Serverless : an Untold StoryMobile and Serverless : an Untold Story
Mobile and Serverless : an Untold StoryVidyasagar Machupalli
 
Patterns for Mobile and IoT backends with serverless paradigms
Patterns for Mobile and IoT backends with serverless paradigmsPatterns for Mobile and IoT backends with serverless paradigms
Patterns for Mobile and IoT backends with serverless paradigmsVidyasagar Machupalli
 
Building Enterprise enabled Cognitive Mobile application for a Hybrid Cloud E...
Building Enterprise enabled Cognitive Mobile application for a Hybrid Cloud E...Building Enterprise enabled Cognitive Mobile application for a Hybrid Cloud E...
Building Enterprise enabled Cognitive Mobile application for a Hybrid Cloud E...Vidyasagar Machupalli
 
Stock portfolio analysis with Cloud Foundry and AI services - Cloud Foundry Days
Stock portfolio analysis with Cloud Foundry and AI services - Cloud Foundry DaysStock portfolio analysis with Cloud Foundry and AI services - Cloud Foundry Days
Stock portfolio analysis with Cloud Foundry and AI services - Cloud Foundry DaysVidyasagar Machupalli
 
Go Cloud Native with IBM Bluemix Developer Console - GIDS17
Go Cloud Native with IBM Bluemix Developer Console - GIDS17Go Cloud Native with IBM Bluemix Developer Console - GIDS17
Go Cloud Native with IBM Bluemix Developer Console - GIDS17Vidyasagar Machupalli
 
Microservices and Serverless Computing - OpenWhisk
Microservices and Serverless Computing - OpenWhiskMicroservices and Serverless Computing - OpenWhisk
Microservices and Serverless Computing - OpenWhiskVidyasagar Machupalli
 
Create Your Own Voice Assistant Using Watson and IBM Bluemix
Create Your Own Voice Assistant Using Watson and IBM BluemixCreate Your Own Voice Assistant Using Watson and IBM Bluemix
Create Your Own Voice Assistant Using Watson and IBM BluemixVidyasagar Machupalli
 
Create Event-Driven iOS Apps Using IBM Mobile Foundation, OpenWhisk Runtime a...
Create Event-Driven iOS Apps Using IBM Mobile Foundation, OpenWhisk Runtime a...Create Event-Driven iOS Apps Using IBM Mobile Foundation, OpenWhisk Runtime a...
Create Event-Driven iOS Apps Using IBM Mobile Foundation, OpenWhisk Runtime a...Vidyasagar Machupalli
 
Build,Run and manage MobileFirst apps with Eclipse
Build,Run and manage MobileFirst apps with EclipseBuild,Run and manage MobileFirst apps with Eclipse
Build,Run and manage MobileFirst apps with EclipseVidyasagar Machupalli
 
IBM MobileFirst Platform for iOS Swift Developers
IBM MobileFirst Platform for iOS Swift DevelopersIBM MobileFirst Platform for iOS Swift Developers
IBM MobileFirst Platform for iOS Swift DevelopersVidyasagar Machupalli
 
Intro to Gaming- MonoGame/CocosSharp/UrhoSharp
Intro to Gaming- MonoGame/CocosSharp/UrhoSharpIntro to Gaming- MonoGame/CocosSharp/UrhoSharp
Intro to Gaming- MonoGame/CocosSharp/UrhoSharpVidyasagar Machupalli
 
Build Once and port your game to multiple platforms including UWP
Build Once and port your game to multiple platforms including UWPBuild Once and port your game to multiple platforms including UWP
Build Once and port your game to multiple platforms including UWPVidyasagar Machupalli
 
Android Material Design & Android M Preview Updates
Android Material Design & Android M Preview UpdatesAndroid Material Design & Android M Preview Updates
Android Material Design & Android M Preview UpdatesVidyasagar Machupalli
 

Más de Vidyasagar Machupalli (20)

Being cloud native with IBM cloud
Being cloud native with IBM cloudBeing cloud native with IBM cloud
Being cloud native with IBM cloud
 
Serverless + Machine Learning – Bringing the best of two worlds together
Serverless + Machine Learning – Bringing the best of two worlds togetherServerless + Machine Learning – Bringing the best of two worlds together
Serverless + Machine Learning – Bringing the best of two worlds together
 
Mobile and Serverless : an Untold Story
Mobile and Serverless : an Untold StoryMobile and Serverless : an Untold Story
Mobile and Serverless : an Untold Story
 
Patterns for Mobile and IoT backends with serverless paradigms
Patterns for Mobile and IoT backends with serverless paradigmsPatterns for Mobile and IoT backends with serverless paradigms
Patterns for Mobile and IoT backends with serverless paradigms
 
Building Enterprise enabled Cognitive Mobile application for a Hybrid Cloud E...
Building Enterprise enabled Cognitive Mobile application for a Hybrid Cloud E...Building Enterprise enabled Cognitive Mobile application for a Hybrid Cloud E...
Building Enterprise enabled Cognitive Mobile application for a Hybrid Cloud E...
 
Stock portfolio analysis with Cloud Foundry and AI services - Cloud Foundry Days
Stock portfolio analysis with Cloud Foundry and AI services - Cloud Foundry DaysStock portfolio analysis with Cloud Foundry and AI services - Cloud Foundry Days
Stock portfolio analysis with Cloud Foundry and AI services - Cloud Foundry Days
 
Go Cloud Native with IBM Bluemix Developer Console - GIDS17
Go Cloud Native with IBM Bluemix Developer Console - GIDS17Go Cloud Native with IBM Bluemix Developer Console - GIDS17
Go Cloud Native with IBM Bluemix Developer Console - GIDS17
 
Microservices and Serverless Computing - OpenWhisk
Microservices and Serverless Computing - OpenWhiskMicroservices and Serverless Computing - OpenWhisk
Microservices and Serverless Computing - OpenWhisk
 
Create Your Own Voice Assistant Using Watson and IBM Bluemix
Create Your Own Voice Assistant Using Watson and IBM BluemixCreate Your Own Voice Assistant Using Watson and IBM Bluemix
Create Your Own Voice Assistant Using Watson and IBM Bluemix
 
Create Event-Driven iOS Apps Using IBM Mobile Foundation, OpenWhisk Runtime a...
Create Event-Driven iOS Apps Using IBM Mobile Foundation, OpenWhisk Runtime a...Create Event-Driven iOS Apps Using IBM Mobile Foundation, OpenWhisk Runtime a...
Create Event-Driven iOS Apps Using IBM Mobile Foundation, OpenWhisk Runtime a...
 
Bringing swift to cloud
Bringing swift to cloudBringing swift to cloud
Bringing swift to cloud
 
SWIFTly, Go Cloud!! - Swift@IBM
SWIFTly, Go Cloud!! - Swift@IBMSWIFTly, Go Cloud!! - Swift@IBM
SWIFTly, Go Cloud!! - Swift@IBM
 
Build,Run and manage MobileFirst apps with Eclipse
Build,Run and manage MobileFirst apps with EclipseBuild,Run and manage MobileFirst apps with Eclipse
Build,Run and manage MobileFirst apps with Eclipse
 
IBM MobileFirst Platform for iOS Swift Developers
IBM MobileFirst Platform for iOS Swift DevelopersIBM MobileFirst Platform for iOS Swift Developers
IBM MobileFirst Platform for iOS Swift Developers
 
Kitura swift IBM
Kitura swift IBMKitura swift IBM
Kitura swift IBM
 
Swift on IBM Bluemix
Swift on IBM BluemixSwift on IBM Bluemix
Swift on IBM Bluemix
 
Intro to Gaming- MonoGame/CocosSharp/UrhoSharp
Intro to Gaming- MonoGame/CocosSharp/UrhoSharpIntro to Gaming- MonoGame/CocosSharp/UrhoSharp
Intro to Gaming- MonoGame/CocosSharp/UrhoSharp
 
Gaming in Csharp
Gaming in CsharpGaming in Csharp
Gaming in Csharp
 
Build Once and port your game to multiple platforms including UWP
Build Once and port your game to multiple platforms including UWPBuild Once and port your game to multiple platforms including UWP
Build Once and port your game to multiple platforms including UWP
 
Android Material Design & Android M Preview Updates
Android Material Design & Android M Preview UpdatesAndroid Material Design & Android M Preview Updates
Android Material Design & Android M Preview Updates
 

Último

Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024eCommerce Institute
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...henrik385807
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfhenrik385807
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyPooja Nehwal
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Delhi Call girls
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )Pooja Nehwal
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Pooja Nehwal
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaKayode Fayemi
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 

Último (20)

Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 

Onion architecture

  • 1. Vidyasagar MSC Onion Architecture : ASP.NET Cutting Layers without Crying @IamVMac
  • 2. ABOUT ME • Coder by Profession | Gamer by Heart | Polyglot & Pragmatic Programmer • Microsoft MVP – Xbox | Intel Software Innovator | Developer @ DELL • @iAmVMac • http://iamGa.Me • http://about.me/mscvidyasagar @IamVMac
  • 5. Layered Architecture Partitions the concerns of the application into stacked groups (layers). @IamVMac
  • 10. @IamVMac Traditional 3-layer Architecture Infrastructure / DAL Core / BLL UI DB Utilities/Common/Shared nHibernate / LINQ to SQL ASP.NET Log4Net AutoMapper StructureMa p
  • 11. @IamVMac • Very easy for developers over time to put more and more business logic in the UI layer • Counter-productive to build your application on top of a specific technology that is sure to change over time • Logic is easily scattered all over, locating code becomes a major effort. • Developers over time struggle to determine where code should go… DAL? BLL? Utilities? • Business logic has many tentacles extending from it (directly and indirectly) • Library explosion: Makes it easy take a dependency without putting much thought into it, and now it’s littered all over the code base Problems with Traditional Architecture
  • 12. The Onion Architecture to rescue • Quoted by Jeffrey Palermo in 2008. • relies heavily on the Dependency Inversion principle. • The database is not the center. It is external. @IamVMac
  • 13. @IamVMac DependencyResolution Infrastructure ProductRepository <<class>> Application Core Application Services Domain Services Domain Model IProductRepository DB IUserSession HttpUserSession <<class>> ProductsController Browser hits: /Products/List
  • 14. @IamVMac •Everything unique to the business: Domain model, validation rules, business workflows •Defines all technical implementation (non-business) needs as interfaces •CANNOT reference any external libraries •NO technology specific code Core •Provide implementations for Core interfaces •Call web services, access a database •CAN reference external libraries to provide implementations •ONLY technology specific code (non-business) belongs in infrastructure Infrastructure •Very thin layer, has no logic of its own •Wires up Core interfaces to Infrastructure implementations. •Runs startup/configuration logic Dependency Resolution