11. oktober 2008 06:42
lea
Embracing it all...
I've been trying to wrap my head around all those patterns and practices flying around without never actually striking a real home run. Even though www.andersnoras.com did a great job trying to explain it all a couple of years ago. After the recent MSDN Live in Oslo and some surfing, I think I finally found some real good samples, most of them from just over the fjord. (http://iridescence.no) :P
Recently we've been discussing wether to use Linq to Entities or Linq to Sql, and both imply dependencies of given classes. The only way to get around it is to declare even your business objects as interfaces, as if the programming against interface instead of implementation of services wasn't enough already. :P
Here's some links to what I found and are hoping to utilize:
Great articles by Fredrik Kalseth about loose coupling of domain model from data repository
http://iridescence.no/post/Linq-to-Sql-Programming-Against-an-Interface-and-the-Repository-Pattern.aspx
http://iridescence.no/post/Linq-the-Specification-Pattern-and-Encapsulation.aspx
MSDN Article about generics variance wrappers (For converting EntitySet<T> to IList<T>)
http://msdn.microsoft.com/en-us/library/ms228359(VS.80).aspx
Inversion of Control for configurable implementation of the repository (and more)
http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/03/31/ptom-the-dependency-inversion-principle.aspx
http://www.castleproject.org/ (Windsor)
Of course, the man should always get credit:
http://www.martinfowler.com/
Filed under: LINQ, ddd, patterns