3-Tier Architecture
Main Points What is 3-Tier Architecture? Evolution to the 3-Tier Architecture Development What does 3-Tier Architecture offer you? Advantages and disadvantages using 3-Tier Architecture Example of how you can implement 3-Tier Architecture in .Net platform using C#.
What is 3-Tier Architecture? A three-way interaction in a client/server environment. The user interface is stored in the client. The bulk of the business aplication logic is stored in one or more servers. The data are stored in a database server.
What is 3-Tier Architecture
Evolution to the 3-Tier Architecture Single Tier Dual Tier Environments 3-Tier Architecture … N-Tier Architecture Tiers we are going to study…
Single Tier (I) Time of huge “Mainframe” All processing in a single computer. All resources attached to the same computer Access via dumb terminals
Single Tier (II) Advantages Simple Efficient Uncomplicated Disadvantages The cost of the central machine is very expensive
Dual Tier (I) The Personal Computer Necessity of providing personal software The client/server model was born!!!!
Dual Tier (III) Logical system components – most wich are on the client.
Dual Tier (II) Problems with this model: The connections are very expensive. One can only connects a limited number of users to a server before SQL server spends more time managing connections than processing request. Cost-ineffective. Many users only use their connection 2-3% of the time.
3-Tier Architecture (I) With the advent of Internet many people jumped to the conclusion that the days of the mainframe were back.  Client/Server obviously failed, personal computers had failed and Windows was on its way out. A host of “thin client” application where developed. Thus 3-tier applications were born.
3-Tier Architecture (II) This application runs the traditional client/server model but from a web server.
3-Tier Architecture (III) The client only displays the GUI and data, but has no part in producing results.
3-Tier Architecture (IV) Benefits: SCALABILITY:  The application servers can be deployed on many machines.  The database no longer requires a connection from every client (only from a smaller number of application servers). TP monitors or ORBs can be used to balance loads and dynamically manage the number of application server(s) available.
3-Tier Architecture (V) Benefits: BETTER RE-USE: If an estandard object is employed, the specific language of implementation of the middle tier can be made transparent. IMPROVE DATA INTEGRITY: The middle tier can ensure that only valid data is allowed to be updated in the database.
3-Tier Architecture (VI) Benefits: IMPROVED SECURITY: Since the client doesn’t have direct access to the database. Business Logic is generally more secure since it is placed on a more secure central server. REDUCED DISTRIBUTION: Changes to business logic only need to be updated on the application servers and do not have to be distribuited to all the clients.
3-Tier Architecture (VII) Benefits: IMPROVED AVAILABILITY: Mission-critical applications can make use of redundant application servers and redundant database servers, so it can recover from network or server failures. HIDDEN DATABASE STRUCTURE Since the actual structure of the database is hidden from the caller.
3-Tier Architecture (VIII) Drawbacks: INCREASED COMPLEXITY/EFFORT: In general is more difficult to build a 3-tier application compared a 2-tier application because: The points of communication are doubled. Many handy productivity enhacements provided by the client tools will be foregone or their benefit will be reduced. FEWER TOOLS: The existence of more tools available for a 2-tier model (e.g. most reporting tools).
3-Tier Architecture (IX) The complexity concerns in the 3-tier model can not be easily dismissed, but there are many situations in which it provides certain benefits.  Example: The bulk of data maintenance is done by a small number of users. A large number of users must be supported, but they only require a small subset of the total application logic Other application need to exchange some information/data with this application Some users need direct access to the data in order to use special tools (e.g. reporting tools).
3-Tier Architecture (X) Conclusions: Complex application rules easy to implement in application server. Business logic off-loaded from database server and  client, which improve performance Changes to business logic automatically enforce by server Application server is portable to other database server platforms by virtue of the application SW. Superior performance for medium to high volume environments
3-Tier application in ASP.Net Program organized into three major disjunctive tiers on layers: Application layer or Business layer Business layer  Property layer  Data layer
3-Tier application example Graphical User Interface
Presentation Layer
Property Layer (I)
Property Layer (II)
Business Layer
Data Layer
Presentation Layer Creating an object of the Property Layer
Presentation Layer Creating an object of the Business Layer
Presentation Layer Creating an object in wich will recieve the information
Presentation Layer Obtaining ID
Presentation Layer Calling of Business Layer Function
Business Layer Creating an object in wich will recieve the information
Business Layer Calling of Business Layer Function
Data Layer Result object declaration
Data Layer SQL Query definition
Data Layer Creating an object in wich we will recieve the information
Data Layer SQL Query Execution
Data Layer Returning the information of the database
Business Layer Returning the information of the Data Layer
Presentation Layer Returning Data from the Business Layer
Presentation Layer Displaying Results

3 Tier Architecture

  • 1.
  • 2.
    Main Points Whatis 3-Tier Architecture? Evolution to the 3-Tier Architecture Development What does 3-Tier Architecture offer you? Advantages and disadvantages using 3-Tier Architecture Example of how you can implement 3-Tier Architecture in .Net platform using C#.
  • 3.
    What is 3-TierArchitecture? A three-way interaction in a client/server environment. The user interface is stored in the client. The bulk of the business aplication logic is stored in one or more servers. The data are stored in a database server.
  • 4.
    What is 3-TierArchitecture
  • 5.
    Evolution to the3-Tier Architecture Single Tier Dual Tier Environments 3-Tier Architecture … N-Tier Architecture Tiers we are going to study…
  • 6.
    Single Tier (I)Time of huge “Mainframe” All processing in a single computer. All resources attached to the same computer Access via dumb terminals
  • 7.
    Single Tier (II)Advantages Simple Efficient Uncomplicated Disadvantages The cost of the central machine is very expensive
  • 8.
    Dual Tier (I)The Personal Computer Necessity of providing personal software The client/server model was born!!!!
  • 9.
    Dual Tier (III)Logical system components – most wich are on the client.
  • 10.
    Dual Tier (II)Problems with this model: The connections are very expensive. One can only connects a limited number of users to a server before SQL server spends more time managing connections than processing request. Cost-ineffective. Many users only use their connection 2-3% of the time.
  • 11.
    3-Tier Architecture (I)With the advent of Internet many people jumped to the conclusion that the days of the mainframe were back. Client/Server obviously failed, personal computers had failed and Windows was on its way out. A host of “thin client” application where developed. Thus 3-tier applications were born.
  • 12.
    3-Tier Architecture (II)This application runs the traditional client/server model but from a web server.
  • 13.
    3-Tier Architecture (III)The client only displays the GUI and data, but has no part in producing results.
  • 14.
    3-Tier Architecture (IV)Benefits: SCALABILITY: The application servers can be deployed on many machines. The database no longer requires a connection from every client (only from a smaller number of application servers). TP monitors or ORBs can be used to balance loads and dynamically manage the number of application server(s) available.
  • 15.
    3-Tier Architecture (V)Benefits: BETTER RE-USE: If an estandard object is employed, the specific language of implementation of the middle tier can be made transparent. IMPROVE DATA INTEGRITY: The middle tier can ensure that only valid data is allowed to be updated in the database.
  • 16.
    3-Tier Architecture (VI)Benefits: IMPROVED SECURITY: Since the client doesn’t have direct access to the database. Business Logic is generally more secure since it is placed on a more secure central server. REDUCED DISTRIBUTION: Changes to business logic only need to be updated on the application servers and do not have to be distribuited to all the clients.
  • 17.
    3-Tier Architecture (VII)Benefits: IMPROVED AVAILABILITY: Mission-critical applications can make use of redundant application servers and redundant database servers, so it can recover from network or server failures. HIDDEN DATABASE STRUCTURE Since the actual structure of the database is hidden from the caller.
  • 18.
    3-Tier Architecture (VIII)Drawbacks: INCREASED COMPLEXITY/EFFORT: In general is more difficult to build a 3-tier application compared a 2-tier application because: The points of communication are doubled. Many handy productivity enhacements provided by the client tools will be foregone or their benefit will be reduced. FEWER TOOLS: The existence of more tools available for a 2-tier model (e.g. most reporting tools).
  • 19.
    3-Tier Architecture (IX)The complexity concerns in the 3-tier model can not be easily dismissed, but there are many situations in which it provides certain benefits. Example: The bulk of data maintenance is done by a small number of users. A large number of users must be supported, but they only require a small subset of the total application logic Other application need to exchange some information/data with this application Some users need direct access to the data in order to use special tools (e.g. reporting tools).
  • 20.
    3-Tier Architecture (X)Conclusions: Complex application rules easy to implement in application server. Business logic off-loaded from database server and client, which improve performance Changes to business logic automatically enforce by server Application server is portable to other database server platforms by virtue of the application SW. Superior performance for medium to high volume environments
  • 21.
    3-Tier application inASP.Net Program organized into three major disjunctive tiers on layers: Application layer or Business layer Business layer Property layer Data layer
  • 22.
    3-Tier application exampleGraphical User Interface
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
    Presentation Layer Creatingan object of the Property Layer
  • 29.
    Presentation Layer Creatingan object of the Business Layer
  • 30.
    Presentation Layer Creatingan object in wich will recieve the information
  • 31.
  • 32.
    Presentation Layer Callingof Business Layer Function
  • 33.
    Business Layer Creatingan object in wich will recieve the information
  • 34.
    Business Layer Callingof Business Layer Function
  • 35.
    Data Layer Resultobject declaration
  • 36.
    Data Layer SQLQuery definition
  • 37.
    Data Layer Creatingan object in wich we will recieve the information
  • 38.
    Data Layer SQLQuery Execution
  • 39.
    Data Layer Returningthe information of the database
  • 40.
    Business Layer Returningthe information of the Data Layer
  • 41.
    Presentation Layer ReturningData from the Business Layer
  • 42.