web application architecture: multi-tier (2-tier, 3-tier) & mvc

18
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

Upload: clifton-franklin

Post on 24-Dec-2015

266 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

Web Application Architecture:multi-tier (2-tier, 3-tier) & mvc

Page 2: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

o Data Independence in Relational Databaseso N-tier Architectureso Design Patternso The MVC Design Pattern

Overview

Page 3: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

Data Independence in Relational Databases

Page 4: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

Database Architecture With Views

Page 5: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

Logical and Physical Independence

Page 6: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

o Logical Independence: The ability to change the logical schema without changing the external schema or application programso Can add new fields, new tables without changing viewso Can change structure of tables without changing view

o Physical Independence: The ability to change the physical schema without changing the logical schemao Storage space can changeo Type of some data can change for reasons of optimization

LESSON: Keep the VIEW (what the user sees ) independent of the MODEL (domain knowledge)

Data Independence

Page 7: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

N-tier architectures

Page 8: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

N-tier architectures have the same componentso Presentationo Business/Logico Data

N-tier architectures try to separate the components into different tiers/layers

o Tier: physical separationo Layer: logical separation

Significance of “Tiers”

Page 9: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

Significance of “Tiers”

Database runs on Servero Separated from cliento Easy to switch to a different database

Presentation and logic layers still tightly connectedo Heavy load on servero Potential congestion on networko Presentation still tied to business logic

Page 10: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

1-Tier Architecture

All 3 layers are on the same machineo All code and processing kept on a single machine

Presentation, Logic, Data layers are tightly connectedo Scalability: Single processor means hard to increase volume of

processingo Portability: Moving to a new machine may mean rewriting

everythingo Maintenance: Changing one layer requires changing other layers

Page 11: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

2-Tier Architecture

Database runs on Servero Separated from cliento Easy to switch to a different database

Presentation and logic layers still tightly connected (coupled)o Heavy load on servero Potential congestion on networko Presentation still tied to business logic

Page 12: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

3-Tier Architecture

o Each layer can potentially run on a different machine

o Presentation, logic, data layers disconnected

Page 13: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

A Typical 3-tier Architecture

Architecture Principleso Client-server architecture

o Each tier (Presentation, Logic, Data) should be independent and should not expose dependencies related to the implementation

o Unconnected tiers should not communicate

o Change in platform affects only the layer running on that particular platform

Page 14: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

A Typical 3-tier Architecture

Presentation Layero Provides user interfaceo Handles the interaction

with the usero Sometimes called the

GUI or client view or front-end

o Should not contain business logic or data access code

Page 15: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

A Typical 3-tier Architecture

Logic Layero The set of rules for

processing information

o Can accommodate many users

o Sometimes called middleware/ back-end

o Should not contain presentation or data access code

Page 16: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

A Typical 3-tier Architecture

Data Layero The physical storage

layer for data persistence

o Manages access to DB or file system

o Sometimes called back-end

o Should not contain presentation or business logic code

Page 17: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

The 3-Tier Architecture for Web Apps

o Presentation LayerStatic or dynamically generated content rendered by the browser (front-end)

o Logic LayerA dynamic content processing and generation level application server, e.g., Java EE, ASP.NET, PHP, ColdFusion platform (middleware)

o Data LayerA database, comprising both data sets and the database management system or RDBMS software that manages

and provides access to the data (back-end)

Page 18: Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc

3-Tier Architecture - Advantages

Independence of Layers

o Easier to maintain

o Components are reusable

o Faster development (division of work)o Web designer does presentationo Software engineer does logico DB admin does data model