Mar 09 2009

Book review: Microsoft .NET: Architecting Applications for the Enterprise

Category: Uncategorizedbengtbe @ 08:17

Authors: Dino Esposito & Andrea Saltarello
Publisher: Microsoft Press


I first heard of this book when Jeremy Miller (the maker of StructureMap) wrote that he was impressed by it. So I decided to purchase it, and now I have finished reading it. Before I give my conclusion, lets start with a summary of the different chapters in the book.

1. Architects and Architecture Today

Discusses the design of architecture and the role of the architect. Also gives a brief overview of different models for software development: Waterfall, Agile and Microsoft Solutions Framework.

2. UML Essentials

Covers the most important UML diagram types – Use Case, Class, and Sequence Diagrams. Describes three main modes of using UML – Sketch mode (emerging design), Blueprint mode (up front design), and Programming mode (Model-Driven Architecture).  The authors prefer to use UML as a sketching tool to communicate ideas, which seems like a sensible choice.

3. Design Principles and Patterns

Looks at goals of design principles and design – High Cohesion, Low Couping, and Separation of Concerns. Also looks at more advanced Object-Oriented Design principles – Open/Closed Principle, Liskov’s Substitution Principle, and Dependency Inversion Principle. Aspect-Oriented programming (AOP) is also explained by looking at Microsft’s Policy Injection Application Block.

This concludes the first part of the book, the rest of it looks at how to design a system by going through each application layer.

4. The Business Layer

Discusses different ways to organize business logic. The business logic can either be organized around user actions or around the domain. When organizing the logic around user actions, either the Transaction Script (TS) or Table Module (TM) pattern can be applied. These are best suited for low complexity in the domain. When organizing around the domain a Domain Model (DM) pattern can be applied. This pattern can deal with high complexity in the domain.

5. The Service Layer

The service layer is placed between the presentation layer and the business layer, it can also be thought as the upper part of the business layer. It basically is a list of actions that can be triggered from the user interface. One of its main responsibilities is dealing with roles and security. The chapter also discusses the following patterns that are related to the service layer – the Remote Facade Pattern, the Data Transfer Object Pattern, and the Adapter Pattern. It has a good discussion on when to use DTO’s and when it can be considered overkill. It gives a brief introduction to Service-Oriented Arhcitecture (SOA). Finally, it discusses the Serivice Layer in regards to AJAX.

6. The Data Access Layer

Starts off with a discussion of the responsibilities of a Data Access Layer (DAL), and how it “communicates” with the other layers. Then it describes patterns and principles to use when manually designing your own DAL – Service Locator, Inversion of Control, Transactions, Data Context, Query by Criteria, Unit of Work, Concurrency, and Lazy Loading. Afterwards it looks how an Object/Relational Mapper (OR/M) tool can be used to power the DAL, using NHibernate as an example. The authors consider NHibernate to be the de facto standard for O/RM tools, while Entity Framework (EF) is not yet mature enough. At the end of the chapter there is a great section called “To SP or Not to SP”, where the authors dispel many myths about Stored Procedures. At last, a book from Microsoft where SP are not described as the core of a DAL :)

7. The Presentation Layer

Presents the responsibilities of the presentation layer, and splits it into two segments – the user interface and presentation logic. Gives a great overview of the evolution of presentation patterns – Autonomous Views (AV), Model-View-Controller (MVC), Model2, Model-View-Presenter (MVP), and Presentation Model (PM). Also shows examples from different presentation frameworks – Web Client Software Factory, ASP.NET MVC Framework, MVC# Framework, and Windows Presentation Foundation.


I truly recommend this book to both intermediate and senior .NET developers. It has a great coverage of many current thoughts and aspects of system architecture. Many of the patterns in the book are from Patterns of Enterprise Application Architecture by Martin Fowler, and the book sets them into perspective in an enterprise .NET application. I like that a Microsoft Press book describes and even recommends Open Source tools, e.g. the book recommends NHibernate over Entity Framework. Dino’s writing is very consise and clear, and the book is full of code-examples, not just theory. However, since the scope of the book is very big, it cannot go into too much detail. So don’t expect to learn all you need about e.g. Domain Driven Design or NHibernate by reading this book.

Overall I give this book 4.5 of 5 stars :)

kick it on Shout it

Tags: ,