Inside Gradebook - June 9, 2005 Inside Gradebook Or: How I Learned to (almost) Stop Worrying &...
-
Upload
louise-patterson -
Category
Documents
-
view
217 -
download
0
description
Transcript of Inside Gradebook - June 9, 2005 Inside Gradebook Or: How I Learned to (almost) Stop Worrying &...
Inside Gradebook - June 9, 2005
Inside Gradebook
Or: How I Learned to (almost) Stop Worrying & (almost) Love JSF 1.1
Ray Davis – UC Berkeley
Inside Gradebook - June 9, 2005
Pragmatic Development• Incremental• Cyclical• User-driven• Lazy optimization• Lazy generalization
Inside Gradebook - June 9, 2005
Small Interdisciplinary Team• Functional specification
– Ben Brophy - UI - MIT– Oliver Heyer - Project Manager - UC Berkeley
• Implementation– Ray Davis – UCB– Josh Holtzman - UCB
• Sakai integration– VARIED
• Samigo integration– VARIED
Inside Gradebook - June 9, 2005
Goals• Best-of-breed online gradebook• Meet MIT and UC needs• Built on new Sakai framework• Built on new Sakai course management API• Built with rich JSF component set• Close integration with Samigo• ... Due in four months
Inside Gradebook - June 9, 2005
Goals, 2• DUE BEFORE new Sakai framework• DUE BEFORE new Sakai course
management API• DUE BEFORE rich JSF component set• DUE BEFORE Samigo completely stable
Inside Gradebook - June 9, 2005
Something's Gotta Give• Delivery date?• Functionality?• Stability?
Inside Gradebook - June 9, 2005
Jettisoned• Close cross-dependencies• Anything not in Sakai 1.5 (e.g., sections)• Two-way sharing with Samigo• Complex UI; potential design issues
– Percentage-weighting– Categories– Histories– Graphs
• Immediate use by MIT or UC Berkeley
Inside Gradebook - June 9, 2005
Managed Change• Living specs• Spec team updates
CVS• Discussion via
BaseCamp & Confluence
Inside Gradebook - June 9, 2005
Integration – Tool / Component
App Presentation External Apps
App Business Logic
Inside Gradebook - June 9, 2005
Integration – Application / Service
App Presentation External Apps
App Interface
Shared Model Logic
Service Interface
Inside Gradebook - June 9, 2005
Integration – Direct Client
GradebookSakai 2APIs
Inside Gradebook - June 9, 2005
Integration – Facades
GradebookGB
Facades
Sakai 1.5APIs
Sakai 2APIs
Tests
Standalone
Inside Gradebook - June 9, 2005
The Scary Part - JSF• JSF 1.1 lacks components.• JSF 1.1 has more general problems.• JSF 1.2 is likely to fix many.• JSF 1.2 isn’t available.
Inside Gradebook - June 9, 2005
JSF 1.1 - Berkeley Pilot Experience
• Buggy• Unpredicted results• Tangled backing beans• Forced session scope
Inside Gradebook - June 9, 2005
Taming JSF – Bugginess• Switch to MyFaces
– Still buggy, but…– Releases more often– Access to CVS head
Inside Gradebook - June 9, 2005
Pure Request Scope
R
AppContext
DB
R
AppContext
R
AppContext
R
AppContext
Inside Gradebook - June 9, 2005
Session Scope
R
AppContext
DB
R R
Inside Gradebook - June 9, 2005
Request Thread ScopeAKA task scope, page flow scope, workflow scope....
R
AppContext
DB
R R
AppContext
AppContext
Inside Gradebook - June 9, 2005
Request Threads in JSF 1.1• Carry thread state in UI component• New FlowState component, inspired by
MyFaces SaveState<gbx:flowState bean="#{phaseAwareBean}" />
Inside Gradebook - June 9, 2005
JSF - Data Synchronization• Phase-aware backing beans
– PhaseAware interface– InitializableBean superclass
• Controlled guaranteed initialization from DB
Inside Gradebook - June 9, 2005
Taming JSF - Coding Conventions
• One page = One backing bean• Backing bean is selectively Serializable• Confine DB queries to init()• Avoid unnecessary DB queries• No domain objects in request thread state• HINT: Use PhaseListener when debugging
Inside Gradebook - June 9, 2005
JSF - Incremental GeneralizationJSP 2
1. Embedded2. Included3. JSP tag4. Java tag
JSF 1.11. Embedded2. --3. --4. Java component
Inside Gradebook - June 9, 2005
JSF - Incremental Generalization• Solution: MyFaces aliasBeanFrom addAssignment.jsp :
<x:aliasBean alias="#{bean}" value="#{addAssignmentBean}"> <%@include file="/inc/assignmentEditing.jspf"%></x:aliasBean>
From editAssignment.jsp :<x:aliasBean alias="#{bean}" value="#{editAssignmentBean}"> <%@include file="/inc/assignmentEditing.jspf"%></x:aliasBean>
From inc/assignmentEditing.jspf :<h:inputText id="title" value="#{bean.title}“
required="true" >
Inside Gradebook - June 9, 2005
JSF - Components• Reduced need• Mocked up with embedded• Move over to Sakai 2 as available• Pager tag - Thanks, Jon Andersen!
Inside Gradebook - June 9, 2005
Bumps• Changes in responsible parties• Changes to facades• Changes to service interface• Changes to formatting• Reorganization & repackaging of files• Changes to Sakai framework expectations
Inside Gradebook - June 9, 2005
Results• Delivered specified functionality on
schedule• Multiple DBs• Multiple deployment styles• Back button, multiple windows/tabs• Less server load• Foundation for future work
Inside Gradebook - June 9, 2005
Future Work• Refactor tests• Domain objects in request threads• JSF - redirecting URLs• JSF - out of sync URLs• JSF - precompile JSPs• Submit MyFaces approach to wider group• Restore MIT/Berkeley functionality