0
votes

after hours of research i still don't know, which is the best way to build a n-tier ddd application with an ORM like SubSonic.

The projects structure should be similiar to the following:

1 - Presentation Layer (WPF MVVM)

2 - Application Layer

3 - Domain Layer -> where the Domain Entities/Business Entities are living (POCOs???)

4 - Infrastructure Layer -> Repositories + Models + Persistence + SubSonic

What i want is the following:

  1. Using a Domain-Driven-Design approach
  2. Using the Repository Pattern to abstract between Domain and ORM
  3. Using SubSonic as ORM

My Questions are:

What will be the best way to accomplish this in combination with SubSonic? Which is the best way of using SubSonic (ActiveRecord, Repository, T4)?

Does it make sense to build the application structure in this specific way (in respect to the use of DDD in combination with SubSonic)?

Thank you for your answers and ideas.

krisan

1
SubSonic is only maintained by a few people. I would be weary of using it on a business critical application. nHibernate, LinqToSql and EF each have their pros and cons but are probably better long term bets than SubSonic. - Todd Smith

1 Answers

0
votes

Be aware that SubSonic forces you into a class per table model. Those classes then are not suitable for using directly as Entities and Aggregates in DDD. You can of course map between the SubSonic classes and your own domain model classes, but then using SubSonic isn't gaining you much.