22
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group Bill Dudney — Building JSF Applications Page 1 Building JSF Applications Architecting JSF Based Web Applications for the Real World Bill Dudney Object Systems Group [email protected]

Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Embed Size (px)

Citation preview

Page 1: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 1

Building JSF ApplicationsArchitecting JSF Based Web Applications for the Real World

Bill DudneyObject Systems [email protected]

Page 2: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 2

AgendaJSF Overview

Patterns & Architecture of JSFJSF Request/Response LifecycleComponents

Separation of ConcernsJSF User InterfaceServicesConnecting

Page 3: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 3

What Is JSF?Standard Web Application Framework

Defines the Programming ModelReusable ComponentsBuilds HTML from ComponentsValidation & ConversionComponent Tree

Page 4: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 4

Goals of JSFEase/Simplify DevelopmentSupport from/by toolsEvents easily tied to server side codeEase of extensionManage UI state

Page 5: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 5

AgendaJSF Overview

Patterns & Architecture of JSFJSF Request/Response LifecycleComponents

Separation of ConcernsJSF User InterfaceServicesConnecting

Page 6: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 6

Patterns & Architecture of JSFModel-View-ControllerComposite Component TreeServer Side Events

Page 7: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 7

Standard MVCMajor Benefits

Separation of ConcernsLoose coupling

Won’t work on the webBrowsers don’t listen to server eventsWhat objects would observe models?

So what to do to get the benifits?

Page 8: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 8

Enter JSF Web MVC

Page 9: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 9

JSF Provides Web MVCController

FacesServletLifeCycleApplicationNavaigationHandlerActionListenerConversion and Validation

Page 10: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 10

JSF Provides Web MVCView

RenderKitRenderers

ModelJavaBeansEJB’s

Extension PointsView & Controller are extensible

Page 11: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 11

Typical Implementation

Page 12: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 12

Composite Component TreeClient view is simple

Whole tree looks like one

ImplementationSimplified

Page 13: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 13

Server Side EventsEvents are cued & consumed server side

Typically from user actions (button clicks, etc.)

Possible to add programatically

Observer Pattern

Page 14: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 14

AgendaJSF Overview

Patterns & Architecture of JSFJSF Request/Response LifecycleComponents

Separation of ConcernsJSF User InterfaceServicesConnecting

Page 15: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 15

JSF Request/Response LifecycleRestore ViewApply Request ValuesProcess ValidationsUpdate Model ValuesInvoke ApplicationRender Response

Page 16: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 16

AgendaJSF Overview

Patterns & Architecture of JSFJSF Request/Response LifecycleComponents

Separation of ConcernsJSF User InterfaceServicesConnecting

Page 17: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 17

UIComponentHub of the frameworkTypically Delegate

RenderingValidatingConverting

Page 18: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 18

AgendaJSF Overview

Patterns & Architecture of JSFJSF Request/Response LifecycleComponents

Separation of ConcernsJSF User InterfaceServicesConnecting

Page 19: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 19

Running Example

Page 20: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 20

UIComponent Instances

Page 21: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 21

Implementation

Page 22: Architecting JSF Based Web Applications for the Real World ...softwaresummit.com/2004/speakers/DudneyJSFApplications.pdf · Bill Dudney — Building JSF Applications Page 13 Server

Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Object Systems Group

Bill Dudney — Building JSF Applications Page 22

To the Code!