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

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
Amit Kumar Singh
 

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 Architecture
Richard Freggi
 
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
David Linthicum
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
Wade Wegner
 
Building The Agile Database
Building The Agile DatabaseBuilding The Agile Database
Building The Agile Database
elliando dias
 
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
Jonathan Hamilton Solórzano
 
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
Dafna 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

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
Jacinto 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

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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