vkhorikov / SpecificationPattern

Implementation of the Specification Pattern in C#
304 stars 73 forks source link

Specification Pattern without LINQ #2

Closed dehghani-mehdi closed 4 years ago

dehghani-mehdi commented 4 years ago

Hi,

I saw your course, nice job as always.

I'm using Dapper in my project, can I use Specification Pattern with it? I mean is it logical?

vkhorikov commented 4 years ago

It's fine as long as you have at least 2 use cases for the Specification pattern. Also, here are a couple articles that may be helpful:

https://enterprisecraftsmanship.com/posts/cqrs-vs-specification-pattern/ https://enterprisecraftsmanship.com/posts/ddd-bulk-operations/

dehghani-mehdi commented 4 years ago

I already using CQRS in my application, and based on the last paragraph (before summary section) of the first mentioned article, I think there is no need to use Specification Pattern, I mean it sound like YAGNI violation, what do you think?

vkhorikov commented 4 years ago

No need if all you want is reuse querying logic between reads and writes.