Presentation & Business Tier Design Patterns Pearce.

Slides:



Advertisements
Similar presentations
3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications.
Advertisements

JSP and Servelets.
Web Development with Karsten Schulz Terp-Nielsen Master Principal Sales Consultant Oracle Denmark.
Apache Struts Technology
Data Access Patterns Some of the problems with data access from OO programs: 1.Data source and OO program use different data modelling concepts 2.Decoupling.
Model-View-Controller ("MVC") This is a architectural design pattern for interactive applications. This design pattern organizes an interactive application.
Java Beans & Serialization CS-328 Dick Steflik. Java Beans Java based component technology –originally developed to provide java with a component technology.
Object-Oriented Enterprise Application Development J2EE Blueprints.
J2EE Java2 Enterprise Edition by Damian Borth. Contents Introduction Architectures styles Components Scenarios Roles Processing a HTTP request.
Faculty of Information Technology © Copyright UTS Faculty of Information Technology 2004Design-1 Advanced Java Programming Design issues Chris Wong
Enterprise Programming By J Pearce. Enterprise Software Sales HR Inventory Customer Support Shipping.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Structure of a web application1 Dr Jim Briggs. MVC Structure of a web application2.
Apache Struts Technology A MVC Framework for Java Web Applications.
M.Sc. Course, Dept. of Informatics and Telecommunications, University of Athens S.Hadjiefthymiades “Web Application Servers” Basics on WAS WAS are necessary.
Struts 2.0 an Overview ( )
UNIT-V The MVC architecture and Struts Framework.
Lecture 2 - Struts ENTERPRISE JAVA. 2 Contents  Servlet Deployment  Servlet Filters  Model View Controllers  Struts  Dependency Injection.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Java Frameworks Indy Java Users Group January 29, 2003.
JDBC Session 5 Tonight: Data Access Patterns 1.J2EE Architecture & Design Patterns 2.The Data Access Tier 3.Data Access Patterns –DataAccessObject (DAO)
Java Beans.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
1 Session Bean Chuyên đề Lập trình Java & J2EE Chương 14 Biên soạn: Th.S Nguyễn văn Lành.
J2EE Part 2: Enterprise JavaBeans CSCI 4300 Images and code samples from jGuru EJB tutorial,
CSC 2720 Building Web Applications Using Java Beans, Custom Tags and Tag Libraries in JSP pages.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
© D. Wong  Indexes  JDBC  JDBC in J2EE (Java 2 Enterprise Edition)
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
SUN J2EE Architecture (Introduction, J2EE Patterns, Samples)
JSP Architecture Outline  Model 1 Architecture  Model 2 Architecture.
Chapter 8 Script-free pages. Problem with scripting in JSP When you use scripting (declaration, scriplet, expressions) in your JSP, you actually put Java.
J2EE Structure & Definitions Catie Welsh CSE 432
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Case Study + MVC Lec Error Pages By means of the page directive, a JSP can be given the responsibility of an Error page An Error JSP will be called.
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
3-Tier Web Application Architecture. Simple Log-in public String button1_action() { // TODO: Process the button click action. Return value is a navigation.
Swing MVC Application Layering A Layer is a collection of components that Perform similar tasks. Perform similar tasks. Isolate implementation details.
Core Indigo Patterns Ted Neward
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Struts Framework Anna Paščenko. What is Struts?  An open source framework for building Java web applications.
Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
CourseOutline Example & JavaBeans Lec Start with Example Displaying Course Outlines User will select either course “web design & development” or.
J2EE Design Patterns Umer Farooq CS6704: Design Patterns & Component FrameworksApril 24, 2002.
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Chapter 9 Web Application Design. Objectives Describe the MVC design pattern as used with Web applications Explain the role and responsibilities of each.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Enterprise JavaBeans: Fundamentals. EJB Fundamentals(c)CDAC(Formerly NCST)2 Contents Introduction Technology Overview EJB Architecture EJB Specification.
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
Middleware Technology (J2EE/EJB) EJB Fundamentals.
Apache Struts Technology A MVC Framework for Java Web Applications.
CS320 Web and Internet Programming Web Application and MVC Chengyu Sun California State University, Los Angeles.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
Java Web Development with NetBeans IDE -- Kai Qian Chapter 9 Case Study.
ATS Application Programming: Java Programming
Structure of a web application
Field of Dreams An Online Sporting Goods Marketplace
Java Servlets By: Tejashri Udavant..
Server Concepts Dr. Charles W. Kann.
Introduction to J2EE Architecture
Pre-assessment Questions
Building a Rich Domain Model
CS320 Web and Internet Programming MVC Architecture
Presentation transcript:

Presentation & Business Tier Design Patterns Pearce

Definitions Pattern = reusable design Pattern Catalog = catalog of design patterns –Horizontal –Vertical Architectural pattern = Macro pattern = a composite pattern

Four Tier Architecture

Issues Migrating Business Logic from Presentation to Business Tier Providing B2B Business Tier

The Model-View-Controller Macro Pattern

MVC Variations Service to Worker View-Dispatcher

Service to Worker

Business Tier (Model) Patterns Entities Beans Value Objects Data Access Objects DAO Factories etc.

Entities An entity is an object that represents a persistent business entity such as an account or a customer. Entities must persist between the sessions or transactions that use them. Entities are stored in files or databases Entities are beans –Simple or EJB.

Java Beans A Java bean is an object that conforms to the Java Bean Component Model. –getters & setters for attributes –notifies listeners of attribute changes –serializable –etc.

Example: A Person Entity public class Person extends Entity { private String first; private String last; private Address address; private Phone phone; public Phone getPhone() { return phone; } public void setPhone(Phone p) { phone = p; } // etc. }

Value Objects A value object holds the attributes of one or more entities in public fields. Pass value objects, not entities, between layers. This reduces network traffic. Value objects can update and create entities. Entities can create value objects.

public class PersonVO extends ValueObject { public String first; public String last; public int addressOid; public String street; public String apartment; public String city; public String state ; public String zip; public int phoneOid; public String phone; public void update(Person per) {... } public Person makePerson() {... } } Example: Person VO

Address Book Entities

Data Access Objects (DAOs) A DAO represents a data source. DAOs are created by DAO factories.DAO factories DAOs hide the complexities of connecting with the underlying data source.

Example: Person DAO public interface PersonDAO { public int insert(PersonVO pvo) throws DAOException; public boolean delete(String name) throws DAOException; public PersonVO find(String name) throws DAOException; public boolean update(PersonVO pvo) throws DAOException; }

DAOs & Factories

Presentation Tier Patterns (Controller and View) View View Helper Front Controller

Single access point for all forms. May verify & validate request May analyzes request May assemble business data needed by view (Service-to-Worker) Selects and dispatches to view

View Helper Acts as intermediary between view and business tier Performs view-specific tasks

View Generates HTML response View may assemble the data it needs (Dispatcher-View) Needed data may be assembled by controller (Service-to-Worker) Provides utilities for generating HTML

Dispatcher-View Pattern

Every Servlet has 3 AMaps