Solution Architecture For The Masses. Step 1: Structure Your Solution

 Alik Levin    This is a first post in series “Solution Architecture for the Masses”. I decided to take p&p’s Application Architecture Guide (2nd Edition) for a test drive.

This post follows the guidelines described in the resources outlined in the Quick Resource Box on the right or at least the way I understood it.

Quick Resource Box

The rest of the post is an explanation of how I partitioned my Visual Studio solution according to the guidelines.

Layers Mapped to Visual Studio Solution

From the How To - Structure Your Application:

Layers represent a logical grouping of components into different areas of concern. For example, business logic represents an area of concern that should be grouped into a layer. This is probably the most important decisions you will make during the initial design phase of your application. …

From Application Architecture Guide - Chapter 9 - Layers and Tiers:

image

Red square that I have added in the figure above should map to the solution in Visual Studio. Right click on the solution node in Solution Explorer –>Add –> New Solution Folder to create the structure similar to below:

image

I have added numbers to the names so that VS sorts it top down like in the conceptual diagram. It helps navigating the solution.

User Interface [UI] Folder

The UI Solution folder holds Web App and Silverlight applications – notice there might be several Silverlight applications that will be used for different Use Cases [UC] for the same web app.

image

Service Interface [SI] Folder

Service Interface folder holds WCF projects that will be consumed by remote clients or by our own Silverlight applications – notice it has svc file, interfaces, and interfaces implementations (servicecontract/operationcontract). It does not contain datacontract which is factored out into separate project (later on this one):

image

Entities Folder

Entities folder holds Entities project. It is my data model that flows through layers. I have factored it into separate project so I will be able to reference it from different projects as entities usually flow through all layers and sometimes tiers.

image

Business Services Folder

Business services folder holds Business Services objects that will be activated by WCF and ASPX on the server side. It is a bunch of Use Case oriented classes with static methods that should access DAL when processing entities.

image

Data Access Folder

Data Access folder holds project for Data Access Layer [DAL] that’s responsible for accessing the entities in the data sources and downstream services. For each entity I have a set of CRUD related operations. It also contains data access helper classes:

image

Crosscutting Folder

Crosscutting folder contains non-functional aspects such monitoring, exception handling, security, etc:

image

I am ready to expand each folder and add the implementation to it. Business Entities and Business Services are next.