《What is 3-tier.ppt》由会员分享,可在线阅读,更多相关《What is 3-tier.ppt(30页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、3-tier ApplicationTeam leader:RexTeam members:Vast AnWhat is 3-tier application the presentation layer(UI)the business logic layer(BLL)the data access layer(DAL)The composition of the 3-tier The composition of the 3-tier application:application:the presentation layerConcept:popular talk is to show t
2、o the user interface that the user is in a system when he saw proceeds.Function:the WEB way,also said into WINFORM way,WEB way can also be expressed as:aspx,if the logical layer is quite powerful and perfect,Whether how to define and change the presentation layer,logic layer can improve the delivery
3、 of services.the business logic layerConcept:the operation of specific issues,it can be said that the operation of the data layer,the data business logic processing.Function:The main operation for specific problems,but also to understand the operation of the paired data layer,the data business logic
4、 processing that data layer building blocks,that logic layer is the building blocks of these structures.the data access layerConcept:the layer made affairs directly manipulate the database for data add,delete,modify,search.Function:store data in the form of raw data(database or text file)operation l
5、ayer,rather than the original data,that is,the operation of the data,rather than the database,specific business logic layer or presentation layer provides data services.SUMMARY The so-called 3-tier application,client database between a middle layer,also known as the component layer.Each layer can on
6、ly change a small amount of code,you can put the different physical server,so the structure is flexible and better performance.In addition,each floor what other layers not see,and therefore change,update a layer no longer need to recompile or change the entire layer.The following are some rules that
7、 3-tier application must to follow:Most importantly,the UI layer can only be as a shell Most importantly,the UI layer can only be as a shell and should not contain any process of BizLogic.and should not contain any process of BizLogic.The design should be starting from the BLL,rather The design shou
8、ld be starting from the BLL,rather than UI.BLL layer in the API should achieve all than UI.BLL layer in the API should achieve all BizLogic by the way of object-oriented.BizLogic by the way of object-oriented.Regardless of the data layer is a simple SqlHelper Regardless of the data layer is a simple
9、 SqlHelper or the Classes with Mapping.It should be or the Classes with Mapping.It should be unconcerned to the system in certain level of unconcerned to the system in certain level of abstraction.abstraction.Whether using Whether using COM+COM+(Enterprise Service),or(Enterprise Service),or Remoting
10、,or remote objects technology such as Remoting,or remote objects technology such as WebService,no matter the deployment time was WebService,no matter the deployment time was really deployed to a different server,at least in the really deployed to a different server,at least in the time of design you
11、 are to do such time of design you are to do such considerations.further,you should also consider considerations.further,you should also consider multiple servers through load balancing for cluster.multiple servers through load balancing for cluster.So consider a project should be used with three la
12、yer design,you have to think about is really need?If you must use it,then you must follow the former rules.the application of 3-tier application in our studiesWith escalated,it is convenient to use to construct the B/S three layer structure of the application,the following to teacher business inform
13、ation management system parts of the project example to show how to use 2.0 and SQL Server 2005 database to construct a three layers structure of the application.1.Create database Open the SQL Server 2005,to create a database TeacherDb,establish shown below structure of the two table PersonInfo and
14、JobInfo.Two table to PersonIDNumber as association columns,storage and a id number.2.Create data access layer In the start creating data access layer(DAL)before,we first need to create a website,configured database links.The first step:create a Web project,configuration database connection Open the
15、Visual Studio 2005(hereinafter referred to as VS2005)integrated development environment,first create a c#of WebSite,and named it WebSite,set the position(Location)list of options for the File System(File System),and then choose this a place this WebSite,and then select the folder for programming lan
16、guage use c#.Visual Studio will generate a new web site,and create a Default.Aspx called the web pages,and a App_Data folder.The second step:create data access layer,configuration database connection The next create data access layer,and add a strong type to recover DataSet.In the solution manager i
17、n project nodes,choose according to the right mouse add new item,in the template column to choose the single data set,named it DataSet1.XSD.Then there will be TableAdpater configuration guide window,choose the database server,set up various parameters,and according to clew gradually completed.Need t
18、o pay attention to:1.Specify the connection string,and choose to database connection string saved to the web.Config file.2.Order type choice use the SQL statement,through the advanced options choice generate Insert,Update and Delete statement,through the query builder generation to load data Select
19、statement.And as a method named.This application design use traditional Client/Server architecture,Layers can be developed in the same time and different languages can be used by different programmers to develop the application.Because all levels of development will not affect the other levels,this
20、is a convenient model for further development software.Programmers have a preference for 3-tier application,why?About single tier,double tier and three tier structure If you have the code dealing with presentation logic,business logic and data access logic into a single module then you are having a
21、single tier structure.If you divide the code that deals with the communication with physical database to separate component it is called double tier structure.If you divide further the presentation logic and business logic into separate components then you can have 3 tier structure.advantage1.The de
22、velopers can only pay attention to the whole structure of one layer;2.Can easily use new implementation to replace the original level of the implementation;3.Can reduce the dependencies between layer and layer;4.Conducive to standardization;5.Each layer of the logic for reuse.disadvantage Reduce the
23、 performance of the system:This is self-evident.If does not use the hierarchical structure,many business can directly obtain corresponding to visit the database,data,but are now must through the middle to complete.The benefits of 3-tier structure The key 3-tier benefit is improved scalability since
24、the application servers can be deployed on many machines.Also,the database no longer requires a connection from every client-it only requires connections from a smaller number of application servers.In addition,TP monitors or ORB can be used to balance loads and dynamically manage the number of appl
25、ication server available.The Comparison of MVC and 3-tier Application MVC(Model View Controller)is a kind of design pattern,we can use it to create the distinction between objects in the domain objects and UI said layer.What is MVC?Similarities 1.Are used for software architecture design.2.Both of t
26、hem have a presentation layer,but their different place lies in the other two layers.Differences1.In three layer architecture did not define the concept of the Controller.2.MVC doesnt put the business logic layer into two layer,it is the main distinction in using 3-tier application or MVC to build program.3.Thetypical Model layerin3-tier application is composed of entity class,and MVC,is by the business logic and access of data.THANK YOU!