Data Access Objects with the Entity Framework
March 14, 2009
For this article / tutorial I will demonstrate a quick and easy way on how to use data access objects (DAO’s) with the Entity Framework.
These data access objects form a layer between the business logic and the database access technology. The idea is that the business logic should remain ignorant of the technology used to access the database. Using this “DAO pattern” you can more easily interchange this backing technology.
In the text to come this will be demonstrated by setting up a simple domain model which will be modelled using the Entity Framework. Next a layer of DAO’s will be created on top of this domain model.
The business logic will only use these DAO’s to request or send back data from or to the underlying data store. How these CRUD operations are handled is entirely up to the implementation of the DAO’s and should be of no concert to the business logic.
By decoupling the business objects from the backing data store you can more easily switch to another database access technology such as for say Linq To Sql.
Entity Framework ObjectContext
February 21, 2009
It’s been a good two months since the last post. Today I finally found some spare time to write a new article about .NET. This will be the first article on this blog focusing solely on the Entity Framework. More in particular about using the Entity Framework in different environments such as Windows Applications and in an ASP.NET environment.
The Entity Framework has some drawbacks that will hopefully be addressed in the second release, but in its current state it’s already a really useful technology to use for database access.
This article will not discuss every feature of the Entity Framework as that would entail writing an entire book. The primary focus is on how to deal with the ObjectContext in different environments such as a regular Windows Application and a Web Application (ASP.NET). Let’s get started…

