什么是 N-Tier?
N 层应用程序是分布在分布式网络中的三个或更多个单独计算机之间的程序.
最常见的 n 层形式是 3 层应用程序, 它分为三类.
用户计算机中的用户界面编程
更集中的计算机中的业务逻辑, 和
管理数据库的计算机中的必需数据.
此体系结构模型为软件开发人员提供了最大灵活性的可重用应用程序 / 系统.
在 N 层中,"N" 指的是正在使用的层数或层数, 如 - 2 层, 3 层或 4 层等 . 它也被称为 "多层 架构".
n 层架构是经过行业验证的软件架构模型. 它通过提供可伸缩性, 安全性, 容错性, 可重用性和可维护性的解决方案, 适合支持企业级客户端 - 服务器应用程序. 它可以帮助开发人员创建灵活且可重用的应用程序.
参考资料
python 测试开发项目实战 - 目录
python 工具书籍下载 - 持续更新
python 3.7 极速入门教程 - 目录
讨论 qq 群 630011153 144081101
- private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
- {
- // Object of the Property layer
- clsStudent objproperty=new clsStudent();
- // Object of the business layer
- clsStudentInfo objbs=new clsStudentInfo();
- // Object of the dataset in which we receive the data sent by the business layer
- DataSet ds=new DataSet();
- // here we are placing the value in the property using the object of the
- //property layer
- objproperty.id=int.Parse(DataGridl.SelectedItem.Cells[1].Text.ToString());
- // In this following code we are calling a function from the business layer and
- // passing the object of the property layer which will carry the ID till the database.
- ds=objbs.GetAllStudentBsIDWise(objproperty);
- // What ever the data has been returned by the above function into the dataset
- //is being populate through the presentation laye.
- txtId.Text=ds.Tables[0].Rows[0][0].ToString();
- txtFname.Text=ds.Tables[0].Rows[0][1].ToString();
- txtAddress.Text=ds.Tables[0].Rows[0][2].ToString();
- txtemail.Text=ds.Tables[0].Rows[0][3].ToString();
- // this is the function of the business layer which accepts the data from the
- //application layer and passes it to the data layer.
- public class clsStudentInfo
- {
- public DataSet GetAllStudentBsIDWise(clsStudent obj)
- {
- DataSet ds=new DataSet();
- ds=objdt.getdata_dtIDWise(obj);// Calling of Data layer function
- return ds;
- }
- }
- // this is the datalayer function which is receiving the data from the business
- //layer and performing the required operation into the database
- public class clsStudentData // Data layer class
- {
- // object of property layer class
- public DataSet getdata_dtIDUise(clsStudent obj)
- {
- DataSet ds;
- string sql;
- sql="select * from student where Studentld=" +obj.id+ "order by Studentld;
- ds=new DataSet();
- //this is the datalayer function which accepts the sql query and performs the
- //corresponding operation
- ds=objdt.ExecuteSql(sql);
- return ds;
- }
- }
来源: http://www.jianshu.com/p/0bceddf2477a