Hello!
For some time I have been thinking on the following two sentence:
"Yet another approach for querying is to use the Specification
pattern" ... "Even those Specification classes could very well spit
out IQuery"
Those are sentences from Jimmy Nilsson's book on DDD.
As much as I like the specification pattern and the possibility to
use it with repositories like this:
Rository r = new Repository();
Specification s = new LongNameSpecification();
User[] users = r.GetBySpec(s);
I have simply no idea, what should I do with the specification object
when it comes to real implementation when using some kind of data
mapper or a plain sql even.
Jimmy Nilsson states that Specification can spit IQuery (some kind of
Query Object). OK. If I had IQuery i can work with it, but how do I
get it? I cannot accept coding the same logic once in the
IsSatisfiedBy method and once to spit IQuery and I have no idea how
to do it otherwise.
Any suggestions?
--
Michal