SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
http://creativecommons.org/licenses/by-nc-nd/2.5/




                                                       idiomatic Domain Driven Design

                                                    Andrea Saltarello
                                                    C.T.O. @ managed/designs
                                                    http://blogs.ugidotnet.org/pape
                                                    http://twitter.com/andysal74
Grazie!

      managed/designs
Leggere attentamente le
     avvertenze…

(Quasi) Tutte le demo saranno basate su NSK, un
framework di e-commerce sviluppato in bottega e
scaricabile qui con licenza open source.

N.B.: NSK è come il galeone di Dylan Dog: non è
mai terminato, quindi non tutti i check-in sono
come la caramella Polo (cioè «riusciti col buco»
)
Andrea Saltarello! Chi era
        costui?
1. C.T.O. di Managed Designs, alla ricerca della
   «sostenibilità dello sviluppo software»
  – Il cliente «deve» essere soddisfatto e pagare
  – Il fornitore «deve» avere un margine ragionevole
  – Il team «deve» essere soddisfatto del proprio lavoro
2. Fondatore e presidente di UGIdotNET: ho
   bisogno di condividere esperienze a causa del bullet
   precedente 
3. (Co)Autore di .NET: Architecting Applications
   for the Enterprise di Microsoft Press
  – Il #NAAE è il mio giornale di bordo, nel quale (nel 2008)
    ho cercato di «sintetizzare» i punti 1 e 2 
Once upon a time…
1. Acquistai il [P of EAA] a febbraio 2003, lo lessi
   e… «estiqaatsi?»
2. Acquistai il «Blue Book» appena uscito (2004),
   lo lessi e… «estiqaatsi?»
3. In poche parole: come «passo» dal libro al
   mondo reale?
Innanzitutto…
•   Ubiquitous Language
•   Ubiquitous Language
•   Ubiquitous Language
•   Ubiquitous Language
•   Ubiquitous Language
•   Ubiquitous Language
•   Ubiquitous Language
Ubiquitous Language


DEMO
One More Thing… (cit.)


    Non è «Lascia o Raddoppia»
Blue Book: Architettura (1/2)
Blue Book: Architettura (2/2)
• è una layered architecture
• i layer Presentation e Infrastructure
  compaiono «per sport» nel diagramma
• i layer Application e Domain costituiscono
  quella che tipicamente chiamiamo «business
  logic»
  – Domain: logica invariante rispetto ai casi d’uso
  – Application: logica specifica ai casi d’uso
Domain vs. Application:
Amazon web site


DEMO
Domain layer: Key Concepts
 • Il Domain Layer contiene la domain logic ed è composto
   da
    – Model: Entità (identità e stato) e Valori (solo stato)
    – Servizi
 • Il Model è «both data and behaviour» (cit.)
 • La persistenza del Model è gestita da Repository
 • Le istanze delle entità di dominio sono costruite da
   Factory
 • Entità e Valori a runtime formano dei grafi di oggetti. I
   grafi dotati di “dignità propria” sono chiamati
   Aggregate e il sistema (es: i Repository) si “impegna”
   a gestirli correttamente ed atomicamente
Domain Model


DEMO
Da 0 ad Aggregate
• E' un insieme di elementi raggruppati in un’unità
  logica, quindi un grafo di oggetti
• Ha come radice l'entità principale dell'aggregato
• La radice è l’unico elemento che può essere
  referenziato fuori dai confini dell’aggregato
• Non è possibile agire direttamente sugli elementi
  senza passare dalla radice dell'aggregato
• L’aggregate ha la responsabilità di implementare la
  propria logica
Aggregate


DEMO
One More Thing… (cit.)

E’ DDD, non «Il Signore degli Anelli», quindi:
     Assert.IsFalse(OneModelToRuleThemAll);
Repository pattern: in teoria
A system with a complex domain model often benefits from a
layer, such as the one provided by Data Mapper (165), that
isolates domain objects from details of the database access
code. In such systems it can be worthwhile to build another
layer of abstraction over the mapping layer where query
construction code is concentrated.This becomes more
important when there are a large number of domain classes
or heavy querying. In these cases particularly, adding this layer
helps minimize duplicate query logic.
…
You can also find a good write-up of this pattern in Domain
Driven Design.
Repository pattern: in pratica
  Mediates between the domain and data mapping layers
  using a collection-like interface for accessing domain
  objects.

  Ricapitolando:
  • Interfaccia “collection like”
  • Gestisce la persistenza degli Aggregate
  • LINQ! (siamo dei buongustai )
Repository


DEMO
Application Layer: in teoria
Application Layer: defines the jobs the software is
supposed to do and directs the expressive domain
objects to work out problems. The tasks this layer is
responsible for are meaningful to the business or
necessary for interaction with the application layers
of other systems. This layer is kept thin. It does
not contain business rules or knowledge, but only
coordinates tasks and delegates work to
collaborations of domain objects in the next layer
down. It does not have state reflecting the business
situation, but it can have state that reflects the
progress of a task for the user or the program.
Application Layer: in pratica

E’ un catalogo di servizi in grado di effettuare il
mesh della logica presente nel domain layer
esponendola alla applicazione (es: presentation
layer) in una forma ad… Alta digeribilità.
DDD vs Real World

Avere a disposizione un domain layer «smart» è bello,
ma costoso:
   – Materializzazione degli oggetti
   – Mesh della business logic

Tipicamente, si finisce per passare la vita a «fare
DTO»:
   – Application Layer <-> Presentation Layer
   – («ma anche» cit.) Domain Layer <-> Application Layer
Layered Expression Trees (LET idiom)

Facciamo un gioco: invece di definire un «botto» di
DTO, facciamo che layer e servizi si scambino degli
IQueryable<YourFavouriteDomainEntity>, facendo
«emergere» la query e specificando la proiezione solo
all’ultimo momento?



L’espressione «Capra e cavoli» vi dice niente? 

P.S.: Si, «botto» è un ordine di grandezza del S.I. Kilo-
>Mega->Giga->Tera->Peta->Botto
Layered Expression Trees


DEMO
LET idiom feat. Ubiquitous Language

 LET aumenta la pervasività dell’Ubiquitous Language nel
 codice:
   recommendedProducts = (from p in CatalogServices.GetAvailableProductsOnSale()
                             orderby p.UnitsInStock descending
                             select new ProductDescriptor
                               {
                                  Id = p.Id,
                                  Name = p.Name,
                                  UnitPrice = p.UnitPrice,
                                  UnitsInStock = p.UnitsInStock,
                               }).Take(3);



 Questa query è «quasi» scritta nel linguaggio del Domain
 Expert
And now for something
 completely different
Command Query Responsibility
           Segregation

Command and Query Responsibility Segregation (CQRS)
originated with Bertrand Meyer’s Command and Query
Separation Principle. Wikipedia defines the principle as:

It states that every method should either be a command that performs
an action, or a query that returns data to the caller, but not both.

Command and Query Responsibility Segregation uses the same
definition of Commands and Queries that Meyer used and
maintains the viewpoint that they should be pure. The
fundamental difference is that in CQRS objects are split into two
objects, one containing the Commands one containing the
Queries.
               [Fonte: http://cqrsinfo.com/documents/cqrs-introduction/ ]
Command Query Responsibility
      Segregation




     Query                 Command
CQRS


DEMO
Books & Publications
[DDD] Domain Driven Design, Eric Evans ,
  Addison-Wesley
[P of EAA] Pattern of Enterprise
  Application Architecture, Martin Fowler,
  Addison-Wesley
[NAAE] Microsoft .NET: Architecting
  Applications for the Enterprise, Andrea
  Saltarello & Dino Esposito, Microsoft Press
[NSK] NSK, http://nsk.codeplex.com

Weitere ähnliche Inhalte

Andere mochten auch

Never Mind the Bollocks: here's the Domain Driven Design
Never Mind the Bollocks: here's the Domain Driven DesignNever Mind the Bollocks: here's the Domain Driven Design
Never Mind the Bollocks: here's the Domain Driven DesignAndrea Saltarello
 
BDD in DDD
BDD in DDDBDD in DDD
BDD in DDDoehsani
 
Architecting an ASP.NET MVC Solution
Architecting an ASP.NET MVC SolutionArchitecting an ASP.NET MVC Solution
Architecting an ASP.NET MVC SolutionAndrea Saltarello
 
Epic.NET: Processes, patterns and architectures
Epic.NET: Processes, patterns and architecturesEpic.NET: Processes, patterns and architectures
Epic.NET: Processes, patterns and architecturesGiacomo Tesio
 
Implementing Event Sourcing in .NET
Implementing Event Sourcing in .NETImplementing Event Sourcing in .NET
Implementing Event Sourcing in .NETAndrea Saltarello
 
Unleash Your Domain With Greg Young @ DDD-Day
Unleash Your Domain With Greg Young @ DDD-DayUnleash Your Domain With Greg Young @ DDD-Day
Unleash Your Domain With Greg Young @ DDD-DayDotNetMarche
 

Andere mochten auch (11)

Never Mind the Bollocks: here's the Domain Driven Design
Never Mind the Bollocks: here's the Domain Driven DesignNever Mind the Bollocks: here's the Domain Driven Design
Never Mind the Bollocks: here's the Domain Driven Design
 
ASP.NET Core essentials
ASP.NET Core essentialsASP.NET Core essentials
ASP.NET Core essentials
 
BDD in DDD
BDD in DDDBDD in DDD
BDD in DDD
 
Architecting an ASP.NET MVC Solution
Architecting an ASP.NET MVC SolutionArchitecting an ASP.NET MVC Solution
Architecting an ASP.NET MVC Solution
 
Epic.NET: Processes, patterns and architectures
Epic.NET: Processes, patterns and architecturesEpic.NET: Processes, patterns and architectures
Epic.NET: Processes, patterns and architectures
 
Implementing Event Sourcing in .NET
Implementing Event Sourcing in .NETImplementing Event Sourcing in .NET
Implementing Event Sourcing in .NET
 
Event based modeling - eng
Event based modeling - engEvent based modeling - eng
Event based modeling - eng
 
DDD e Validazione
DDD e ValidazioneDDD e Validazione
DDD e Validazione
 
Unleash Your Domain With Greg Young @ DDD-Day
Unleash Your Domain With Greg Young @ DDD-DayUnleash Your Domain With Greg Young @ DDD-Day
Unleash Your Domain With Greg Young @ DDD-Day
 
Model storming
Model stormingModel storming
Model storming
 
Event storming recipes
Event storming recipesEvent storming recipes
Event storming recipes
 

Ähnlich wie How I did it (in .NET): idiomatic Domain Driven Design

Build a LINQ-enabled Repository
Build a LINQ-enabled RepositoryBuild a LINQ-enabled Repository
Build a LINQ-enabled RepositoryAndrea Saltarello
 
Domain Driven Design e CQRS
Domain Driven Design e CQRSDomain Driven Design e CQRS
Domain Driven Design e CQRSManuel Scapolan
 
Code Contracts and Generics: implementing a LINQ-enabled Repository
Code Contracts and Generics: implementing a LINQ-enabled RepositoryCode Contracts and Generics: implementing a LINQ-enabled Repository
Code Contracts and Generics: implementing a LINQ-enabled RepositoryAndrea Saltarello
 
Approccio Pratico al Domain Driven Design
Approccio Pratico al Domain Driven DesignApproccio Pratico al Domain Driven Design
Approccio Pratico al Domain Driven DesignLuca Milan
 
Idiomatic Domain Driven Design
Idiomatic Domain Driven DesignIdiomatic Domain Driven Design
Idiomatic Domain Driven DesignAndrea Saltarello
 
Loosely Coupled Complexity - Unleash the power of your domain model
Loosely Coupled Complexity - Unleash the power of your domain modelLoosely Coupled Complexity - Unleash the power of your domain model
Loosely Coupled Complexity - Unleash the power of your domain modelFrancesca1980
 
Design Patterns - enterprise patterns (part I)
Design Patterns - enterprise patterns (part I)Design Patterns - enterprise patterns (part I)
Design Patterns - enterprise patterns (part I)Fabio Armani
 
DNM19 Sessione2 Orchard Temi e Layout (Ita)
DNM19 Sessione2 Orchard Temi e Layout (Ita)DNM19 Sessione2 Orchard Temi e Layout (Ita)
DNM19 Sessione2 Orchard Temi e Layout (Ita)Alessandro Giorgetti
 
Entity Framework 4.0 vs NHibernate
Entity Framework 4.0 vs NHibernateEntity Framework 4.0 vs NHibernate
Entity Framework 4.0 vs NHibernateManuel Scapolan
 
MongoDB Scala Roma SpringFramework Meeting2009
MongoDB Scala Roma SpringFramework Meeting2009MongoDB Scala Roma SpringFramework Meeting2009
MongoDB Scala Roma SpringFramework Meeting2009Massimiliano Dessì
 
MongoDb and Scala SpringFramework Meeting
MongoDb and Scala SpringFramework MeetingMongoDb and Scala SpringFramework Meeting
MongoDb and Scala SpringFramework Meetingguest67beeb9
 
Repository pattern slides v1.1
Repository pattern slides v1.1Repository pattern slides v1.1
Repository pattern slides v1.1Christian Nastasi
 
Design Patterns - Enterprise Patterns (part 2)
Design Patterns - Enterprise Patterns (part 2)Design Patterns - Enterprise Patterns (part 2)
Design Patterns - Enterprise Patterns (part 2)Fabio Armani
 
ios 8 - parte 1 - intro - ita
ios 8 - parte 1 - intro - itaios 8 - parte 1 - intro - ita
ios 8 - parte 1 - intro - itaDario Rusignuolo
 
Un'architettura di riferimento per applicazioni enterprise
Un'architettura di riferimento per applicazioni enterpriseUn'architettura di riferimento per applicazioni enterprise
Un'architettura di riferimento per applicazioni enterpriseAlberto Lagna
 
Note di Data Warehouse e Business Intelligence - Tecniche di Naming Conventio...
Note di Data Warehouse e Business Intelligence - Tecniche di Naming Conventio...Note di Data Warehouse e Business Intelligence - Tecniche di Naming Conventio...
Note di Data Warehouse e Business Intelligence - Tecniche di Naming Conventio...Massimo Cenci
 
Meetup ASP.NET Core Angular
Meetup ASP.NET Core AngularMeetup ASP.NET Core Angular
Meetup ASP.NET Core Angulardotnetcode
 

Ähnlich wie How I did it (in .NET): idiomatic Domain Driven Design (20)

Build a LINQ-enabled Repository
Build a LINQ-enabled RepositoryBuild a LINQ-enabled Repository
Build a LINQ-enabled Repository
 
Domain Driven Design e CQRS
Domain Driven Design e CQRSDomain Driven Design e CQRS
Domain Driven Design e CQRS
 
Code Contracts and Generics: implementing a LINQ-enabled Repository
Code Contracts and Generics: implementing a LINQ-enabled RepositoryCode Contracts and Generics: implementing a LINQ-enabled Repository
Code Contracts and Generics: implementing a LINQ-enabled Repository
 
Approccio Pratico al Domain Driven Design
Approccio Pratico al Domain Driven DesignApproccio Pratico al Domain Driven Design
Approccio Pratico al Domain Driven Design
 
Idiomatic Domain Driven Design
Idiomatic Domain Driven DesignIdiomatic Domain Driven Design
Idiomatic Domain Driven Design
 
Repository pattern
Repository patternRepository pattern
Repository pattern
 
Loosely Coupled Complexity - Unleash the power of your domain model
Loosely Coupled Complexity - Unleash the power of your domain modelLoosely Coupled Complexity - Unleash the power of your domain model
Loosely Coupled Complexity - Unleash the power of your domain model
 
ORM - Introduzione
ORM - IntroduzioneORM - Introduzione
ORM - Introduzione
 
Design Patterns - enterprise patterns (part I)
Design Patterns - enterprise patterns (part I)Design Patterns - enterprise patterns (part I)
Design Patterns - enterprise patterns (part I)
 
DNM19 Sessione2 Orchard Temi e Layout (Ita)
DNM19 Sessione2 Orchard Temi e Layout (Ita)DNM19 Sessione2 Orchard Temi e Layout (Ita)
DNM19 Sessione2 Orchard Temi e Layout (Ita)
 
Entity Framework 4.0 vs NHibernate
Entity Framework 4.0 vs NHibernateEntity Framework 4.0 vs NHibernate
Entity Framework 4.0 vs NHibernate
 
Kotlin hexagonal-architecture
Kotlin hexagonal-architectureKotlin hexagonal-architecture
Kotlin hexagonal-architecture
 
MongoDB Scala Roma SpringFramework Meeting2009
MongoDB Scala Roma SpringFramework Meeting2009MongoDB Scala Roma SpringFramework Meeting2009
MongoDB Scala Roma SpringFramework Meeting2009
 
MongoDb and Scala SpringFramework Meeting
MongoDb and Scala SpringFramework MeetingMongoDb and Scala SpringFramework Meeting
MongoDb and Scala SpringFramework Meeting
 
Repository pattern slides v1.1
Repository pattern slides v1.1Repository pattern slides v1.1
Repository pattern slides v1.1
 
Design Patterns - Enterprise Patterns (part 2)
Design Patterns - Enterprise Patterns (part 2)Design Patterns - Enterprise Patterns (part 2)
Design Patterns - Enterprise Patterns (part 2)
 
ios 8 - parte 1 - intro - ita
ios 8 - parte 1 - intro - itaios 8 - parte 1 - intro - ita
ios 8 - parte 1 - intro - ita
 
Un'architettura di riferimento per applicazioni enterprise
Un'architettura di riferimento per applicazioni enterpriseUn'architettura di riferimento per applicazioni enterprise
Un'architettura di riferimento per applicazioni enterprise
 
Note di Data Warehouse e Business Intelligence - Tecniche di Naming Conventio...
Note di Data Warehouse e Business Intelligence - Tecniche di Naming Conventio...Note di Data Warehouse e Business Intelligence - Tecniche di Naming Conventio...
Note di Data Warehouse e Business Intelligence - Tecniche di Naming Conventio...
 
Meetup ASP.NET Core Angular
Meetup ASP.NET Core AngularMeetup ASP.NET Core Angular
Meetup ASP.NET Core Angular
 

How I did it (in .NET): idiomatic Domain Driven Design

  • 1. http://creativecommons.org/licenses/by-nc-nd/2.5/ idiomatic Domain Driven Design Andrea Saltarello C.T.O. @ managed/designs http://blogs.ugidotnet.org/pape http://twitter.com/andysal74
  • 2. Grazie! managed/designs
  • 3. Leggere attentamente le avvertenze… (Quasi) Tutte le demo saranno basate su NSK, un framework di e-commerce sviluppato in bottega e scaricabile qui con licenza open source. N.B.: NSK è come il galeone di Dylan Dog: non è mai terminato, quindi non tutti i check-in sono come la caramella Polo (cioè «riusciti col buco» )
  • 4. Andrea Saltarello! Chi era costui? 1. C.T.O. di Managed Designs, alla ricerca della «sostenibilità dello sviluppo software» – Il cliente «deve» essere soddisfatto e pagare – Il fornitore «deve» avere un margine ragionevole – Il team «deve» essere soddisfatto del proprio lavoro 2. Fondatore e presidente di UGIdotNET: ho bisogno di condividere esperienze a causa del bullet precedente  3. (Co)Autore di .NET: Architecting Applications for the Enterprise di Microsoft Press – Il #NAAE è il mio giornale di bordo, nel quale (nel 2008) ho cercato di «sintetizzare» i punti 1 e 2 
  • 5. Once upon a time… 1. Acquistai il [P of EAA] a febbraio 2003, lo lessi e… «estiqaatsi?» 2. Acquistai il «Blue Book» appena uscito (2004), lo lessi e… «estiqaatsi?» 3. In poche parole: come «passo» dal libro al mondo reale?
  • 6. Innanzitutto… • Ubiquitous Language • Ubiquitous Language • Ubiquitous Language • Ubiquitous Language • Ubiquitous Language • Ubiquitous Language • Ubiquitous Language
  • 8. One More Thing… (cit.) Non è «Lascia o Raddoppia»
  • 10. Blue Book: Architettura (2/2) • è una layered architecture • i layer Presentation e Infrastructure compaiono «per sport» nel diagramma • i layer Application e Domain costituiscono quella che tipicamente chiamiamo «business logic» – Domain: logica invariante rispetto ai casi d’uso – Application: logica specifica ai casi d’uso
  • 12. Domain layer: Key Concepts • Il Domain Layer contiene la domain logic ed è composto da – Model: Entità (identità e stato) e Valori (solo stato) – Servizi • Il Model è «both data and behaviour» (cit.) • La persistenza del Model è gestita da Repository • Le istanze delle entità di dominio sono costruite da Factory • Entità e Valori a runtime formano dei grafi di oggetti. I grafi dotati di “dignità propria” sono chiamati Aggregate e il sistema (es: i Repository) si “impegna” a gestirli correttamente ed atomicamente
  • 14. Da 0 ad Aggregate • E' un insieme di elementi raggruppati in un’unità logica, quindi un grafo di oggetti • Ha come radice l'entità principale dell'aggregato • La radice è l’unico elemento che può essere referenziato fuori dai confini dell’aggregato • Non è possibile agire direttamente sugli elementi senza passare dalla radice dell'aggregato • L’aggregate ha la responsabilità di implementare la propria logica
  • 16. One More Thing… (cit.) E’ DDD, non «Il Signore degli Anelli», quindi: Assert.IsFalse(OneModelToRuleThemAll);
  • 17. Repository pattern: in teoria A system with a complex domain model often benefits from a layer, such as the one provided by Data Mapper (165), that isolates domain objects from details of the database access code. In such systems it can be worthwhile to build another layer of abstraction over the mapping layer where query construction code is concentrated.This becomes more important when there are a large number of domain classes or heavy querying. In these cases particularly, adding this layer helps minimize duplicate query logic. … You can also find a good write-up of this pattern in Domain Driven Design.
  • 18. Repository pattern: in pratica Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects. Ricapitolando: • Interfaccia “collection like” • Gestisce la persistenza degli Aggregate • LINQ! (siamo dei buongustai )
  • 20. Application Layer: in teoria Application Layer: defines the jobs the software is supposed to do and directs the expressive domain objects to work out problems. The tasks this layer is responsible for are meaningful to the business or necessary for interaction with the application layers of other systems. This layer is kept thin. It does not contain business rules or knowledge, but only coordinates tasks and delegates work to collaborations of domain objects in the next layer down. It does not have state reflecting the business situation, but it can have state that reflects the progress of a task for the user or the program.
  • 21. Application Layer: in pratica E’ un catalogo di servizi in grado di effettuare il mesh della logica presente nel domain layer esponendola alla applicazione (es: presentation layer) in una forma ad… Alta digeribilità.
  • 22. DDD vs Real World Avere a disposizione un domain layer «smart» è bello, ma costoso: – Materializzazione degli oggetti – Mesh della business logic Tipicamente, si finisce per passare la vita a «fare DTO»: – Application Layer <-> Presentation Layer – («ma anche» cit.) Domain Layer <-> Application Layer
  • 23. Layered Expression Trees (LET idiom) Facciamo un gioco: invece di definire un «botto» di DTO, facciamo che layer e servizi si scambino degli IQueryable<YourFavouriteDomainEntity>, facendo «emergere» la query e specificando la proiezione solo all’ultimo momento? L’espressione «Capra e cavoli» vi dice niente?  P.S.: Si, «botto» è un ordine di grandezza del S.I. Kilo- >Mega->Giga->Tera->Peta->Botto
  • 25. LET idiom feat. Ubiquitous Language LET aumenta la pervasività dell’Ubiquitous Language nel codice: recommendedProducts = (from p in CatalogServices.GetAvailableProductsOnSale() orderby p.UnitsInStock descending select new ProductDescriptor { Id = p.Id, Name = p.Name, UnitPrice = p.UnitPrice, UnitsInStock = p.UnitsInStock, }).Take(3); Questa query è «quasi» scritta nel linguaggio del Domain Expert
  • 26. And now for something completely different
  • 27. Command Query Responsibility Segregation Command and Query Responsibility Segregation (CQRS) originated with Bertrand Meyer’s Command and Query Separation Principle. Wikipedia defines the principle as: It states that every method should either be a command that performs an action, or a query that returns data to the caller, but not both. Command and Query Responsibility Segregation uses the same definition of Commands and Queries that Meyer used and maintains the viewpoint that they should be pure. The fundamental difference is that in CQRS objects are split into two objects, one containing the Commands one containing the Queries. [Fonte: http://cqrsinfo.com/documents/cqrs-introduction/ ]
  • 28. Command Query Responsibility Segregation Query Command
  • 30. Books & Publications [DDD] Domain Driven Design, Eric Evans , Addison-Wesley [P of EAA] Pattern of Enterprise Application Architecture, Martin Fowler, Addison-Wesley [NAAE] Microsoft .NET: Architecting Applications for the Enterprise, Andrea Saltarello & Dino Esposito, Microsoft Press [NSK] NSK, http://nsk.codeplex.com