Click here to Skip to main content
Click here to Skip to main content

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

, 27 Sep 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
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 storySmile | :) . 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 weeksSmile | :) .

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)

Share

About the Author

venugopalm
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

 
GeneralMy vote of 5 PinmemberRakesh690612-Mar-14 4:48 
GeneralMy vote of 5 Pinmembernikhil _singh11-Oct-12 1:19 
GeneralMy vote of 4 Pinmemberecunha4-Oct-12 2:10 
GeneralMy vote of 5 PinmvpKanasz Robert28-Sep-12 8:10 
Generalthanks for sharing - have 5 PinmemberPranay Rana17-Jan-11 2:40 
GeneralThird part posted. Pinmembervenugopalm15-Nov-10 1:13 
GeneralMy vote of 4 Pinmemberkarthikeyan.a1-Nov-10 7:48 
GeneralRe: My vote of 4 Pinmembervenugopalm8-Nov-10 3:34 
Thanks dude.
MVVM devotee Smile | :)

GeneralMy Vote of 5 PinmemberMember 381239618-Oct-10 10:00 
GeneralMy vote of 5 PinmemberMember 381239618-Oct-10 9:55 
GeneralRe: My vote of 5 Pinmembervenugopalm8-Nov-10 3:34 
GeneralMy vote of 1 Pinmembert_rex10-Oct-10 13:41 
GeneralRe: My vote of 1 Pinmembervenugopalm8-Nov-10 3:33 
GeneralMy vote of 4 Pinmembermaxtyrann29-Sep-10 4:35 
GeneralRe: My vote of 4 Pinmembervenugopalm8-Nov-10 3:35 
GeneralI'd like to see more on when to use this architecture Pinmembershteff25-Sep-10 21:34 
GeneralRe: I'd like to see more on when to use this architecture Pinmembervenugopalm27-Sep-10 3:39 
GeneralMy vote of 1 PinmemberSimon Dufour24-Sep-10 6:41 
GeneralRe: My vote of 1 Pinmembervenugopalm27-Sep-10 2:07 
NewsSecond part almost ready [modified] Pinmembervenugopalm23-Sep-10 6:39 
NewsRe: Second part almost ready Pinmembervenugopalm27-Sep-10 2:09 
Generalgood start, but I want more Pinmember60webgun22-Sep-10 15:32 
GeneralRe: good start, but I want more Pinmembervenugopalm22-Sep-10 20:22 
GeneralMy vote of 3 PinmemberNinethSense22-Sep-10 5:27 
GeneralRe: My vote of 3 Pinmembervenugopalm22-Sep-10 20:19 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411019.1 | Last Updated 27 Sep 2010
Article Copyright 2010 by venugopalm
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid