Chapter 1. Data access reloaded: Entity Framework
This chapter covers
- DataSet and classic ADO.NET approach
- Object model approach
- Object/relational mismatch
- Entity Framework as a solution
When you design an application, you have to decide how to access and represent data. This decision is likely the most important one you’ll make in terms of application performance and ease of development and maintainability. In every project we’ve worked on, the persistence mechanism was a relational database. Despite some attempts to introduce object databases, the relational database is still, and will be for many years, the main persistence mechanism.
Nowadays, relational databases offer all the features you need to persist and retrieve data. You have tables to maintain data, views to logically organize them so that they’re easier to consume, stored procedures to abstract the application from the database structure and improve performance, foreign keys to relate records in different tables, security checks to avoid unauthorized access to sensitive data, the ability to transparently encrypt and decrypt data, and so on. There’s a lot more under the surface, but these features are ones most useful to developers.