There are a number of implementations of the Repository pattern over EF and NHibernate. I’ve done a post which I have to import into my new blog that shows how easy it is when using the Repo/UnitOfWork patterns together to switch between InMemory (for unit testing), EF, and NHibernate as your store. The upside is that you don’t have to build your own query object, .NET has one built in via LINQ (which both NHibernate and Entity Framework support).
As for loading your Domain Objects, the repository is responsible for doing that. And using NH or EF as your backing store, you get change tracking, lazy loading, and a lot of other benefits out of the box.
At this point, I’d actually recommend EF over NH. The migrations and other features that have come with the recent releases places it ahead.
Hope this helps,
--Mike
--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi,
To me an important aspect is to keep technical concerns, such as DB-integration, out of the domain model. It is a way to control complexity. Therefor I do not see tying the domain objects to an ORM being an alternative. In this post I write a bit about the style I've been using: http://se-thinking.blogspot.se/2012/09/ddd-on-top-of-services-ddd-inside.html
Jörgen
--
--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
I've found the easiest to be an in memory db for tests. Still not perfect, but better in terms of modeling real scenarios without having to try and mimic the persistence behavior through mocks/fakes. If the repository is chunky (give me this view model) as opposed to generic (Get<T>), mocking the repo will work fine. I just don't like classes with a single method call that get used in one place in an app just 'for testing'. Anemic.
--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Personally, I reserve stored procedures for edge cases. Also, I prefer smaller, decoupled databases by BC rather than a single monolithic db. But, since the OP mentioned 300 tables and complex read scenarios, I figure one has to make do with that.
I'd hope that a web server doesn't have enough memory to hold a 300 table db, but I take your point. Most solutions are over engineered. By breaking systems down into smaller apps, it becomes easier to see how simple solutions can be effective.