如何在asp.net中创建n层应用程序 [英] how to create n-tier application in asp.net

查看:78
本文介绍了如何在asp.net中创建n层应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请为此提供编码帮助.

推荐答案

要了解n层,请在此处阅读3层并了解其工作方式:
创建一个类库-BusinessLogic(第二层)
创建一个类库-DataAccess(第3层)

现在,从您的UI(第1层)中,使用对象模型并传递给BusinessLogic项目类.此类是业务逻辑类.在此处根据您的需要进行更改.
现在,将更改后的数据从业务逻辑类传递到dataAccess项目类.在此类中,使用ADO.NET并将所需的值传递给存储过程.

为了获取数据,数据将从DA传输到BL层,然后再从BL传输到UI层.
看看这些,用示例进行解释:
C#中的三层体系结构 [ 3-层架构示例 [使用C#的ASP.NET中的3层体系结构 [
To understand about n-tier, read about 3 tier here and see how it works:
Create a class library - BusinessLogic (2nd layer)
Create a class library - DataAccess (3rd layer)

Now, from your UI (1st layer), use the object model and pass on to BusinessLogic project class. This class is a Business logic class. Do the changes as per your need here.
Now, pass on the changed data from business logic class to dataAccess project class. In this class, use ADO.NET and pass on the needed values to Stored Procedure.

For getting back data, it will be transferred from DA to BL and then BL to UI layer.
Have a look at these, explaination with samples:
3-tier architecture in C#[^]
3-Tier Architecture Examples[^]
3-Tier Architecture in ASP.NET with C#[^]

Now you can put as many layers in between UI & DB layer to increase it from 3-tier to n-tier as per your need.


这里有两个使用n层体系结构开发的应用程序

YaBlogEngine-用ASP.NET/编写的微型博客引擎C# [ ^ ]

YaMessaging-一种类似于电子邮件的简单电子邮件应用程序 [ ^ ]

第一个甚至将解释n层体系结构及其设计和开发方式
Here are two application developed using n-tier architecture

YaBlogEngine - A Tiny Blog Engine written in ASP.NET/C#[^]

YaMessaging - A simple e-mail like messaging application[^]

The first one will even explain about the n-tier architecture and how it is designed and developed that way


这篇关于如何在asp.net中创建n层应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆