Chapter 14. Designing the application around Entity Framework
This chapter covers
- Basic concepts of layered architectures
- Principles of domain-driven design
- Repository pattern implementation with Entity Framework
This chapter moves slightly away from what you may expect from a book about ADO.NET Entity Framework. We’ve faced the matter of persistence from a technical point of view, trying to understand how to use this O/RM tool to store a graph of objects in a relational database. In this chapter, we’re going to discuss the same topic but from an architectural point of view.
First, we’ll look at how to integrate Entity Framework in a typical three-layer architecture, which represents a good and widely used strategy for designing modern applications. But layering itself may not be helpful in handling the complex business logic typical of enterprise applications; in these cases, your design must move toward a more suitable domain-driven design modeling style. Finally, we’ll look at how you can shape your object model to handle this kind of architecture and how Entity Framework fits in.