Just Published the English version of our ‘DDD N-Layered .NET 4.0 Architecture Guide’ book and Sample-App at CODEPLEX


Platform Architecture Teamimage

[UPDATED – April 2017] – IMPORTANT:  For up-to-date architecture and development guidance using .NET (i.e. .NET Core, ASP.NET Core, Docker containers, etc.) including Domain-Driven Design patterns, microservices architectures and other .NET related technologies like Xamarin for mobile apps check this landing page pointing to multiple NEW guides and reference applications:

https://www.microsoft.com/net/architecture/

Specifically, most of the DDD (Domain-Driven Design) patterns explained in the guidance written in 2010/2011 are still valid nowadays, however all the technologies have evolved significantly. Also, many new architecture patterns like Microservices Architecture (which is deriving from Domain-Driven Design) have been polished and improved over the years.

Thanks,

Cesar.

////

[UPDATED – Feb. 2013] The sample application can be downloaded from here: https://1drv.ms/u/s!Ag33_uWyTcH5n9g2UGtmmF11BefagQ

The last released Guide chapters can be downloaded from here: https://1drv.ms/u/s!Ag33_uWyTcH5n9g4QYJtUF9Zdyelxw

The CODEPLEX site was unpublished since it was a non-evolving site, nowadays.

We just published the English version of our ‘DDD N-Layered .NET 4.0 Architecture Guide’ book (at MSDN).

The ‘landing page’ where you can download the free eBook in several formats like .PDF, .XPS and for eBook Readers (.EPUB, .MOBI) is the following:

 

http://msdn.microsoft.com/es-es/architecture/en/

This special post is dedicated to let you know that we recently published at MSDN the new DDD .NET 4.0 Architecture Guide/Book (First Edition in English), available as eBook (.PDF, .EPUB and .MOBI) which follows Domain Driven Design Architectural style and trends. We also provide an end-to-end sample application (at CODEPLEX) where you can check every .NET code aspect. We were working on it during 2010 and published the same guidance in Spanish in late 2010. Since its first publication we got really good feedback you can check below and at our CODEPLEX site.

Microsoft has noticed, in multiple customers and partners, the need to have a “.NET Base Architecture Guide” that can serve as an outline for designing and implementing complex and mission critical enterprise .NET applications with long term life and long evolution (DDD target apps). This frame of common work defines a clear path to the design and implementation of business applications of great importance with a considerable volume of business logic. Following these guidelines offers important benefits regarding quality, stability, and especially, an improvement of future maintenance of the application, due to the loose-coupling between components, homogeneity, and similarities of the different developments that will be done based on these guidelines.

 

This Architecture Guidance has also been reviewed by the Microsoft Entity Framework Product Group (Microsoft Corp) because EF is a core component of the technology it uses.

It is also available as a regular printed book, in English or Spanish, from Krasis Press:

 

Sample Application

UPDATE (Dec.2013): The sample application is currently outdated and was unpublished from CODEPLEX. For the records, it can be downloaded from here: http://sdrv.ms/18bjaba

We elaborated a sample application as a needed companion for this Architecture guidance, so anyone can check every pattern implementation in a working and end to end example. This sample app is published as OPEN SOURCE CODE at the following CODEPLEX site:

http://microsoftnlayerapp.codeplex.com/

 

Related technologies

The guidance implements typical DDD patterns (Domain Entities, Repositories, Aggregates, Unit of Work, Value Object, Domain & Application Services, etc.) and IoC/DI techniques, using the following technologies:

  • Visual Studio 2010 y .NET 4.0
  • Entity Framework 4.0
  • UNITY 2.0
  • WCF
  • Silverlight 4.0
  • WPF 4.0
  • ASP.NET MVC
  • PEX&MOLES
  • Windows Server AppFabric Hosting & Cache (Optional)
  • Windows Azure (Optional)
  • SQL Server
  • SQL Azure (Optional)

 

Feedback

The following are a few comments and feedback gathered from our CODEPLEX site:

(5*)
Brilliant. The best fully developed example available. The documentation will become my architecture bible
by
TimCromarty on May 14 at 12:16 AM

 

(5*)
This is by far the best DDD guide and sample project around.
by
Cyberdude3 on Apr 11 at 3:25 PM

 

(5*)
The best online project about DDD…
by
alen_ekt18 on Apr 2 at 12:41 AM

 

(5*)
Oh my god Really The English book that goes with this release is so awesome. It’s the best technical document with guidelines that I read by FAR Looking forward to see it being finished! Keep up this excellent work please Can’t use enough superlatives Best Regards, Tom
by
buckley on Mar 30 at 11:34 AM

 

(5*)
I just started reading the English version of the documentation. It is awesome. The authors injected much practical knowledge and insights into the abstract topics of application architecture. If you have read Evans and Fowler, the documentation will help you really put all the theoretical ideas together in more tangible ways than I have seen any literature to date. Great work.
by
liberty2k on Mar 10 at 9:06 PM

 

(5*)
Very sophisticated and well thought out. Will be using this to compare to our architecture which is very similar using DDD, Repository Pattern, Linq, Unity and Entity Framework. Can’t wait to get the full English translation.
by
ben555 on Feb 25 at 12:28 AM

 

(5*)
Creo que este proyecto ¡es una joya! Ya lo estoy aplicando en soluciones a problemas reales y me ha dado preciosas y buenas sorpresas de buen funcionamiento. Me parece que es admirable el trabajo desarrollado para los repositorios genéricos con LINQ, especificaciones y filtros. Gracias nuevamente a César y al equipo todo.
by asereware on Feb 5 at 7:57 AM

 

(5*)
Most impressive .Net project ever seen. Keep up the (awesome) good work!
by
NicoJuicy on Feb 2 at 1:24 AM

 

You can check more feedback and ratings, at our CODEPLEX site:

http://microsoftnlayerapp.codeplex.com/discussions/229559

http://microsoftnlayerapp.codeplex.com/releases/view/56660#ReviewsAnchor

 

Future steps

This guidance is a living Project so it will continue evolving the Guide and Sample App. Specifically we are already working on the following new features:

–       EF 4.1 evolution (POCO Code-First Entities)

–       Claims-based Security implementation on the sample application (The Guide already covers it)

–       New Client technologies (Windows Phone 7, HTML5, etc.)

 

We hope this work might be useful for many organizations and we encourage you to provide feed-back and new ideas using our discussions-forum at CODEPLEX.

César de la Torre Llorente
Architect, DPE
Microsofthttp://blogs.msdn.com/cesardelatorre/http://msdn.microsoft.com/es-es/architecture/en/ 

Comments (20)

  1. Manuel says:

    ya no esta disponible el codigo en onedrive, ¿existe en algun otro lado?

    1. @Manuel – Creo que arregle ese problema del link hace meses. He visto ahora tu comentario, sorry.

  2. ricardo says:

    Hola Cesar, podrias subir nuevamente en OneDrive las guias. Saludos y gracais

    1. @Ricardo – Esta ya disponible, creo que lo arregle hace meses. Siento ver este comentario tuyo tan tarde.

  3. Nicholas says:

    hi Cesar de la Torre,

    how to migrate your wcf service into web api 2

    thanks

  4. Nicholas says:

    @Cesar de la Torre

      Is it possible using asp.net mvc as a presentation layer with the distributed services layer without changing it? as i see there are two services running as service host with codebehind. If it is possible can you show me how to do it? thanks.

  5. Mojtaba says:

    Thank you guys It is an awesome practical book for both .net architecture and DDD  

  6. Cesar de la Torre [MSFT] says:

    @Carlos Lo tienes justo en la primera linea de este blog post, en el enlace. Tambien las ultimas versions de los capitulos. 🙂

  7. Carlos Freire says:

    Hola, alguien sabe de donde se puede descargar la aplicación de ejemplo ya que en el repositorio microsoftnlayerapp.codeplex.com ya no está disponible.

    Saludos.

  8. Carlos Freire says:

    Hola, la aplicación de ejemplo en la dirección  microsoftnlayerapp.codeplex.com ya no esta disponible, alguien sabe de donde se puede descargar una copia, Gracias.

  9. Cesar de la Torre [MSFT] says:

    @ Jesus. Hola, Esa aplicacion ejemplo realmente la parte importante es la del servidor y patrones DDD.

    Si quieres ver ejemplos de apps clientes con nuevas tecnologias, mira los blog posts que tengo sobre MyShuttle. Aqui: blogs.msdn.com/…/myshuttle-biz-demo-apps-from-connect-visual-studio-and-azure-event.aspx

    Desde ahi hay diferentes blog posts dependiendo de las tecnologias y apps que quieras ver, Web, Mobile Native, Mobile Hybris, Azure, etc.

  10. Jesus says:

    Hola Cesar,

    Hicieron un excelente trabajo con esta guía.

    Descargué la aplicación de ejemplo pero solo encontré el cliente para Silverlight. Existe el demo con todos los otros clientes de presentación (wpf y asp mvc) ?

  11. Jorge Curiel says:

    Desde México muchos saludos tio! Aunque no lo creas tu trabajo y el de tus compañeros han sido el punto de partida para que desarrollemos mejores aplicaciones 🙂

    Gracias

  12. Cesar de la Torre [MSFT] says:

    @Roy

    Me gustaria poder hacerlo, pero actualmente trabajo en Microsoft Corp., Redmond, Seattle, en Visual Studio y .NET teams, y no puedo darle prioridad a material en castellano.

    Y tenemos tanto trabajo aqui en Corp, que no puedo dedicarle tiempo a esto ni siquiera en los fines de semana… De verdad… 🙂

    Mandame un email a cesardl @ Microsoft.com y si te puedo mandar un eBook de mas alto nivel que traducimos a castellano. Este eBook, pero en castellano, en estado borrador temporal:

    http://www.microsoft.com/…/nettechnologyguidance

    La ultima parte tiene una vision global de Domain-Driven Design, actualizada.

  13. Roy Sillerico says:

    Estaba mirando la nueva versión de tu libro, soy malo para el ingles, yo y muchos latinoamericanos o personas de la habla española te agradeceríamos si lo pudieras volver a publicar en español, como tu primera edición

  14. Your first sentence is right. There's no other way to do it using EF 4.0. You always need to have an EDM first.

    Regarding Code-First in EF 4,1, we don't need any longer an EDM. We just go ahead and write our own POCO entities, and they are isolated from the database. Then, you can have entity partition, table partition, entity inheritance, etc. It is not mandatory to have a single table per entity.

    In V2.0, we're using AutoMapper for DTO-Adapters, to convert from DTOs to POCO Code-First Entities and viceversa, but this is dealing with DTOs provided to the Presentation Layer in orde rto decouple it from out Domain Entity Model.

    Using POCO classes and also using abstractions & Ioc/DI for all your UNIT OF WORK and REPOSITORIES,  you could change your persistence technology (EF, Hibernate, or any other by any other technology), no problem.

    I'd be glad if you want to be one of our reviewers for V2.0. Please, send me an e-mail to 'cesardl at microsoft.com' and we'll contact you around late June 2011, ok?

    Cesar.

  15. Hi Cesar,

    As you say , you place your Domain Entity T4 templates in the Domain-Model layer. But doing that means that the template needs an edmx to work (you need to have an edm) before to work with your Domain!

    Good news for for the suport of the code first approach. Ok with code first you concentrate in the model but doing that your entitity in your domain will be mapped in one corresponding table in the internal edmx generated. But if I want completly isolate my entity from my database how to do that? In some case we have entity in our domain coresponding to more than one table in the DB. We use in general tools like automapper to help in the mapping.

    I will be very happy in the future if we can have this degree of separaration in the mapping and if I can change my persistance layer and indroduce micro orm like 'massive, petapoco, dapper…' to do my persistence without having to think with EF in mind. Doing that we concentrate first in the model and the persistence layer could be selected later in the process.

    I will be happy to review the V2 of DDD N Layered architecture.

  16. I partially agree, but not totally:

    • First, using EF 4.0, the only possible way is to create a Model-First (or Database First), and that EDM model has to be placed on the Persistence-Infrastructure Layer. But even doing that, since the very begining, I can place the Domain Entity T4 templates in the Domain-Model Layer and focus on the Domain without focusing on the persistence.
    • Second, because we now have EF 4.1 Code-First, we are working on our DDD Architecture Guidance V2.0 where we are using this approach. I agree it is more DDD oriented (that's the reason we are going for CODE-FIRST). 😉

    So, yeah, I partially agree, but using EF 4.0 there was no other way than creating your EDM first. Now, using EF 4.1 CODE-FIRST is a purer DDD approach. Also we're now using POCO-CODE-FIRST Entities plus DTOs instead of using STEs. There's more code and work (initially less prodcutive), but again, it is a purer DDD approach, and in the long tem, for large apps, it is a better architectural approach as we decouple Domain entities from Presentation Layer data.

    In a few weeks we'll have our first drafts and beta of V2.0. If you want to be an early reviewer, ping me at 'cesardl at microsoft.com' and I will add you to our reviewers list, ok?

    Thanks for your feedback! 🙂

  17. Domain Driven Design means to me Domain Driven First. This means you first design the domain model before trying to imagine the persistence. It's true that your design is persisent ignorent but when you try to develop you go first on the persisent model and generate with T4 the STE that you use in your domain model. That means that we don't follow the approch domain model first. For exemple if I would to use a different persistence stack (a diffent ORM or use directly ADO.NET because i like SQL) I can't.

    If I would to apply your guidance on a system with a predifined database with constaints to modify to transform the model compatible with EF what can I do?

  18. rido says:

    Congratulations, another big step forward

Skip to main content