Click here to Skip to main content
15,867,686 members
Articles / Web Development / IIS

Enterprise Application Architecture: Designing Applications and Services in .NET - Part I

Rate me:
Please Sign up or sign in to vote.
4.71/5 (46 votes)
27 Sep 2010CPOL6 min read 236.6K   190   45
A guided tour of the distributed enterprise application design in .NET

Introduction

This article is an attempt to show how to implement distributed application in .NET Framework from scratch. Indeed I can share my experience which I hope will be useful for architects (obviously beginners in architecture design) or a lead developer wants to become an architect to start with. The application will contain a simple web client CustomerOrderManagement System with our own distributed application platform.

The application will cover the following parts:

  • Part 1 (Distributed Application Layers with project details): Learn about what is layered design in distributed environment and how we are going to name it while implementing the actual app.
  • Part 2 (Database and Library Design): Learn about database design and implementing library which interacts with Edmx container.
  • Part 3 (Engine and Service Managers design): Learn how to implement the engine which has core business logic and implementing the actual WCF service with service contracts, and also how to test the service using test client.
  • Part 4 (Client implementation): Learn how to implement the actual client with MVVM pattern which invokes services.

I will try to post the remaining parts ASAP.

Prerequisites

In order to run WCF service, Database design and Silverlight application, you need the .NET Framework version 3.0, or greater. Windows Vista has the .NET Framework v3.0 installed by default, so you only need to install it if you have Windows XP SP2. To develop distributed enterprise applications, you should have Visual Studio 2008 or a later version of Visual Studio, SQL Server Management Studio Express 2005 and also the Windows SDK. Article source uses VS2010 and SQL Server Management Studio Express 2005.

Why Should I Read This Article?

You can ask this question when you read the title of the this article. If you are an architect or a lead developer who aspires to architect solutions, spend some time on this (sorry to take your valuable time). When you complete this article, you will feel that you can design any complex application very easily. I am pretty sure about this. However I am not going to talk about design principles in depth. If you want, you can learn it from Microsoft site which describes everything very clearly. In my view, describing the concepts theoretically again and again without practical implementation doesn’t make sense. So I will describe directly what, why and how to do that in real time. I always like action instead of reading action story:). Designing complex application is not an easy task. As everyone knows, many decisions need to be taken at the architecture, design, and implementation levels. These decisions will have an impact on the abilities of the application security, scalability, maintainability, and availability. This article will help you to design your application with clear separation between the layers such as Data Layer, Business Layer, Service Layer and Presentation Layer from scratch. Let’s start with action.

What Are These Layers and What Should They Provide?

Let's start by visiting each of these layers and discuss what these layers should provide and what they should not. Figure 1 shows the simplified logical component layers that this article uses to design the architecture. I am not going to include many components here again. Just see figure 1 and understand the purpose of this article right away.

AppLayer.png

(Figure 1 – Enterprise Application Layers)
  • Presentation Layer - Contains user related functionality for managing user interaction with the system, and generally consists of service calls for communicating with business logic through service layer.
  • Service Layer - Consists of service contracts and message types to communicate with the business logic to separate the business layer as an independent layer. Also this layer can be located on different tiers, or they may reside on the same tier.
  • Business Layer - This layer implements the core functionality of the system, and encapsulates the relevant business logic. It generally consists of components, some of which may expose service interfaces that other callers can use.
  • Data Access Layer – This layer communicate with database to retrieve and save the data in database using its own context. This data access layer exposes generic interfaces that the components in the business layer can consume.
  • Data Layer – This layer contains the actual business raw data. DBA can design and maintain this layer.

How Do We Implement and By Using What Technologies?

Let’s take figure 1 and add another figure along with that to describe how to implement customer order management enterprise application from scratch. Before I start discussing, I will consider some component from the layers as platform. Because this platform can be hosted anywhere and client can consume whatever they need through network. This is called distributed environment. Here we will consider our business layer, service layer and data access layer as a single platform. So those multiple client platforms (Mobile, Web, etc) can utilize our COMS(CustomerOrderManagement System). This is the major advantage of our COMS. See figure 2 and get an idea about how we are going to implement our COMS platform with technology details.

Note: Please note that COMS refers to the CustomerOrderManagement System throughout the article.

AppLayerWithProjectDetails.png - Click to enlarge image

(Figure 2 – Enterprise Application Layers With Project Details)
  • Service Libraries (Data Access Layer) - This interacts with entity framework through edmx entity container and also provides data to the service engines. We will talk more about this when we come to the library implementation.
  • Service Engines (Business Layer) – This contains core business logic implementation and it interacts with service library to get the actual database without contacting database directly. All the business validation should be implemented here for extensibility. We will talk more about this when we come to the engine implementation.
  • Service Managers (Service Layer) - This layer exposes all the COMS system functionality as WCF service which can be accessed by client from any platform. Manager never interacts with database or library directly. Because business layer contains all the validation which needs to be invoked before sending the response to the client. We will talk more about this when we come to the service manager’s implementation.
  • Client (Presentation layer) – The actual user interface which calls services. This can be any rich client, web client or mobile client or another service call. I am going to use Silverlight for implementing web client in this article. If it’s possible, I will try to post some mobile UI implementation also for testing our COMS platform as part of this article.

To be frank, I don’t know about Mobile app implementation, so I will learn and explain in one part how to make use of our COMS platform services in mobile platform. But you have to trust me and wait for a couple of weeks:).

History

  • Initial version of this article created on 09/20/2010
  • Published on 09/21/2010
  • Part-II link updated on 09/27/2010

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Logitech Engineering & Design (India) Pvt. Ltd.
India India
Venugopal works as a Senior Software Engineer in Logitech Engineering & Design (India) Pvt. Ltd. He hold a Masters in Computer Applications and has 4+ years experience in C#, XAML, Silverlight & WPF.

Venugopal firmly believes "technology is impermanent, change is not"!. While he has strong technical inclination towards MS technologies, he is deeply passionate about pursuing his career in Windows7-WPF and Silverlight Technology.

Venu engages in a wide gamut of temperamental hobbies ranging from making friends, traveling, helping his friends studies. To murmuring songs and watching movies in leisure time.

Comments and Discussions

 
PraiseThank You! Pin
Priyanka Kale14-Mar-18 20:01
Priyanka Kale14-Mar-18 20:01 
GeneralMy vote of 5 Pin
Rakesh690612-Mar-14 3:48
Rakesh690612-Mar-14 3:48 
GeneralMy vote of 5 Pin
Nikhil_S11-Oct-12 0:19
professionalNikhil_S11-Oct-12 0:19 
GeneralMy vote of 4 Pin
ecunha4-Oct-12 1:10
ecunha4-Oct-12 1:10 
GeneralMy vote of 5 Pin
Kanasz Robert28-Sep-12 7:10
professionalKanasz Robert28-Sep-12 7:10 
Generalthanks for sharing - have 5 Pin
Pranay Rana17-Jan-11 1:40
professionalPranay Rana17-Jan-11 1:40 
GeneralThird part posted. Pin
venugopalm15-Nov-10 0:13
venugopalm15-Nov-10 0:13 
GeneralMy vote of 4 Pin
ak_netchat1-Nov-10 6:48
ak_netchat1-Nov-10 6:48 
GeneralRe: My vote of 4 Pin
venugopalm8-Nov-10 2:34
venugopalm8-Nov-10 2:34 
GeneralMy Vote of 5 Pin
Member 381239618-Oct-10 9:00
Member 381239618-Oct-10 9:00 
GeneralMy vote of 5 Pin
Member 381239618-Oct-10 8:55
Member 381239618-Oct-10 8:55 
Very elegant, curiously waiting for Part 3.
GeneralRe: My vote of 5 Pin
venugopalm8-Nov-10 2:34
venugopalm8-Nov-10 2:34 
GeneralMy vote of 1 Pin
t_rex10-Oct-10 12:41
professionalt_rex10-Oct-10 12:41 
GeneralRe: My vote of 1 Pin
venugopalm8-Nov-10 2:33
venugopalm8-Nov-10 2:33 
GeneralMy vote of 4 Pin
maxtyrann29-Sep-10 3:35
maxtyrann29-Sep-10 3:35 
GeneralRe: My vote of 4 Pin
venugopalm8-Nov-10 2:35
venugopalm8-Nov-10 2:35 
GeneralI'd like to see more on when to use this architecture Pin
shteff25-Sep-10 20:34
shteff25-Sep-10 20:34 
GeneralRe: I'd like to see more on when to use this architecture Pin
venugopalm27-Sep-10 2:39
venugopalm27-Sep-10 2:39 
GeneralMy vote of 1 Pin
Simon Dufour24-Sep-10 5:41
Simon Dufour24-Sep-10 5:41 
GeneralRe: My vote of 1 Pin
venugopalm27-Sep-10 1:07
venugopalm27-Sep-10 1:07 
NewsSecond part almost ready [modified] Pin
venugopalm23-Sep-10 5:39
venugopalm23-Sep-10 5:39 
NewsRe: Second part almost ready Pin
venugopalm27-Sep-10 1:09
venugopalm27-Sep-10 1:09 
Generalgood start, but I want more Pin
60webgun22-Sep-10 14:32
60webgun22-Sep-10 14:32 
GeneralRe: good start, but I want more Pin
venugopalm22-Sep-10 19:22
venugopalm22-Sep-10 19:22 
GeneralMy vote of 3 Pin
Praveen Nair (NinethSense)22-Sep-10 4:27
Praveen Nair (NinethSense)22-Sep-10 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.