magpiebrain

Sam Newman's site, a Consultant at ThoughtWorks

Thanks to a comment from Jason Carreira made on my “post(Thoughts on an MVC framework for Swing)”:http://www.magpiebrain.com/archives/000178.html, I was pointed in the direction of XWork. XWork is a view agnostic command pattern framework, originally developed as the core of “WebWork 2”:http://wiki.opensymphony.com/space/WebWork2.
XWork is a little different to my design – here actions are not the thing that does something, they signify the intention to do something. Additionally actions can be intercepted by Interceptors before being run.

Components are not fully de-coupled from the framework itself – when writing your own Action for example you have to subclass the Action interface. There is also no concept of a view as such within XWork – this is left to specific uses of XWork (such as WebWork). In general XWork seems close to my suggested design, but not as flexible. It would probably benefit from being reworked to use a more fully featured IoC engine internally (such as Spring or Pico) which would then allow coupling to the framework to be removed. That said its highly unlikely I would ever be able to develop something as fully featured as XWork on my own. I’ll have a play tonight and see whats involved in getting a simple Swing interface to use XWork – that will be a proper test of just how flexible it can be.

Advertisements

2 Responses to “XWork for Swing?”

  1. Sam Newman

    The integration examples for both Spring and Pico cover integration with WebWork 1.4, but not 2 or with XWork itself. I think I’ll run before I can walk – get Swing using WorkX (assuming I can get it built – the build seems a little groked right now) as a command framework interfacing with a Spring powered IoC Layer. Then I’ll look at interating Spring into XWork proper. I would hazard a guess that XWork’s existing IoC capabilities (it is after all a form of IoC frameowkr itself) could be completely replaced behind the scenes with either Pico or Spring. I guess Pico would be the favorite given the size, but Spring is more mature, has better support and better docs…

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Basic HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS

%d bloggers like this: