SlideShare a Scribd company logo
1 of 17
Business Logic From btn_Click to business layers Jon Limjap Senior Developer for ITRS MVP for C#
Agenda Where we left off Common patterns and anti-patterns of business logic Which ORM do I use? Towards a better designed application
Where we left off Entity Framework and other ORMs
Entity Framework (and other ORMs, really)
Why is this important? Separation of concerns Reuse of data access methods across different business rule implementations Centralized management of connection pools, data caching possibilities, etc.
Common patterns and anti-patterns of Business Logic How business logic is strewn across your application
Business Logic (and data access) in the UI layer User Interface/Data Access/Business Logic Business Logic and data access in click events, UI Data Providers, etc. Big Ball of Mud Relational Database
Business Logic in the Data Layer User Interface May or may not be present Data Access Layer Relational Database Business Logic in stored procedures
Business logic separate from data and UI User Interface Business Logic Layer Entity Framework, Nhibernate, LINQ to SQL, ADO, etc. Data Access Layer Relational Database
Business logic in the cloud HTTP Hosting/HTTP Listener Data Services Runtime Business Logic Layer Data Access Layer Relational Database
Which ORM do I use? If there’s very little difference between ORM’s anyway…
Considerations Database First: Generate model from existing database Model First: Create your model and generate your database Code First:  In-memory mapping (EF only)
Summary
Towards a better designed application Why bother going down this path
Why should I bother? Single Responsibility Principle  Change in once place fix everywhere Extensibility Testability
What do I do now? No need to change existing setup – unless you’ve decided to rewrite everything Baby steps For new features, code new layers in a “thin vertical slice” Expand only as needed
Further Reading

More Related Content

Viewers also liked

The courage to business logic – Business Driven Architecture
The courage to business logic – Business Driven Architecture The courage to business logic – Business Driven Architecture
The courage to business logic – Business Driven Architecture OPEN KNOWLEDGE GmbH
 
A Business Logic of Services
A Business Logic of ServicesA Business Logic of Services
A Business Logic of ServicesMalcolm Ryder
 
Bizlogic Infosystems Presentation
Bizlogic Infosystems PresentationBizlogic Infosystems Presentation
Bizlogic Infosystems PresentationPiyush Pandey
 
Service Objects in Rails apps
Service Objects in Rails appsService Objects in Rails apps
Service Objects in Rails appsDawid Cichuta
 
Joomla Day India 2009 Business Logic With The Mvc
Joomla Day India 2009   Business Logic With The MvcJoomla Day India 2009   Business Logic With The Mvc
Joomla Day India 2009 Business Logic With The MvcAmit Kumar Singh
 
Mind Your Business. And Its Logic
Mind Your Business. And Its LogicMind Your Business. And Its Logic
Mind Your Business. And Its LogicVladik Khononov
 
[Nuxeo World 2013] Workshop - Implement your Business Logic
[Nuxeo World 2013] Workshop - Implement your Business Logic[Nuxeo World 2013] Workshop - Implement your Business Logic
[Nuxeo World 2013] Workshop - Implement your Business LogicNuxeo
 
The Importance of Logic in Business
The Importance of Logic in BusinessThe Importance of Logic in Business
The Importance of Logic in BusinessGoutama Bachtiar
 
Critical Thinking & Logic in Ethics
Critical Thinking & Logic in EthicsCritical Thinking & Logic in Ethics
Critical Thinking & Logic in EthicsMia Eaker
 

Viewers also liked (10)

The courage to business logic – Business Driven Architecture
The courage to business logic – Business Driven Architecture The courage to business logic – Business Driven Architecture
The courage to business logic – Business Driven Architecture
 
A Business Logic of Services
A Business Logic of ServicesA Business Logic of Services
A Business Logic of Services
 
Bizlogic Infosystems Presentation
Bizlogic Infosystems PresentationBizlogic Infosystems Presentation
Bizlogic Infosystems Presentation
 
Service Objects in Rails apps
Service Objects in Rails appsService Objects in Rails apps
Service Objects in Rails apps
 
Joomla Day India 2009 Business Logic With The Mvc
Joomla Day India 2009   Business Logic With The MvcJoomla Day India 2009   Business Logic With The Mvc
Joomla Day India 2009 Business Logic With The Mvc
 
Mind Your Business. And Its Logic
Mind Your Business. And Its LogicMind Your Business. And Its Logic
Mind Your Business. And Its Logic
 
[Nuxeo World 2013] Workshop - Implement your Business Logic
[Nuxeo World 2013] Workshop - Implement your Business Logic[Nuxeo World 2013] Workshop - Implement your Business Logic
[Nuxeo World 2013] Workshop - Implement your Business Logic
 
The Importance of Logic in Business
The Importance of Logic in BusinessThe Importance of Logic in Business
The Importance of Logic in Business
 
4 m3 p
4 m3 p4 m3 p
4 m3 p
 
Critical Thinking & Logic in Ethics
Critical Thinking & Logic in EthicsCritical Thinking & Logic in Ethics
Critical Thinking & Logic in Ethics
 

Similar to MSDN Ramp-Up Part 3: Business logic

Data Modeling Enterprise Architecture
Data Modeling Enterprise ArchitectureData Modeling Enterprise Architecture
Data Modeling Enterprise ArchitectureRichard Freggi
 
Impact 2011 2667 - Developing effective services for use in critical business...
Impact 2011 2667 - Developing effective services for use in critical business...Impact 2011 2667 - Developing effective services for use in critical business...
Impact 2011 2667 - Developing effective services for use in critical business...Brian Petrini
 
Crossing the Mashup Chasm. Enterprise Mashup Requirements
Crossing the Mashup Chasm. Enterprise Mashup RequirementsCrossing the Mashup Chasm. Enterprise Mashup Requirements
Crossing the Mashup Chasm. Enterprise Mashup RequirementsJusto Hidalgo
 
5 Surefire Ways To Make Your Soa A Success
5 Surefire Ways To Make Your Soa A Success5 Surefire Ways To Make Your Soa A Success
5 Surefire Ways To Make Your Soa A SuccessDavid Linthicum
 
Why Data Virtualization? An Introduction by Denodo
Why Data Virtualization? An Introduction by DenodoWhy Data Virtualization? An Introduction by Denodo
Why Data Virtualization? An Introduction by DenodoJusto Hidalgo
 
Business application architecture in modern multi-cloud environment / Microso...
Business application architecture in modern multi-cloud environment / Microso...Business application architecture in modern multi-cloud environment / Microso...
Business application architecture in modern multi-cloud environment / Microso...Kazuya Sugimoto
 
Fast Sub-ML Usecase Development.pdf
Fast Sub-ML Usecase Development.pdfFast Sub-ML Usecase Development.pdf
Fast Sub-ML Usecase Development.pdfVenkata Pingali
 
Information management
Information managementInformation management
Information managementDavid Champeau
 
Master Data Management methodology
Master Data Management methodologyMaster Data Management methodology
Master Data Management methodologyDatabase Architechs
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for EnterprisesWade Wegner
 
Complexities of Separating Data in an ERP Environment
Complexities of Separating Data in an ERP EnvironmentComplexities of Separating Data in an ERP Environment
Complexities of Separating Data in an ERP Environmenteprentise
 
Building The Agile Database
Building The Agile DatabaseBuilding The Agile Database
Building The Agile Databaseelliando dias
 
SW Architecture Monolithic to SOA
SW Architecture Monolithic to SOASW Architecture Monolithic to SOA
SW Architecture Monolithic to SOARaman Kannan
 
t2_4-architecting-data-for-integration-and-longevity
t2_4-architecting-data-for-integration-and-longevityt2_4-architecting-data-for-integration-and-longevity
t2_4-architecting-data-for-integration-and-longevityJonathan Hamilton Solórzano
 
Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...
Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...
Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...Akshay Shah
 
Analyzing Business Requirements in a Visible Enterprise
Analyzing Business Requirements in a Visible EnterpriseAnalyzing Business Requirements in a Visible Enterprise
Analyzing Business Requirements in a Visible EnterpriseDafna Levy
 

Similar to MSDN Ramp-Up Part 3: Business logic (20)

Data Modeling Enterprise Architecture
Data Modeling Enterprise ArchitectureData Modeling Enterprise Architecture
Data Modeling Enterprise Architecture
 
Microstrategy
MicrostrategyMicrostrategy
Microstrategy
 
Business rules-extraction
Business rules-extractionBusiness rules-extraction
Business rules-extraction
 
Impact 2011 2667 - Developing effective services for use in critical business...
Impact 2011 2667 - Developing effective services for use in critical business...Impact 2011 2667 - Developing effective services for use in critical business...
Impact 2011 2667 - Developing effective services for use in critical business...
 
Crossing the Mashup Chasm. Enterprise Mashup Requirements
Crossing the Mashup Chasm. Enterprise Mashup RequirementsCrossing the Mashup Chasm. Enterprise Mashup Requirements
Crossing the Mashup Chasm. Enterprise Mashup Requirements
 
Cloud computing in context
Cloud computing in contextCloud computing in context
Cloud computing in context
 
5 Surefire Ways To Make Your Soa A Success
5 Surefire Ways To Make Your Soa A Success5 Surefire Ways To Make Your Soa A Success
5 Surefire Ways To Make Your Soa A Success
 
Why Data Virtualization? An Introduction by Denodo
Why Data Virtualization? An Introduction by DenodoWhy Data Virtualization? An Introduction by Denodo
Why Data Virtualization? An Introduction by Denodo
 
TowardsCognitive BPMas a Platform for Smart Process Support over Unstructured...
TowardsCognitive BPMas a Platform for Smart Process Support over Unstructured...TowardsCognitive BPMas a Platform for Smart Process Support over Unstructured...
TowardsCognitive BPMas a Platform for Smart Process Support over Unstructured...
 
Business application architecture in modern multi-cloud environment / Microso...
Business application architecture in modern multi-cloud environment / Microso...Business application architecture in modern multi-cloud environment / Microso...
Business application architecture in modern multi-cloud environment / Microso...
 
Fast Sub-ML Usecase Development.pdf
Fast Sub-ML Usecase Development.pdfFast Sub-ML Usecase Development.pdf
Fast Sub-ML Usecase Development.pdf
 
Information management
Information managementInformation management
Information management
 
Master Data Management methodology
Master Data Management methodologyMaster Data Management methodology
Master Data Management methodology
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
 
Complexities of Separating Data in an ERP Environment
Complexities of Separating Data in an ERP EnvironmentComplexities of Separating Data in an ERP Environment
Complexities of Separating Data in an ERP Environment
 
Building The Agile Database
Building The Agile DatabaseBuilding The Agile Database
Building The Agile Database
 
SW Architecture Monolithic to SOA
SW Architecture Monolithic to SOASW Architecture Monolithic to SOA
SW Architecture Monolithic to SOA
 
t2_4-architecting-data-for-integration-and-longevity
t2_4-architecting-data-for-integration-and-longevityt2_4-architecting-data-for-integration-and-longevity
t2_4-architecting-data-for-integration-and-longevity
 
Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...
Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...
Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...
 
Analyzing Business Requirements in a Visible Enterprise
Analyzing Business Requirements in a Visible EnterpriseAnalyzing Business Requirements in a Visible Enterprise
Analyzing Business Requirements in a Visible Enterprise
 

More from Jacinto Limjap

Maintainable UI Tests with Selenium and C#
Maintainable UI Tests with Selenium and C#Maintainable UI Tests with Selenium and C#
Maintainable UI Tests with Selenium and C#Jacinto Limjap
 
Refactoring to Microservices
Refactoring to MicroservicesRefactoring to Microservices
Refactoring to MicroservicesJacinto Limjap
 
Donetconf2016: The Future of C#
Donetconf2016: The Future of C#Donetconf2016: The Future of C#
Donetconf2016: The Future of C#Jacinto Limjap
 
C# and the Evolution of a Programming Language
C# and the Evolution of a Programming LanguageC# and the Evolution of a Programming Language
C# and the Evolution of a Programming LanguageJacinto Limjap
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Jacinto Limjap
 
N-tier and oop - moving across technologies
N-tier and oop - moving across technologiesN-tier and oop - moving across technologies
N-tier and oop - moving across technologiesJacinto Limjap
 
Developing windows phone 7 applications
Developing windows phone 7 applicationsDeveloping windows phone 7 applications
Developing windows phone 7 applicationsJacinto Limjap
 
Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7Jacinto Limjap
 
Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0Jacinto Limjap
 
Three Developer Abilities They Dont Teach In College
Three Developer  Abilities They Dont Teach In CollegeThree Developer  Abilities They Dont Teach In College
Three Developer Abilities They Dont Teach In CollegeJacinto Limjap
 

More from Jacinto Limjap (11)

Maintainable UI Tests with Selenium and C#
Maintainable UI Tests with Selenium and C#Maintainable UI Tests with Selenium and C#
Maintainable UI Tests with Selenium and C#
 
Refactoring to Microservices
Refactoring to MicroservicesRefactoring to Microservices
Refactoring to Microservices
 
Donetconf2016: The Future of C#
Donetconf2016: The Future of C#Donetconf2016: The Future of C#
Donetconf2016: The Future of C#
 
C# and the Evolution of a Programming Language
C# and the Evolution of a Programming LanguageC# and the Evolution of a Programming Language
C# and the Evolution of a Programming Language
 
SQL vs NoSQL
SQL vs NoSQLSQL vs NoSQL
SQL vs NoSQL
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
 
N-tier and oop - moving across technologies
N-tier and oop - moving across technologiesN-tier and oop - moving across technologies
N-tier and oop - moving across technologies
 
Developing windows phone 7 applications
Developing windows phone 7 applicationsDeveloping windows phone 7 applications
Developing windows phone 7 applications
 
Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7
 
Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0
 
Three Developer Abilities They Dont Teach In College
Three Developer  Abilities They Dont Teach In CollegeThree Developer  Abilities They Dont Teach In College
Three Developer Abilities They Dont Teach In College
 

Recently uploaded

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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 WorkerThousandEyes
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

MSDN Ramp-Up Part 3: Business logic

  • 1. Business Logic From btn_Click to business layers Jon Limjap Senior Developer for ITRS MVP for C#
  • 2. Agenda Where we left off Common patterns and anti-patterns of business logic Which ORM do I use? Towards a better designed application
  • 3. Where we left off Entity Framework and other ORMs
  • 4. Entity Framework (and other ORMs, really)
  • 5. Why is this important? Separation of concerns Reuse of data access methods across different business rule implementations Centralized management of connection pools, data caching possibilities, etc.
  • 6. Common patterns and anti-patterns of Business Logic How business logic is strewn across your application
  • 7. Business Logic (and data access) in the UI layer User Interface/Data Access/Business Logic Business Logic and data access in click events, UI Data Providers, etc. Big Ball of Mud Relational Database
  • 8. Business Logic in the Data Layer User Interface May or may not be present Data Access Layer Relational Database Business Logic in stored procedures
  • 9. Business logic separate from data and UI User Interface Business Logic Layer Entity Framework, Nhibernate, LINQ to SQL, ADO, etc. Data Access Layer Relational Database
  • 10. Business logic in the cloud HTTP Hosting/HTTP Listener Data Services Runtime Business Logic Layer Data Access Layer Relational Database
  • 11. Which ORM do I use? If there’s very little difference between ORM’s anyway…
  • 12. Considerations Database First: Generate model from existing database Model First: Create your model and generate your database Code First: In-memory mapping (EF only)
  • 14. Towards a better designed application Why bother going down this path
  • 15. Why should I bother? Single Responsibility Principle Change in once place fix everywhere Extensibility Testability
  • 16. What do I do now? No need to change existing setup – unless you’ve decided to rewrite everything Baby steps For new features, code new layers in a “thin vertical slice” Expand only as needed