Presentation is loading. Please wait.

Presentation is loading. Please wait.

Patterns and Frameworks for Managing Dynamic Views in Web Applications

Similar presentations


Presentation on theme: "Patterns and Frameworks for Managing Dynamic Views in Web Applications"— Presentation transcript:

1 Patterns and Frameworks for Managing Dynamic Views in Web Applications
Author: Daniel Archambault Supervisor: Harold Streeter

2 Overview Scope of the problem of managing dynamic views in web application Motivation behind providing better solution for managing dynamic views in web application Patterns and Frameworks already in use New Pattern and Framework proposed Future work

3 Web Application Development Problems
There are several problems being actively researched in web application development, such as: Managing Dynamic View: determine which view to display and its content with consistent information Authentication: identify users of a system and decide what privileges to provide to specific users Error Handling: determining accurately source of error, reporting it appropriately and recovering from it

4 Problem of Managing Dynamic View in Web Application
View and Content of web pages are becoming increasingly complex Need to decouple the work of the web designer creating views from the programmers providing the content Need to provide improved web application development framework to facilitate: View’s components arrangement and reuse Interconnection between view components state and input handling with object defining application’s behaviors

5 Motivation Generally in commerce:
competition is reducing profit margins cost of running and maintaining increasingly complex system increases Very important to minimize costs to avoid losing money money profit cost time

6 Motivation cont’d Achieving desired set of Quality attributes
Modifiability Security Performance Reliability Availability Usability Patterns and Frameworks facilitate building, maintaining and expanding complex web application by focusing on such quality attributes

7 Relationship between Patterns and Frameworks
Model-View Controller (MVC) Model 1 Model 2 Patterns within MVC Front Controller Mediator Command Composite View Observer Frameworks: J2EE BluePrints Web Application Framework(WAF) Apache Struts Apache Turbine Barracuda Hammock SourceForge WebWork BEA WebLogic IBM WebSphere Building Blocks of

8 Model-View-Controller Pattern
Model-View-Controller (MVC) Pattern Well established pattern for development of interactive application Increasingly popular in web application development Benefits Separates design concerns (control, presentation, data persistence and behavior) Decreases code duplication Centralizes control Improves application modifiability Helps construct architecture that facilitates managing dynamic views

9 Model-View-Controller Pattern Structure
Defines application behavior Maps user actions to model updates Selects view for response View Selection State Change User Actions View Renders the models Requests updates from models Sends user actions to controller Allows controller to select view Model Encapsulates application state Responds to state queries Exposes application functionality Notifies views of changes State Query Change Notification Events: Method Invocations:

10 Enterprise Servers/ Data Sources
MVC Model1 Pattern Application control is decentralized (current page determines next page to be displayed) Each JSP page processes its own inputs (parameters from GET or POST) Request Browser JSP Enterprise Servers/ Data Sources Response JavaBean Application Server

11 Enterprise Servers/ Data Sources
MVC Model2 Pattern The only difference with Model 1 is the addition of a controller servlet Dispatch requests from the client tier Selects views Response Enterprise Servers/ Data Sources JSP (View) Request Browser Servlet (Controller) JavaBean (Model) instantiates Application Server

12 J2EE BluePrints Web Application Framework (WAF)
WAF is a good starting point for learning about the principles of MVC Model 2 based framework design and usage in web application It is used as the infrastructure of some sample J2EE applications provided by Sun Demonstrates the mechanism and effective use of a Web-tier framework in an application design WAF is suitable for small and non-critical application Features Front Controller servlet Abstract action class for Web-tier actions Templating service Generic custom tags Internationalization support

13 Apache Struts Framework
Struts is also based on the MVC Model 2 pattern, but is more powerful than WAF Industrial-strength framework Suitable for large application Struts is not a “standard” for which J2EE product providers can reliably create tools Struts provides more features than WAF Web forms with validation Automatic population of server-side JavaBeans Utility classes for XML Richer set of custom tags the ones offered by WAF

14 Apache Turbine Framework
Turbine is similar to Struts, but has richer set of features for managing dynamic view, such as: Integrates with other template engine than JSP, such as Cocoon, WebMacro, FreeMarker and Velocity Caching Services (speeds up dynamic web applications by providing a means to manage cached data of various dynamic natures) Turbine also have a broader scope than struts, providing: Integration with Object Relational Mapping tools capability Job scheduler Localization services It is based on “Model 2 + 1” which is very similar to Model 2 (main difference is the way the actions are used)

15 Enhydra Barracuda Framework
Barracuda framework is a combination of MVC and Component frameworks It is more scalable than Struts, since it supports 3 different approach to content generation (accommodate application development with different levels of complexity): Simple Servlets Template Engines (JSP, TeaServlet, Webmacro, Freemarker, Velocity) Document Object Model (DOM) Manipulation It provides better component composition and reuse than using Turbine or Struts Barracuda is still not a “standard” for which J2EE product providers can reliably create tools

16 New Framework Proposed: JavaServer Faces
JavaServer Faces intends to handle all of the complexity of managing the user interface on the server Definition in progress by the Java Specification Request JSR127 To establish a standard API for creating Java web application GUIs To eliminate the need for developers of creating and maintaining web application GUI infrastructure To help bridge the gap between conventional GUI toolkit developers and web-based GUI developers JaverServer Faces will provide a standard GUI component framework which can be leveraged by J2EE development tools providers

17 New Pattern Proposed: Active View
Active View is a new pattern in the area of web application business layer Intent: Manage a Web active (dynamic) view Forces: Increase in demand for dynamic page content Requirement to update content with consistent information Need to develop a specific powerful client by using a particular protocol to support communication between client and server. When data value changes in database, the runtime system produces a particular signal over the net, and upon receiving the signal the client update its view.

18 New Pattern Proposed: Active View cont’d
Solution: The Active View pattern provides a solution to this problem by refocusing the Observer pattern in a Web architecture Defines an easy method to develop an application Renders the front-end receptive to business logic’s signal Increases the independence among objects, allowing the subject to disregard the number of interested objects The communication between the subservlet and observlet could be developed using standard potocol such as Java RMI

19 New Pattern Proposed: Active View structure
Subject +attach(observer) +detach(observer) +notify() <<Httpservlet>> #doGet() #doPost() Observer +update() 0..* Observlet * 1 Subservlet 1..* 1..* Trigger +SendEvent()

20 Future Work Study more in-depth the Active View pattern
Explore integrating the Active View pattern with other patterns Provide a reference implementation of the Active View pattern as a proof of concept

21 References Patterns for Web applications, Diego Bonura, Rosario Culmone, Emanuela Merilli, July 2002, ACM /02/0700 JavaServer Faces Technology JavaServer Faces - JSR127 Understanding JavaServer Pages Model 2 Architecture -- The Problems with JSP -- The Apache Jakarta Project -- Enhydra Barracuda Design Patterns: From Analysis to Implementation, Net Objectives, 2002 Design Pattern for Web Programming - Do you need MVC?, Al Williams, June 2002, Internet Strategies for Technology Leaders The Role of Patterns in Enterprise Architecture Designing Enterprise Applications with the J2EETM Platform, Second Edition


Download ppt "Patterns and Frameworks for Managing Dynamic Views in Web Applications"

Similar presentations


Ads by Google