30
Web Application Frameworks Presented by: Kamulegeya Grace

Web App Frameworks Edited

Embed Size (px)

Citation preview

Page 1: Web App Frameworks Edited

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

Page 2: Web App Frameworks Edited

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

Page 3: Web App Frameworks Edited

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?

Page 4: Web App Frameworks Edited

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!

Page 5: Web App Frameworks Edited

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.

Page 6: Web App Frameworks Edited

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 

Page 7: Web App Frameworks Edited

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 

Page 8: Web App Frameworks Edited

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

Page 9: Web App Frameworks Edited

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

Page 10: Web App Frameworks Edited

8/3/2019 Web App Frameworks Edited

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

MVC – general example

Page 11: Web App Frameworks Edited

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

Page 12: Web App Frameworks Edited

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."

Page 13: Web App Frameworks Edited

8/3/2019 Web App Frameworks Edited

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

What is Framework?

(cont.)

Page 14: Web App Frameworks Edited

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?

Page 15: Web App Frameworks Edited

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

Page 16: Web App Frameworks Edited

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

Page 17: Web App Frameworks Edited

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

Page 18: Web App Frameworks Edited

8/3/2019 Web App Frameworks Edited

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

Web App Framework

 ArchitectureModel 2  Architecture

Page 19: Web App Frameworks Edited

8/3/2019 Web App Frameworks Edited

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

Model-View-Controller in a

WAF

Page 20: Web App Frameworks Edited

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.

Page 22: Web App Frameworks Edited

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

Page 23: Web App Frameworks Edited

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

Page 24: Web App Frameworks Edited

8/3/2019 Web App Frameworks Edited

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

Request-based

Frameworks:Struts

Page 25: Web App Frameworks Edited

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

Page 26: Web App Frameworks Edited

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.

Page 27: Web App Frameworks Edited

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

Page 28: Web App Frameworks Edited

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

Page 29: Web App Frameworks Edited

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

Page 30: Web App Frameworks Edited

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