Page 1 R MVC Design Pattern Definition Properties Describing MVC design patterns.

Slides:



Advertisements
Similar presentations
Enterprise Java and Data Services Designing for Broadly Available Grid Data Access Services.
Advertisements

J2EE Architecture Overview
Apache Struts Technology
Spring, Hibernate and Web Services 13 th September 2014.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
An architecture for webb applications, J2EE
Introduction to Java 2 Enterprise Edition About myself –Neutrinos, Cancer Research, IT Applications Today’s topic: J2EE –Context –Advantages –Components.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
Component Based Systems Analysis Introduction. Why Components? t Development alternatives: –In-house software –Standard packages –Components 60% of the.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Apache Struts Technology A MVC Framework for Java Web Applications.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Struts 2.0 an Overview ( )
UNIT-V The MVC architecture and Struts Framework.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
Java Frameworks Indy Java Users Group January 29, 2003.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
MODEL VIEW CONTROLLER A Technical Seminar Report submitted to
MVC pattern and implementation in java
©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.
Distributed Multitiered Applications The J2EE platform uses a multitiered distributed application model. Application logic is divided into components 1.
CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.
Chapter 4: Core Web Technologies
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
Glink: GCOS e-business in an application server architecture Summit 2000, Jim Gallagher.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Introduction to J2EE Architecture Portions by Kunal Mehta.
Comp2513 JavaBeans, EJB and J2EE Daniel L. Silver, Ph.D.
JBoss at Work JAW Motors Application Chapter 1-3 Jeff Schmitt October 9, 2006.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Adaptive Hypermedia Tutorial System Based on AHA Jing Zhai Dublin City University.
Design Patterns. Patterns “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution.
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
GRASP: Designing Objects with Responsibilities
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Portals: Architecture & Best Practices Greg Hinkle February 2005.
REST By: Vishwanath Vineet.
Alan L. Batongbacal CS 4244 / 01 Nov 2000
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Glink for Java: applet, application and an API for integrating access to Bull, IBM, UNIX and Minitel systems with your Java based e-business applications.
Apache Struts Technology A MVC Framework for Java Web Applications.
MODEL VIEW CONTROLLER PATTERN. Model View Controller MVC is a time tested method of separating the user interface of an application from its Domain Logic.
Java Server Pages Can web pages be created specially for each user?
J2EE Platform Overview (Application Architecture)
GRASP – Designing Objects with Responsibilities
Introduction to J2EE Architecture
Enterprise Application Architecture
Design and Maintenance of Web Applications in J2EE
Patterns.
Presentation transcript:

Page 1 R MVC Design Pattern Definition Properties Describing MVC design patterns

Page 2 R Patterns “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice” – Christopher Alexander (building architect)

Page 3 R Object Technology Patterns A pattern is a named description of a problem and solution that can be applied in new contexts. Patterns codify the principles and idioms that guide experienced developers in their creation of software. What is and isn’t a pattern depends on your point of view.

Page 4 R Object Technology Patterns 2 Design patterns are not about structures such as vectors that can be encoded in classes and reused as is, nor are they complex domain specific designs. Ideally, patterns should include guidance for how they can be applied in novel situations. Many patterns provide guidance for how responsibilities should be assigned to objects.

Page 5 R MVC Model View Controller Increases reusability by partially decoupling data presentation, data representation, and application operations. Enables multiple simultaneous data views.

Page 6 R Intent Facilitates maintenance, extensibility, flexibility, and encapsulation by decoupling software layers from one another.

Page 7 R Advantages The Model-View-Controller ("MVC") design pattern separates the application data from both the ways the data can be viewed or accessed, and from the mapping between system events (including user interface events) and application behaviors

Page 8 R Architecture

Page 9 R Applicability Use Model View Controller: – for distributed applications – for larger applications – for applications with a long lifetime – to enhance interface and back-end portability – where identical data must be viewed and manipulated in multiple ways. – to improve maintainability – to support concurrent, modular development with many developers – to facilitate division of labor by skill set – to facilitate unit testing – with enterprise beans that are reusable across applications

Page 10 R Model – abstracts application functionality – encapsulates the application state – provides access to application functions – manages persistence, when there is persistence – notifies interested parties when data change

Page 11 R View – abstracts data presentation – presents data to the user – maintains consistency with model data

Page 12 R Controller – abstracts user interaction/application semantic map – translates user inputs into application actions – select appropriate data displays based on user input and context

Page 13 R Collaboration - Model notifies Views when it changes application data can be queried by the View provides application functionality access to the Controller

Page 14 R Collaboration – View presents Model data to the user updates display when informed of data changes by the Model forwards user input to the Controller

Page 15 R Collaboration - Controller translates user inputs into application actions on the Model selects the View to present based on user input and Model action outcome(s)

Page 16 R Consequences Clarifies design by separating data modeling issues from data display and user interaction. Allows the same data to be viewed in multiple ways. Allows the same data to be viewed by multiple users. Improves extensibility by simplifying impact analysis. Improves maintainability by encapsulating application functions behind well-known APIs, and decreasing code replication ("copy-paste-and-hack"). Enhances reusability by decoupling application functionality from presentation. Makes applications easier to distribute, since MVC boundaries are natural distribution interface points. Can be used to partition deployment and enable incremental updates. Facilitates testability by forcing clear designation of responsibilities and functional consistency. Enhances flexibility, because data model, user interaction, and data display can be made "pluggable."

Page 17 R Implementation - Issues Since components can't take advantage of knowledge of other components' implementation details, performance must be balanced with the other considerations above. Skillful API design can overcome this pitfall to some extent. MVC may not scale well in distributed systems, if communication volume and latency issues are not carefully addressed. MVC applications can be difficult to maintain if the Model's API is in flux, since the Controller is written in terms of the Model API. Implementing Controller/Model communication as a Command pattern can minimize API drift and provide a hook for Controller extensions to handle new Model functions. Alternately, in many cases it's possible to use an Adapter to provide backward API compatibility.

Page 18 R Example 1 – ULM diagram

Page 19 R Example 2 - Dynamics

Page 20 R The Problem with Servlets From HTML content has to be created within code Content creators have to ask developers to make all content changes

Page 21 R JSP - Model 1 Architecture

Page 22 R Strengths of Model 1 Very easy to implement initially requires "no brainer" knowledge of JSP and Java

Page 23 R Problems with Model 1 Having web designers and developers working on the same file isn't ideal. Java inside HTML proves almost as awkward as having HTML inside Java

Page 24 R Model 2 explanation requests are submitted to a servlet "controller" that performs business logic and generates an appropriate data "model" to be displayed This data is then passed internally to a JSP page "view" for rendering The appropriate JSP page can be selected to do the display

Page 25 R Model 2 Architecture

Page 26 R Advantages of Model 2 takes advantage of the predominant strengths of both technologies, using JSP to generate the presentation layer and servlets to perform process-intensive tasks the more complex your application, the greater the benefits of using the Model 2 architecture should be

Page 28 R Tomcat Moving Parts JSP files Completed servlets Static documents HTTP request HTTP response JSP servlets Servlet engine Apache web server Client JSP Engine JSP engine

Page 29 R Tomcat and JBOSS = J2EE (X)HTML XML Applet Client application HTTP(S) RDBMS Mail server JDBC JavaMail RMI IIOP eDirectory™ JNDI Message queue JMS Servlets Tag library RMI / IIOP JNDI JTA JDBC JMS Java mail JAF Tomcat web container JSPs RMI / IIOP JNDI JTA JDBC JMS Java mail JAF EJB container Session beans beans Entity beans Java application CORBA server

Page 30 R A Tomcat Application Tomcat WebApps examples images JSP servlets Meta-inf Web-inf Web.xml Classes ServletServlet ServletServlet ServletServlet ServletServlet JSPJSP JSPJSP JSP compiler Lib Web application

Page 31 R Tomcat in Stand-Alone Mode When a servlet container is stand- alone, it acts as its own web server – It completely bypasses the traditional HTTP server When running in stand-alone mode, special requests are generally forwarded to port 8080 Servlet Container Servlet JVM

Page 32 R In-Process Container The in-process container configuration requires the servlet container to be bound to the web server by a plug-in that is responsible for mediating communication between the server and the container The plug-in and the container run in the server’s memory space, as does the JVM that executes the servlet and its container Web server Java plug-in Servlet JVM Servlet

Page 33 R Out-of Process Servlet Container This configuration option involves utilization of two memory spaces The first supports the web server and the Java plug-in The other supports the JVM and the servlet container JVM Web server Java plug-in Servlet Servlet Container

Page 34 R MVC Architecture Data (Bean properties) Event (request) Display info Data Action URLs Model View Controller Model Beans View JSPs Controller Servlets Event (forward) Event (request) Browser

Page 35 R MVC Architecture JSP/servlet beans (controller) Format beans (view) Command beans (model) MVC

Page 36 R Command Beans Java bean that encapsulates a single business logic task Provides a stable boundary between the business logic and user interface Allows business logic to evolve without disrupting the rest of the web application Can be serialized and distributed

Page 37 R Creating Dynamic Content Using Novell eDirectory™ Using eDirectory beans to dynamically create web content – Authentication – Identity management – Content management Demonstration Sequence

Page 38 R JSP Pages and the useBean Tag Demonstration Sequence

Page 39 R Authorization Bean Chris Cooper is already a registered member who has specific interests His identity is kept in the directory along with specialized attributes that are extensions of his user object // Call the execute method command bean authBean.execute(); Demonstration Sequence

Page 40 R Cooper’s Page after Authentication Passing input parameters to the authorization bean  get name  get password  ou=people, o=aspen

Page 41 R CreateBean—New Member Registration Demonstration Sequence Passing parameters to the CreateBean – ObjectClass – Name – – Password

Page 42 R