Orbitz and Spring Webflow Case Study - Presentation Transcript
Case Study:
The Next Generation
Online Travel Platform
Michael Alford, Mark Meeker, and Alex Antonov
Agenda
• Project context
• Technology architecture
• Building UI forms
• Interesting Flows
• Security and SSL
• Progressive Enhancement
• Composite View Pattern
• Componentization
• URLs and REST
• State management and HTTP browser caching headers
• Internationalization
• Performance and concurrency
• Summary
• Q&A
Project Context
Tech History
3 years of Spring
Framework usage
Spring MVC
experiments
Travel Commerce
Platform
Increase developer
productivity
Technology
Architecture
Direct Connections
Booking Services
Distributed Business
Travel Business Services
Session Cache
Thin Presentation Layer Distributed Web
(Tomcat, Spring, SWF) Session Cache
Deals Shop Book Care
(REST) (REST) (not REST) (mixed)
Spring and the
UI Layer
Dear Java Developers,
Whatever you do, don’t choose a
web framework that generates its
own XHTML (or worse, non-
validating @#$% HTML that we
wouldn’t be caught dead near).
Your friends,
The UI Team
Form Custom Tags
• Started pre- spring-form.tld
• Full control of mark-up
• Abstracts concept of binding
• Limit attributes available to be set
• type, maxlength, class, autocomplete
• Extended scope to include <label />
Form Custom Tags
• Additional values for inputs
• label-key, label-state, required, read-only
• Build in hook for JavaScript
• Turn-off running against live model
• Augment error handling
Error Display
• Custom Error custom tag
• Formats errors with correct styles
• Support for error tag debugging
• Error highlighting built into form inputs
Interesting Flows
• Leverage framework for page navigation
• Large number of special conditions in
booking path
• Informational pop-up flows need data from
flow, but don’t affect it
• “Helper” flows for RESTful Ajax calls
• Requirement for a “wait page”
Security and SSL
• Browser security alerts are bad for
business!
• HTTP vs. HTTPS based on URL pattern
• Spring Security channel filter to enforce
SSL
• Custom link tag insures correct protocol
• Single source of truth
Flow listener with flow annotations to
indicate flow’s security level
<action-state id=“purchase”>
<attribute name=“permissions” value=“USER”/>
…
</action-state>
Universality
• Serve pages that will work on any and
every device
• Fundamental basis for the web
• Goes hand-in-hand with Accessibility
Graded Browser Support
http://developer.yahoo.com/yui/articles/gbs
Progressive
Enhancement
Plain
Old
Semantic
HTML
Progressive Enhancement
HTML CSS JS
Content Presentation Behavior
Frills” s it Up”
it Sing”
“ No “D res “M ake
Progressive Enhancement
• Separation of Layers ( HTML / CSS / JS )
• Phased development
• Easier to define view model and flows
• And the “good stuff” too!
Hijax
• Term coined by Jeremy Keith
• Bulletproof Ajax
(http://bulletproofajax.com/)
• Pull in portion of page via Ajax when XHR is
supported
• Re-use same portion when a full page refresh
is required
• Requires UI Componentization
Composite View Pattern
• Separates “layout” of page from content
• Allows to plug in different modules into page
• Used in Apache Tiles
• Leverage in-house framework
• Try and gain as much re-use of JSP code
Componentization
Webapp Multi-Model
• Webflow definition
• Reusable components
• Form
RESTful URL
represents all the state necessary to reference a
particular resource
long-lived
backwards compatible
benefits?
usability
agility and
runtime isolation
Cache:
performance and
hardware savings
exponential growth
of network effects
diffusion of innovation
search engine
optimization
implementation?
Spring Webflow
versus
Spring MVC
one framework
to rule them all
Session scope obfuscated
public interface Action {
public Event execute(RequestContext context)
throws Exception;
}
public interface RequestContext {
public MutableAttributeMap getRequestScope();
public MutableAttributeMap getFlashScope();
public MutableAttributeMap getFlowScope();
public MutableAttributeMap getConversationScope();
…
}
requestContext.getExternalContext().getSessionMap()
RESTful stateless
flows
Deals Shop Book Care
(REST) (REST) (not REST) (mixed)
SWF-297 will also allow the input-mapper to also
record validation error messages, providing a better
alternative to the FormAction generally used for this
purpose now.
stateless flows,
continuations, and
form value history
no-cache
no-store
Spring source when
cacheSeconds == 0
/**
* Prevent the response from being cached.
* See www.mnot.net.cache docs.
*/
protected final void preventCaching(HttpServletResponse response) {
response.setHeader(HEADER_PRAGMA, \"No-cache\");
if (this.useExpiresHeader) {
// HTTP 1.0 header
response.setDateHeader(HEADER_EXPIRES, 1L);
}
if (this.useCacheControlHeader) {
// HTTP 1.1 header: \"no-cache\" is the standard value,
// \"no-store\" is necessary to prevent caching on FireFox
response.setHeader(HEADER_CACHE_CONTROL, \"no-cache\");
response.addHeader(HEADER_CACHE_CONTROL, \"no-store\");
}
}
locale persistence
<bean id=\"localeResolver\"
class=\"org.springframework.web.servlet.i18n.cookieLocaleResolver\"/>
OR
<bean id=\"localeResolver\"
class=\"org.springframework.web.servlet.i18n.sessionLocaleResolver\"/>
<spring:bind />
versus
<format />
register PropertyEditors
editors.put(Currency.class, new CurrencyEditor());
editors.put(Scalar.class, new ScalarEditor());
editors.put(DateTime.class, new JodaDateTimeEditor(true));
editors.put(YearMonthDay.class, new JodaYearMonthDayEditor(true));
editors.put(LocalDate.class, new JodaLocalDateEditor(true));
…
format tags for data types
format:dateTime
format:distance
format:distanceVector
format:interval
format:money
format:number
format:period
format:address
format:creditCard
format:emailAddress
format:location
format:name
format:phoneNumber
content access
• <format:message />
• supports tokens of custom type
Spring’s dependency on
JDK’s MessageFormat
open-source
performance
and
concurrency
good performance from
Spring &
Spring Web Flow
lock contention
\"http-8585-Processor39\" daemon prio=1 tid=0x081634c8 nid=0x65b7 waiting for moni
tor entry [0x9d41a000..0x9d41e0b0]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:114)
- waiting to lock <0xb0d85828> (a java.util.LinkedHashMap)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:187)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:156)
cached results of
Spring’s getBeansOfType
(circa March 2007 –
Juergen says it may be fixed in Spring v2.0.5)
SWF,
registerCustomEditors,
PropertyEditor issues
Other lock contentions
• JDK RMIClassLoaderSpi
• JDK java.security.*
• Tomcat
• 3000 tag invocations in search results page view
• Log4j
• ICU
ConcurrentHashMap
JDK 1.5
Emory backport for JDK 1.4
concurrency is hard
(see Rob Harrop’s “Practical Enterprise Concurrency”
presentation)
Scala: JVM language
Erlang-style message passing
Summary
• Project context
• Technology architecture
• Building UI forms
• Managing Flows
• Security and SSL
• Progressive Enhancement
• Composite View Pattern
• Componentization
• URLs and REST
• State management and HTTP browser caching headers
• Internationalization
• Performance and concurrency
• Summary
• Q&A
Slides & Contact
Slides:
http://markmeeker.com/events/tse2007
Emails:
Michael Alford - malford@orbitz.com
Mark Meeker - mmeeker@orbitz.com
We are Hiring:
http://www.orbitz.com/startmycareer
In this session, Michael Alford and Mark Meeker wil more
In this session, Michael Alford and Mark Meeker will describe the major business goals that drove the development of Orbitz Worldwide’s next generation online travel commerce platform, and how those goals were met with Spring and other technologies.
Last summer, Orbitz Worldwide released a new generation of its global technology platform with the goals of internationalization, white-label capability, and faster, streamlined development. Michael and Mark will describe the key challenges of this technology project and how those challenges were addressed, including the good, bad, and ugly of the Spring Framework and Spring Web Flow. less
0 comments
Post a comment