Christophe talked about Flex, it's architecture and built the data grid for the Flex pet store in a matter of minutes. After seeing this presentation, I definitely think Flex is wicked cool. It's too bad that it's price tag is $6K/CPU. However, Vic is probably right - this stuff should be the next generation of webapps. I'd order the developer CD but it sounds like something I'd play around with and never use. It looks so easy to use that I'm willing to bet I can wait until a client demands it - then learn it in a matter of days - or even hours. I did end up asking Christophe about unit testing these Flash UIs. They're working on it, but nothing exists yet.
Now Jason is up - the last session of the day.
What is WebWork 2.0?
- The 2nd generation of WebWork
- A web MVC Framework
- a wrapper on top of a generic Command Pattern implementation (XWork)
- A small but powerful tag library
XWork is where Jason spends most of his time. XWork is a generic command pattern implementation. Actions are command objects in XWork. XWork adds advanced features.
- Interceptors: setting parameters, workflow, etc.
- Results: includes one for chaing to another Action
- Simple IoC container
- Powerful expressional language (OGNL)
- Flexible type conversion
- Metadata driven validation framework
What does WebWork add?
- Adapter for Http request/response
- Integration of Session / Application Scopes
- ServletDispatcher translates HTTP Requests into Action execution
- Request parameters passed to Action Results
- Supported view technologies: Velocity, Freemarker, XSLT Jasper Reports, JSP
Action is a simple interface with an execute method. ActionSupport is a useful base class.
I gotta say - one of my favorite things about WebWork is the fact that all its UI tags are built using Velocity. This means that you (the developer) have full control over what HTML is generated from the JSP tags.
Interceptors have been nicknamed "Domain AOP." Interceptors allow custom code into the call stack and much of the WebWork "magic" happens with Interceptors. WebWork has a number of built-in interceptors:
Preventing duplicate posts
- 2 types of token interceptors
Interceptors can be grouped into named Interceptor Stacks (i.e. defaultStack, validationWorkflowStack).
2 types of actions possible: Model-Driven vs. Field Driven (merging of Action and ActionForm). ModelDriven Interface -
public Object getModel(). Porperties of the model will be available as simple properties - "user.name" becomes "name". To use, you have to add ModelInterceptor to your WW config file.
OGNL (Object Graph Navigation Language). An expression and binding language for getting and setting properties of Java objects. Normally the same expression is used for getters and setters.
XWork Validation Framework
- XML based. Validation file in the same package as the class. Defines one field validator and the error messages to add if it fails.
- Bundled validators - supports required, range, email, url and OGNL Expressions (very powerful).
Doh! Jason's demo didn't work. I did a lot of demos in my preso so I couldn't help but say "shoulda used a Mac!" These PowerBooks might be a bit slow for development, but they're definitely nice for this traveling salesman thing.
This is where you get your money's worth: All the speakers and attendees comparing frameworks, talking about their problems and trying to figure out a better way.