Re: Specification Pattern vs Data Mapper
- From: Jens Winter <jens.winter@xxxxxxxxxxx>
- Date: Sat, 03 Feb 2007 12:53:41 +0100
Mikeon wrote:
MyObject[] GetMyObjectsBySpecification(ISpecification<T> spec);
nice as can be.From the model point of view, specification pattern is as clean and
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?
Hello Michal,
You should check out Eric Evans' book "Domain Driven Design":
http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215
Evans describes a way how to do selection with the specification pattern.
Unfortunately, I don't have the book here at the moment. So I can't give you more information about the suggestions from the book. If I remember correctly, Evans uses IoC to decouple the specifications and the SQL generation.
Ciao,
Jens
--
http://www.jenswinter.com
.
- Follow-Ups:
- Re: Specification Pattern vs Data Mapper
- From: Mikeon
- Re: Specification Pattern vs Data Mapper
- References:
- Specification Pattern vs Data Mapper
- From: Mikeon
- Specification Pattern vs Data Mapper
- Prev by Date: SETP-07 call for papers
- Next by Date: Re: Specification Pattern vs Data Mapper
- Previous by thread: Specification Pattern vs Data Mapper
- Next by thread: Re: Specification Pattern vs Data Mapper
- Index(es):