You are on page 1of 30

Web Application Frameworks

Presented by: Kamulegeya Grace

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

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?

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!

General 3 tiered structure


First

tier: client side code (webbrowser), e.g. (X)HTML, JavaScript, Java applets, Flash Second tier: server side code, e.g. C#, C/C++, Perl, PHP, Java, Ruby, Python Third tier: server side database and other Enterprise Information Servers like Enterprise Resource Planning servers, Legacy systems etc.

Model View Controller

Architectural

Pattern from Smalltalk (1979) Decouples data and presentation Eases the development

Server

Client

Database

First thought (ok, but not far enough):


Tier 1: View (Client) Tier 2: Controller (Server) Tier 3: Model (Database)

Presentation

Data

Database

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

Data:
Model is the database

Example Control Flow in MVC


User

interacts with the VIEW UI CONTROLLER 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

MVC general example

What is Framework?
In

information systems environment,

a framework is a defined support structure in which other software applications can be organized and developed.
A

software framework is a reusable design and building blocks for a software system and/or subsystem

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: "Dont call us, well call you."

What is Framework? (cont.)

Why we use Framework?

The software frameworks significantly reduce the amount of time, effort, and resources required to develop and maintain applications. Aims to alleviate the overhead associated with common activities
libraries for database access templating session management code reuse

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 web applications , which commonly serve the web browsers via the Http's protocol.

WAF usually implements the Model-ViewController (MVC) design pattern. They typically implement the MVC Model 2 architecture to develop request-response webbased applications on the Java EE and .Net models

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

Web App Framework Architecture

Model 1 Architecture

Web App Framework Architecture


Model

2 Architecture

Model-View-Controller in a WAF

Why use a Web Application Framework


1.

2.

3.

4.

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. 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. WAFs store important data in a relational database and they interact with users via a web-based user interface. Any application written on top of a Web Application Framework can transparently and immediately take advantage of these basic services.

Popular web application frameworks


Java Web Application framework (Java) Struts and struts2 (Java) Spring Framework (Java) Yii Frameowrk (PHP) Ruby on Rails (Ruby) Turbogears (Python) Google_App_Engine (Python, Django) Django (Python)

Java Web Application Frameworks


These

consist of

Request-based Frameworks Component-based Frameworks Hybrid Meta Frameworks RIA-based Frameworks

Request-based Frameworks
A Request-based Framework is very close to the original CGI 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

Request-based Frameworks:Struts

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 a FormAction class. The FormAction class is responsible for validating any form input. Control is then passed on to an Action class. Its the responsibility of the Action class to call any Model components, such as classes responsible for updating information in a

Struts:how it works cont


Control

is then passed on to an Action class.

Its the responsibility of the Action class to call any Model components, such as classes responsible 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.

Component-based Frameworks
Examples Jave Server Faces (JSF)
Tapestry Wicket

Jave Server Faces (JSF)

JavaServer Faces (JSF) is a server-side user interface component 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

Other Java Web Application Frameworks


Hybrid Meta Framework
RIFE Spring Framework

RIA-based Framework
DWR Echo2 JSON-RPC-Java

Summary
Web

applications

Client, Server, Database Easy to maintain, harder to write


Model Web

View Controller

Eases web application development

Application frameworks

You might also like