MSDN Ramp-Up Part 3: Business logic

2,749 views

Published on

Slides for the third of a four part series discussing how to convert Visual Basic 6 applications to modern architectures and the .NET Framework

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,749
On SlideShare
0
From Embeds
0
Number of Embeds
1,025
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

MSDN Ramp-Up Part 3: Business logic

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

×