Our brand-new ‘DDD N-Layered .NET 4.0 Architecture Guide’ book and Sample-App in CODEPLEX


Platform Architecture Teamimage

[UPDATED – Dec. 2013]

The sample application is currently outdated and because of that, I unpublished it from CODEPLEX. For the records, it can be downloaded from here: http://sdrv.ms/18bjaba 

The last Guide chapters can still be downloaded from herehttp://sdrv.ms/18bjLty

 

Original PDF eBooks:

(English): http://download.microsoft.com/download/9/F/A/9FA4753A-FC8A-40DE-9EFA-CCAFB4C835FC/DDD_NLayered_NET40_Architecture_Guide_Microsoft_16_05_13.zip  

(Spanish): http://download.microsoft.com/download/D/3/6/D3619F8C-A47F-43A3-9C9F-839F93595FE0/guia_arquitectura_n-capas_orientada_al_dominio_con_net_4_0-microsoft_architecture.zip   

The DDD approaches and patterns explained in the guide are still valid, but the technologies used in the sample app are outdated as they are from 2011.

For an updated technologies positioning and global approaches recommendations, where DDD is also positioned from a high level point of view, read this guide:

.NET Technology Guide for Business Applications (2013): http://www.microsoft.com/net/nettechnologyguidance  

also available as free eBook from MS PRESS: 

http://blogs.msdn.com/b/microsoft_press/archive/2013/11/13/free-ebook-net-technology-guide-for-business-applications.aspx

[UPDATED – May 2011]

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/

 

It is also available from AMAZON: http://www.amazon.com/N-Layered-Domain-Oriented-Architecture-Guide-NET/dp/8493903612/ref=sr_1_1?ie=UTF8&qid=1386007359&sr=8-1&keywords=domain+oriented+nlayer

[UPDATED – Feb. 13th 2011]

We are currently in the process of translating our “Domain Oriented NLayered Architecture” book to English (Spanish Guide/Book was released during early December 2010), but for the sake of many people who were asking for the English version, we decided to publish the draft chapters with a ‘pre-final’ state, at our CODEPLEX site.
Here you can download only the English ‘Pre-Final’ drafts:
http://microsoftnlayerapp.codeplex.com/releases/view/56660#DownloadId=207782
Please send your feedback/errata (typos, technical or any grammatical mistakes) to: cesardl at microsoft dot com

—–

We (Microsoft DPE-Spain ) just published in MSDN-Spain & CODEPLEX our new DDD N-Layered .NET 4.0 Architecture Application guide book (e-book & printed book as a gift in our events) and Sample-App (published in CODEPLEX), based on .NET 4.0 wave, Entity Framework 4.0, Unity, WCF, PEX (Moles & Stubs) for Unit Testing and mocking, etc.

All is still a draft documentation & BETA app-example, take that into account… It will be growing… :-)

Take also into account that our Guide-Book is in Spanish (we could translate it to English after summer), but our Sample-App is all in English.

We’ve been working on it during several months and now we just published it. But I wanna highlight that the related documentation is still a DRAFT version and the App example is still an ALPHA/BETA version, as well.

DDD Architecture Style Diagram and Guide-Book cover and Table of Content

 

e-Book (Free) – Draft version (March 2010)
image

Overview

This project implements a simple business scenario, but it is quite end to end complete regarding DDD N-Layered Architecture style , .NET 4.0 technologies and Archetypes (we’ll be growing to many different clients, starting from WPF 4.0 , Silverlight 4.0 , and going to ASP.NET MVC , OBA , Windows Phone during the next future).
It is very ‘Domain Oriented’ , therefore, it illustrates typical DDD patterns , like Entity, POCO/IPOCO Entities, Value-Object, Aggregates, Repository, Unit of Work, Specification (most of those patterns originally defined by Eric Evans and Martin Fowler ), using ADO.NET Entity Framework 4.0 , Unity, WCF, and PEX (Stubs and Moles) for Unit Testing and mocking.

Architecture Guide material downloads:

Download – DDD N-Layer Architecture & .NET 4.0 wave implementation guide e-book – (SPANISH)

http://msdn.microsoft.com/es-es/architecture/default.aspx
Download APPLICATION EXAMPLE in CODEPLEX (ENGLISH)

http://microsoftnlayerapp.codeplex.com/

 

Targets/Objectives

It is really important to note that DDD and therefore this App-Example and our .NET DDD N-Layer Architecture Guide is specifically made for Complex Apps where you have a lot of business rules. It is NOT for small and data-centric apps. If you are going to create this other kind of app, I recommend not to adopt this approach but instead going for a RAD approach line WCF-RIA-Services, which is much simpler (but it is a more coupled approach not suitable for long life apps).

Sample-App in Codeplex (WPF version)

 

Current required Base Software (See exact versions in our Codeplex site)

– Microsoft Visual Studio 2010 – RC
– Microsoft SQL Server 2008 Express (or higher)
– Microsoft Unity 1.2 (We’ll migrate to Unity 2.0 in the near future)
– Microsoft PEX 2010
– Microsoft WPF Toolkit 

 

Next versions plan!!

For next versions & App’s flavors, we’re actually working on several new stuff:

– Adding new clients like: Silverlight 4.0, ASP.NET MVC, OBA and Windows Phone 7!!

– Adding AppFabric-Cache (“Velocity”)

– Adding AppFabric Hosting support for WCF Services

– Adding Claims Orientation Security based on WIF (Windows Identity Foundation)

Unity 2.0 for loosely-coupled Application Server components

– Some components/building blocks coming from Enterprise-Library 5.0

– more ideas you can have!! :-)

 

Team

This project is locally supported by several Software Architects and Developers (coming from Microsoft DPE Spain, MVPs, partners and Microsoft Services). Special thanks to my collaborators:

Unai Zorrilla (Plain-Concepts), Javier Calvarro, Miguel Angel Ramos (Microsoft), Rido Minguez (Microsoft), Pierre Millet (Microsoft), Israel García Mesa (Microsoft), Roberto Gonzalez (Renacimiento) and Juan Cid (Avanade), and some other Architects and developers I will add…
We’ll be happy to hearing from you and getting your feed-back to improve and evolve this Architectural example!!.

We’ll improve it during next months, and we’d love to get your feed-back and new ideas to consider!!

Thanks a lot for your feed-back!! (You can use CODEPLEX DISCUSSIONS within our site) :-)

Cesar

Comments (52)

  1. rido says:

    Congratulations !! this is awesome

  2. roysbrn says:

    this is great!  any plans for an english version of the ebook?

  3. Oscar Gras says:

    El libro está muy bien, ¡y en castellano!. Quizás un punto de mejora es que cuando habláis de la capa de dominio, solo tratáis su interacción (interfaces) con la capa de persistencia y no dais consignas para llegar a la capa de presentación o a la de servicios distribuidos.

    De hecho cuando se ve la capa de servicios distribuidos se habla de la interface con el cliente y no de la interface con la aplicación o dominio.

    ¡Enhorabuena!, ¡buen trabajo!.

  4. fkode87 says:

    Hello,

    the content of the guide and presentation slides seems awesome but the thing is that they are not in English.

    So please could we get a translated version for the guide and slides?

  5. fkode87 says:

    Hello,

    the content of the guide and presentation slides seems awesome but the thing is that they are not in English.

    So please could we get a translated version for the guide and slides?

    Thanks. Keep up the great work.

  6. Joey Samonte says:

    I hope you can translate the ebook to English soon. It'll be helpful to a lot of developers who can't afford trainings and books.

  7. Eugen says:

    If it is possible translate this one msdn.microsoft.com/…/default.aspx in english.

    That would be great. Thanks.

  8. Dan says:

    It would be great if we could have this in english. Would help a lot more folks.

  9. tzvi says:

    Hello , is  there a book in English?

  10. Siamak says:

    Please Please give an english version of the book,it woulb be great ,thanks

  11. Sia says:

    Could you please give an english version of the ebook ,Thanks

  12. Alex says:

    Brilliant work! Please add me to the list for the English guidance book! :)

  13. Tuandc says:

    Dear All,

    It is very very good sophisticated frame. Translate the guidebook into English and where I can buy it please.

    All best

  14. Milind says:

    Hello ,

    Can we have the english version of the book? If yes, please share the location. If no, is it possible to tell when it can be tentatively available?

    Thanks

    Miline

  15. sa says:

    Is there an English translation of the ebook?

  16. robertok says:

    again, english is welcome …

  17. Julien says:

    Very awesome project guys new technologies with great pattern! ans structured design! But can you please publish a english book for everyone!

  18. Scott says:

    Please – English translation of the E-Book and continued releases of this great project!

  19. Chris says:

    very good solution but agian from me too, english is welcome

  20. Bipin says:

    Excellent!

    Waiting for english version

  21. dyowee says:

    Please translate soon…

  22. ChrisS says:

    If you can't get to the translation to english, at least break up the PDF into smaller chunks so we can upload to Google Translate.  Right now the single file is too big.  

  23. ChrisS says:

    En español:

    Si no puede llegar a la traducción al Inglés, por lo menos romper el PDF en pedazos más pequeños para que podamos subir a Google Translate. En este momento el único archivo es demasiado grande.

  24. Firoz Ansari says:

    Great work!

    Is there any plan to translate this ebook and slide to English?

  25. Firoz Ansari says:

    Great work!

    Is there any plan to translate this ebook and slide to English?

  26. nemegeermarc says:

    When will there be an english translation of this ?

  27. Cesar says:

    FYI, we're starting to translate the book/guide to English. I hope we'll have it published before ending 2011.

  28. Rick says:

    Ending 2011 – this will be old news.

  29. Kamran says:

    It would be very late.Any converter can be mentioned so that we could try to read it from that on our own?

  30. Milind says:

    2011 end ! Ohh..that will be too late and by the time stuff might have moved on!

    -M T

  31. Cesar de la Torre says:

    Sorry, I meant before ending 2010, but it will be just a few more weeks.

    We're actually in the middle of its translation. I hope we'll have it ready during mid January 2011.

  32. Cesar de la Torre says:

    btw, regarding English translation, you might be interested in this:

    microsoftnlayerapp.codeplex.com/…/View.aspx

    Read my last post with my proposal.

  33. cesardl says:

    [UPDATED – Feb. 13th 2011]

    We are currently in the process of translating our “Domain Oriented NLayered Architecture” book to English but for the sake of many people who were asking for the English version, we decided to publish the draft chapters with a 'pre-final' state here.

    Here you can download only the English 'Pre-Final' drafts:

    microsoftnlayerapp.codeplex.com/…/56660

    Please send your feedback/errata (typos, technical or any grammatical mistakes) to: cesardl at microsoft dot com

    Cesar.

  34. Ben says:

    No progress on the English version of this? This is exactly what I am hoping to implement on my current project.

  35. cesardl says:

    Hi guys, the final translation is taking a lot more time because we've been facing trouble with the quality provided by the translation firm/company. But we are publishing current DRAFT Chapters in our site at CODEPLEX. You can download it from here until we have the final version:

    microsoftnlayerapp.codeplex.com/documentation

  36. cesardl says:

    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:

    msdn.microsoft.com/…/en

  37. Mathias says:

    Links to microsoftnlayerapp.codeplex.com are not working.

  38. Abbas Amiri says:

    The link says the "This project is not yet published".

  39. cesardl says:

    @Mathias @ Abbas I updated this post:

    The sample application is currently outdated and because of that, I unpublished it from CODEPLEX. For the records, it can be downloaded from here: http://sdrv.ms/18bjaba

    The last Guide chapters can still be downloaded from here: http://sdrv.ms/18bjLty

    The DDD approaches and patterns explained in the guide are still valid, but the technologies used in the sample app are outdated as they are from 2011.

    For an updated global approach where DDD is also positioned, read this guide: http://www.microsoft.com/…/nettechnologyguidance  

  40. Sachin Kumar Patel says:

    This is Guideline is great, it help me to improve my architectural and DDD understanding.

    Thank you.

  41. Jose Luis R. says:

    el sitio microsoftnlayerapp.codeplex.com, aparece como nos disponible, tendras el link para descargar el ejemplo de la aplicación, de favor

  42. Cesar de la Torre [MSFT] says:

    @Jose Luis Tienes el link justo al principio de este post: The sample application is currently outdated and because of that, I unpublished it from CODEPLEX. For the records, it can be downloaded from here: http://sdrv.ms/18bjaba

  43. Jose says:

    Hi sir Cesar,

    if im using ASP.NET MVC as my Presentation Layer then using your Distributed Services layer which is strongly implemented with WCF Services, is it possible?

  44. Cesar de la Torre [MSFT] says:

    @Jose. Sure, you can consume WCF Services from an ASP.NET MVC presentation layer. The only thing is that you might want to take into account that if you WCF you are putting a remote access technology in place son having some latency between MVC and the WCF services that might no be necessary. In some cases it is the right approach, though, like when implementing Microservices architectural approaches, although I wouldn't use WCF but ASP.NET WebAPI (Http/REST services) which is a much better and modern technology than WCF. This example was using WCF as that was the mainstream in 2010 and 2011. But, nowadays, I'd use WebAPI, heading ASP.NET 5.0 based on .NET core 5, for the future, which is also cross-platform and it is where Microsoft is investing quite a lot.

  45. Jose says:

    Hi sir Cesar,

    Ok, If that's the case how can I migrate WCF services file into ASP.NET WebAPI?

  46. Jose says:

    Hi sir Cesar,

    Please, can you show me an example of how to migrate one of your method in your WCF service (ERPModuleService.svc.cs) into ASP.NET WebAPI?

  47. Cesar de la Torre [MSFT] says:

    @Jose – It is pretty simple to migrate from WCF to Web API, although usually it'll be a manual process. There are many articles and blog posts about it. Here you have a good one from Mark Seemann

    blog.ploeh.dk/…/MigratingfromWCFWebAPItoASP.NETWebAPI

    You will also need to change the client code consuming the sevices. I recommend to use HttpClient for .NET code and from JavaScript, use jQuery and Angular.js, etc.

    Here you have an example for Web API and HttpClient:

    Calling a Web API From a .NET Client in ASP.NET Web API 2 (C#)

    http://www.asp.net/…/calling-a-web-api-from-a-net-client

    (Note that if using ASP.NET 5 WebAPI, still in Beta6, the Web API Services will be slightly different)

  48. Jose says:

    Hi sir Cesar,

    Im trying using CustomerAppService in your Application Layer in my ASP.NET WebAPI controller and here's my code:

    public class CustomersController : ApiController

       {

           #region Members

           readonly ICustomerAppService _customerAppService;

           #endregion

           #region Constructor

           public CustomersController(ICustomerAppService customerAppService)

           {

               if (customerAppService == null)

                   throw new ArgumentNullException("customerAppService");

               _customerAppService = customerAppService;

           }

           #endregion

           #region CustomerService members

           [Route("api/{customers}/{id}")]

           public CustomerDTO FindCustomer(Guid customerId)

           {

               return _customerAppService.FindCustomer(customerId);

           }

           #endregion

       }

    And here's the error message when i'm trying to execute the GET using Fiddler:

     JSON

            ExceptionMessage=An error occurred when trying to create a controller of type 'CustomersController'. Make sure that the controller has a parameterless public constructor.

    ExceptionType=System.InvalidOperationException

    InnerException

      ExceptionMessage=Type 'DistributedServices.MainBoundedContext.Controllers.CustomersController' does not have a default constructor

    ExceptionType=System.ArgumentException

    Message=An error has occurred.

    StackTrace=   at System.Linq.Expressions.Expression.New(Type type)

      at System.Web.Http.Internal.TypeActivator.Create[TBase](Type instanceType)

      at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.GetInstanceOrActivator(HttpRequestMessage request, Type controllerType, Func`1& activator)

      at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)

    Please, can you help me how to solve this problem?

    Take note that CustomerAppService has no default parameterless constructor.

  49. Jose says:

    Hi sir Cesar,

    If my presentation layer is asp.net mvc 5 and my distributed layer is asp.net web api 2, is there any way that we can connect the asp.net mvc 5 to asp.net web api?

  50. Jose says:

    Hi sir Cesar

    Thanks for your help.

  51. DT says:

    Hi Mr. Cesar, could you please give the requirements (necessary technologies) to run the NLayerApp on Visual Studio 2010 ?

    I already download the code but can't make it work @_@

    Also, my teacher want my to recreate this app on Visual Studio 2013 with .NET 4.5.

    It is possible ? And if it does, do i need to change the requirements (necessary technologies) ?

  52. Cesar de la Torre - DevTools says:

    @ DT So.., the patterns in the NLayerApp are still valide nowadays, but the technologies used are a bit outdated, like I wouldn't use Silverlight for the presentation Layer in 2015/2016 but I'd go for either HTML/JS and an SPA app for the Web, or native apps in .NET + Xamarin for mobile apps targeting iOS, Android and Windows. In the server side, EF has evolved as well. I'd recommend to take a look to these other samples (simpler and not DDD) then taking the pattern's code from Nlayer DDD sample and implementing a more decoupled architecture in the Services and Domain Layer.

    It would be better if you use the latest Microsoft technologies with Visual Studio 2015 Community which is free for anyone that is not an Enterprise and provides the same than VS 2015 Professional. Take a look to these sample apps:

    MyShuttle sample apps:

    blogs.msdn.com/…/myshuttle-biz-demo-apps-from-connect-visual-studio-and-azure-event.aspx

    HealthClinic sample apps:

    blogs.msdn.com/…/connect-demos-2015-healthclinic-biz.aspx

    github.com/…/HealthClinic.biz

    Then, apply DDD patterns in the server/services so they are more decoupled which is better for long term and Core-Domain enterprise applications.

    Visual Studio 2015 Community Download:

    go.microsoft.com/fwlink

    Finally, for Microservices architectures and technologies (Microservices is an evolution from DDD), take a look to my latest MSDN article:

    blogs.msdn.com/…/azure-service-fabric-and-the-microservices-architecture-my-new-msdn-magazine-article.aspx