Web App Frameworks Edited

Post on 06-Apr-2018

219 views 0 download

transcript

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 1/30

Web Application Frameworks

Presented by: Kamulegeya Grace

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 2/30

Overview

Web applications overview

Introduction to Model-View-Controller

(MVC) What is Framework

What is WAF

Overview of web application frameworks

Minutes Wiki20 Minutes Wiki

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 3/30

WPS so far 

Technologies:

• HTML

• CSS

• JavaScript

• DOM, Dynamic

HTML

• PHP• XML

May seem complicated

already

But still not everything How to possibly get it

all under one hood?

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 4/30

Webapps summary

 Accessed with a Web Browser (client) Over a network Code is mainly run on server 

Exception Client-side Scripting languages :JavaScript (also: Java applets, Flash, ActionScript)

Data is mainly stored on server  Webapps can be updated easily…

..without updating the clients!

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 5/30

General 3 tiered structure

First tier: client side code (web-

browser), e.g. (X)HTML, JavaScript,

Java applets, FlashSecond tier : server side code, e.g. C#,

C/C++, Perl, PHP, Java, Ruby, Python

Third tier: server side database andother Enterprise Information Servers

like Enterprise Resource Planning

servers, Legacy systems etc.

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 6/30

 Architectural Pattern from Smalltalk (1979)Decouples data and presentation

Eases the development

Model View Controller 

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 7/30

First thought (ok, but not far enough):

• Tier 1: View (Client)

• Tier 2: Controller (Server)

• Tier 3: Model (Database)

Database

ClientServer 

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 8/30

Presentation:

• View is the user interface (e.g. button)• Controller is the code (e.g. callback for button)

Data:• Model is the database

Database

Presentation

Data

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 9/30

Example Control Flow in MVC

User interacts with the VIEW UICONTROLLER handles the user input

(often a callback function attached to UI 

elements)CONTROLLER updates the MODEL

VIEW uses MODEL to generate new UI

UI waits for user interaction

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 10/30

MVC – general example

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 11/30

What is Framework?

In information systems environment,

• a framework is a defined support structure

in which other software applications can beorganized and developed.

 A software framework is a reusabledesign and building blocks for a software

system and/or subsystem

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 12/30

What is Framework? (cont.)

In an object-oriented environment,• a framework consists of abstract and

concrete classes.

• Instantiation of such a framework consists of composing and subclassing the existing

classes

Software frameworks rely on the

Hollywood Principle: "Don’t call us, we’ll

call you."

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 13/30

What is Framework?

(cont.)

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 14/30

The software frameworks significantly reduce the

amount of time, effort, and resources required to

develop and maintain applications.

 Aims to alleviate the overhead associated withcommon activities

• libraries for database access

• templating

• session management• code reuse

Why we use Framework?

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 15/30

Web application framework Software framework that is designed to support the

development of dynamic websites

 A Web Application Framework (WAF) is a

• reusable, skeletal, semi-complete modular platform

that can be specialized to produce custom webapplications , which commonly serve the web

browsers via the Http's protocol.

WAF usually implements the Model-View-

Controller (MVC) design pattern. They typically implement the MVC Model 2

architecture to develop request-response web-

based applications on the Java EE and .Net

models

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 16/30

Web App Framework

 Architecture

Most frameworks follow the Model View

Controller (MVC) architectural pattern

Most MVC frameworks follow a push-based

architecture

• use actions that do the required processing, and

then "push" the data to the view layer to render 

the results

 Alternative pull-based architecture

• start with the view layer, which can then "pull"

results from multiple controllers as needed

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 17/30

Web App Framework

 Architecture

Model 1 Architecture

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 18/30

Web App Framework

 ArchitectureModel 2  Architecture

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 19/30

Model-View-Controller in a

WAF

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 20/30

Why use a Web Application

Framework1. Virtually all web applications have a common set of basic

requirements, such as user management e.g., secure

user login, password recovery), group management,

and access authorization.

2.  A Web Application Framework usually includes all these

functionalities, refined through hundreds of production

deployments, freeing developers to focus on the needs of 

their specific application.

3. WAFs store important data in a relational database and

they interact with users via a web-based user interface.

4.  Any application written on top of a Web Application

Framework can transparently and immediately take

advantage of these basic services.

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 22/30

Java Web Application

Frameworks

These consist of 

• Request-based Frameworks

• Component-based Frameworks

• Hybrid – Meta Frameworks

• RIA-based Frameworks

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 23/30

Request-based Frameworks

 A Request-based Framework is very close to the originalCGI specification.

Characteristics

It uses controllers and actions that directly handle

incoming requests. Each request is essentially stateless.

Request Based Frameworks include

• Struts

• WebWork• Beehive , Stripes

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 24/30

Request-based

Frameworks:Struts

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 25/30

Struts: how it works

 A user sitting at a browser clicks a button,link, or types in a url.

 A Struts Servlet receives that request.

It normally hands over the request to aFormAction class.

The FormAction class is responsible for 

validating any form input.Control is then passed on to an Action class.

It’s the responsibility of the Action class to call

any Model components, such as classes

responsible for updating information in a

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 26/30

Struts:how it works con’t

 Control is then passed on to an Action class.

• It’s the responsibility of the Action class to call

any Model components, such as classesresponsible for updating information in a

database.

The final step is typically to forward to another 

JSP, thus a response being sent back to the

browser.

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 27/30

Component-based Frameworks

ExamplesJave Server Faces (JSF) Tapestry

Wicket

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 28/30

Jave Server Faces (JSF)

JavaServer Faces (JSF) is a server-side user interfacecomponent framework for Java-based Web applications.

JSF contains an API for 

• representing UI components and managing their 

state;• handling events,

• server-side validation,

• and data conversion;

• defining page navigation;

• supporting internationalization and accessibility;

• and providing extensibility for all these features

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 29/30

Other Java Web Application

Frameworks

• Hybrid – Meta Framework

• RIFE

• Spring Framework

• RIA-based Framework• DWR

• Echo2

• JSON-RPC-Java

8/3/2019 Web App Frameworks Edited

http://slidepdf.com/reader/full/web-app-frameworks-edited 30/30

Summary

Web applications

• Client, Server, Database

• Easy to maintain, harder to writeModel – View – Controller 

• Eases web application development

Web Application frameworks