Daily Archives: April 11, 2012

Separation of Concerns – Data Access Layer

Now that the World of Art database has been abstracted, as an entity data model, we can focus on adding the data access layer to our architecture. This layer will act as an interface to the entity data model. The data access layer will create distance and independence from the data source, for the user interface layer, the business logic layer and the services layer.

The first thing I want to do in the data access layer, is create an abstract interface. The following code snippet illustrates this. As you can see, this is a generic interface. I’m using the System.Collections.Generic class, to declare this as a public interface called IArtWorldCollection, which implements a generic object type signified by “T”. The single purpose of this interface, is to create a generic list or collection of objects, from the World of Art Domain. We will reveal the details on how this is done, when we actually implement this Interface.