Professional Documents
Culture Documents
Overview
Web applications overview Introduction to Model-View-Controller (MVC) What is Framework What is WAF Overview of web application frameworks
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!
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.
Architectural
Pattern from Smalltalk (1979) Decouples data and presentation Eases the development
Server
Client
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
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
What is Framework?
In
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
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."
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
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
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
Model 1 Architecture
2 Architecture
Model-View-Controller in a WAF
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.
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)
consist of
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
Request-based Frameworks:Struts
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
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
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
RIA-based Framework
DWR Echo2 JSON-RPC-Java
Summary
Web
applications
View Controller
Application frameworks