layers & tiers

22
Layers & Tiers Lec - 41

Upload: iona-norman

Post on 31-Dec-2015

50 views

Category:

Documents


0 download

DESCRIPTION

Layers & Tiers. Lec - 41. Layers & Tiers. Layers are merely logical groupings of the software components that make up the application or service. Whereas tiers refer to the physical residence of those layers (hardware) In general, Layers – represents logical view of application - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Layers & Tiers

Layers & Tiers

Lec - 41

Page 2: Layers & Tiers

Layers & Tiers Layers are merely logical groupings of the software

components that make up the application or service.

Whereas tiers refer to the physical residence of those layers (hardware)

In general, Layers – represents logical view of application Tiers – represents physical view of application

However, both terms are used interchangeably.

Page 3: Layers & Tiers

Layers

Figure shows a simplified view of one application and its layers.

Page 4: Layers & Tiers

Tiers

Client machine

Server machine

DB machine

Presentation Layer

Web Layer

Business Layer

EIS Layer

browser

Web server

Applicationserver

DB server

Page 5: Layers & Tiers

Layers [1]

Presentation layer

Collects user inputs

Validates user inputs

Presents the results of a computation

Controls the screen flow

Page 6: Layers & Tiers

Layers [2]

Business Layer

Concerned with the application specific functionality

Used to implement business rules and to perform business tasks

For example, in a banking system, banking functions such as opening an account, calculation of Tax, etc.

Page 7: Layers & Tiers

Layers [3]

Data Layer

Concerned with the management of the data & data sources of the system.

Data sources can be database, XML , web services, flat file etc.

Encapsulates data retrieval & storage logic

For example, the address book application needs to retrieve all person records from a database to display them to the user

Page 8: Layers & Tiers

Layers Support in Java

JSP / ServletsFrameworks(Struts,JSF etc)

HTML/Applets

JavaBeans / EJB

Server Presentation

Client Presentation

Business

Layers Java/J2EE Technology

DAO / ConnectorsData

Page 9: Layers & Tiers

Java 2 Enterprise Edition(J2EE)

Page 10: Layers & Tiers

What is J2EE?

Open and standard based platform for:

Development & deployment of n-tier web based and component based enterprise applications

Reusability, enhance-ability, scalability & interoperability

Page 11: Layers & Tiers

J2EE Suite Core technology:

Container infrastructure, language and environment support

Web Technology Java Servlets JavaServer Pages (JSP) JavaServer Pages Standard Tag Library (JSTL) JavaServer Faces (JSF)

Platform services Security Transactions Resources Connectors Java Message Service

And extensive support for XML technology Enterprise Java Bean (EJB) technology etc.

Page 12: Layers & Tiers

J2EE Distributed Multi-tiered Applications

Page 13: Layers & Tiers

J2EE :Multi-tiered Applications

Page 14: Layers & Tiers

J2EE :Multi-tiered Applications

Page 15: Layers & Tiers

J2EE :Multi-tiered Applications

servlets

Page 16: Layers & Tiers

Client TierCommunication Options

Page 17: Layers & Tiers

Communication with Business Tier

Page 18: Layers & Tiers

Case Study: Matrix Multiplication

Using Layers

Page 19: Layers & Tiers

Case Study: Matrix Multiplication

Problem Statement Calculate product of two matrices of order 2

* 2 Result of multiplication should be stored

in DB as well as shown to the user.

Page 20: Layers & Tiers

Case Study: Matrix Multiplication

Format Input format

input will be in 4,2,6,5 format separated by commas where 4,2 represents entries of the first row

Display format Displays the matrix as a square

Storage format Matrix will be stored as a string

Page 21: Layers & Tiers

Matrixinput.jsp

Matrixresult.jsp

ControllerServlet

MatrixMultiplier

MatrixDAO

Matrix

Beann

Business layer

Data layer

Controller layer

Server sidePresentation layer

HTMLClient sidePresentation layer

Matrix Multiplication: Layer by Layer View

Page 22: Layers & Tiers

Case Study: Matrix Multiplication

Example Code

netBeans4.1 Project