How to Develop a Multi Tier Web Application in Visual Studio .NET 2008 - Part 1

A .NET multi-tier application (also known as an n-tier application) is an application that is composed of 3 or more functional layers. Typically, such an application contains one layer for the presentation interface, another for the business process functionality, and one more for the data handling logic. Today I will show you how to create a C# multi-tier web application in Visual Studio 2008. Due to the many steps involved I have broken up this article into multiple parts. In this section (Part 1). I will show you how to create the folder structure.

INSTRUCTIONS:

1.First we will create a Visual Studio Solution. The Solution will be the top level container for the tiers in our multi-tier application. Open Visual Studio and under the File menu select “New Project”. The “New Project” window will open.

2.In the "New Project" window open the “Other Project Types” node and select “Visual Studio Solutions”. Click on the “Blank Solution” template. Select “.NET Framework 3.5” from the dropdown list. Name the solution “NTierSolution”. Browse to the folder where you would like the solution stored. Click OK.


3.Now that the Solution has been created we can start adding projects to it. Each project will represent one tier in our multi-tier application. We will begin by adding the Presentation tier to our application. In the Solution Explorer, right click the newly created solution and select “Add” and “New Project”.


4. In the “New Project” window open the “Visual C Sharp” node and select the “ASP.NET Web Application” template. Select “.NET Framework 3.5” from the dropdown list. Name the project “NTierWeb”. In the “Location” box, leave the location pointing to the Solution folder so that the new project gets created under it. Click OK.


5.The Solution Explorer should now show the Web Project you just added. The solution is no longer visible in the Solution Explorer.




6.Open Windows Explorer and navigate to the folder that contains your solution. You will see that the solution is still there and now it contains the folder with your Web Project.

7. So far, we have created a Visual Studio Solution and added a Web Project to the solution. The Web Project we just added is our Presentation layer. We will now add a Business Process layer to our solution. Go back to Visual Studio and close the Default.aspx page if it’s open. Then in the File menu select “New Project”. In the “New Project” window open the “Visual C#” node and select the “Class Library” template. Select “.NET Framework 3.5” from the dropdown list. Name the solution “BusinessProcessLayer”. In the “Location” box, leave the location pointing to the Solution folder so that the new project gets created under it. Finally, in the solution dropdown list make sure you select “Add to Solution”. Click OK.

8.Notice that in Solution Explorer our solution is visible again with the projects underneath. This is because we now have more than one project.


9.We will now add the Data Handling tier to our multi-tier application. Go back to Visual Studio and close the Class1.cs page if it’s open. Then in Solution Explorer, right click the solution and select "Add Project".


10.In the "New Project" window open the “Visual C#” node and select the “Class Library” template. Select “.NET Framework 3.5” from the dropdown list. Name the solution “DataLayer”. In the Location box, leave the location pointing to the Solution folder so that the new project gets created under it. Click OK.

11.And that’s it. You have created the structure for a multi-tier application. See the image in this step. Your solution and projects in Visual Studio should now look like the image.




12.In Windows Explorer, navigate to the folder that contains your solution. See the image in this step. Your folder structure should look like the image.











13.The next step would be to add some functionality to your multi-tier web application. Please read my article “How to Develop a Multi-tier Web Application in Visual Studio.NET – Part 2”.

Hiç yorum yok:

2018 SGK İşten Çıkış Kodları (696 sayılı KHK kapsamında eklenenler dahil)

2018 SGK İşten Çıkış Kodları 1- Deneme süreli iş sözleşmesinin işverence feshi 2- Deneme süreli iş sözleşmesinin işçi tarafından feshi ...