Specification Pattern vs Data Mapper



Hello!

I find myself using specification pattern a lot lately, but in a
foreseaable future I will run in to following problem:

I'm using repositories as a way to abstract data access logic from my
model/domain code. There are simple methods defined on a repository
such as: GetAll, Add etc. There is also one additional method:
GetBySpecification which looks like this

MyObject[] GetMyObjectsBySpecification(ISpecification<T> spec);

From the model point of view, specification pattern is as clean and
nice as can be.
The question is: what to do with the specification when it comes to
data access layer code i.e. the data mapper.
How do you translate specification into a data access layer specific
code i.e. into SQL statemenents?

--
Michal

.



Relevant Pages

  • Re: DBMS and lisp, etc.
    ... >> write a data access layer specific to my application and implement it ... but will destroy performance on a DBMS. ... it's tempting to just have references to related objects as sublists ...
    (comp.lang.lisp)
  • Re: Circular dependency
    ... the business logic layer gets a request for an object. ... instantiates the object and passes it down to the data access layer. ... I expected to seperate each layer into different projects and reference ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to use typed datasets in 3-tier environment
    ... Data Access class and passing typed dataset to it. ... The typed DataSet objects don't need to know anything about the ... Check out the MSDN written Data Access Layer class, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Circular dependency
    ... Then both the Data Access Layer and the Business Logic Layer ... I expected to seperate each layer into different projects and reference ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Do you use the new datasource controls?
    ... It's fine for my dad's website, but not for the enterprise architecture I'm building, which will eventually need to have a web service. ... The code in the button click should be quite deeper, it should be encapsulated in a data access layer and exposed via a rich business layer. ... You don't actually need a DAL anymore, you just set properties of the data source and the framework does the dirty work for you. ...
    (microsoft.public.dotnet.framework.aspnet)