NYC Seminar: Flex and WebWork
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:
Setting Parameters
- ParameterInterceptor
- StaticParameterInterceptor
- ChainingInterceptor
- ConversionErrorInterceptor
Defining Workflow
- DefaultWorkflowInterceptor
- PrepareInterceptor
- ServletConfigInterceptor
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).
- JavaScript support recently added for simple validators - nothing for expressions though (tough to do).
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.
Posted by Jason Carreira on April 04, 2004 at 03:33 PM MDT #
Posted by Paul Barry on April 04, 2004 at 04:11 PM MDT #
Paul - I don't know of that many Flash developers in the open source community. I have seen some <em>very good</em> Flash developer's names on some mailing lists lately, but I don't know that they'd be interested in this. I'm guessing that you have to have some proprietary Macromedia "secrets" in order to produce Flash bytecode from XML.
Posted by Matt Raible on April 04, 2004 at 04:19 PM MDT #
Posted by Thomas Risberg on April 04, 2004 at 04:31 PM MDT #
Posted by Patrick Lightbody on April 05, 2004 at 02:47 PM MDT #
p.s: am typing up the copious notes I took, which I'll post somewhere soon...
Posted by Sid Bala on April 05, 2004 at 09:43 PM MDT #
Posted by Matt Raible on April 06, 2004 at 03:20 AM MDT #
Posted by Edgar Dollin on September 02, 2004 at 02:09 PM MDT #