On 2/16/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > > Martin, going OT just a bit... how are you using CoR now? Are you simply > implementing your Actions as Commands instead, or are you actually > composing your Actions out of a number of Commands?
The latter. I have no Action classes at all, and each action mapping corresponds to a chain. There are some chains, as you describe below, that degenerate to a single command, but most don't. I also have at least one case where I have a special-purpose catalog that I look up (from within a command) based on certain request characteristics, and invoke a chain from that catalog to handle part of the request. This is all AJAX-driven. No JSP, no Tiles, etc. Or, are you simply > altering the RP chain and still using Actions (or maybe making them > Commands technically part of the RP chain)? Yes, I'm modifying the RP chain in both my 1.3 and 1.2+chain apps, primarily for stuff that needs to be centralised, such as authorisation, error / exception handling, and some specialised cancellation handling. I ask because I've dene two apps now where I used Struts 1.2.6 and my own > CoR implementation from JWP, and the way I did it was to have a single > Action that fires off a chain. But, in 95% of the cases, the "chain" was > really just a single Command, so arguably there wasn't much benefit. In my 1.2+chain app, which does use JSP & Tiles, a very common pattern is a chain that has a command to save some state, followed by one or more commands to load data for subsequent presentation. This allows me to reconfigure the user's path through the app just by reconfiguring the chains and forwards, without having to touch any Java code. My 1.3 app has something similar in some ways, but it gets too complicated to try to explain here. -- Martin Cooper I think CoR is a great pattern, I've used it with great success, but I'm > not as sure how it fits into Struts *outside* the composable RP, which is > a *perfect* application for it. Just curious how you (and/or others) are > already using it. > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > AIM: fzammetti > Yahoo: fzammetti > MSN: [EMAIL PROTECTED] > > On Thu, February 16, 2006 4:20 pm, Martin Cooper said: > > On 2/16/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > >> > >> On 2/16/06, Martin Cooper <[EMAIL PROTECTED]> wrote: > >> > Amongst other things, 1.3 brings a clean way of implementing your > >> action > >> > mappings as chains of commands instead of using actions. That alone > >> makes it > >> > stand out from 1.2. I like it a lot. At the same time, you can still > >> use > >> > actions if you want to, which makes it a great platform ifor when you > >> need > >> > to be able to reuse some of the work you've put in on 1.2 or earlier > >> > applications. > >> > >> Backward compatibility is great. Considering chain of commands, do you > >> really think that someone who supports a legacy app, will get to > >> refactor it with chain? (Unless this someone already did it a year ago > >> using nightly build ;-) ). I mean, how the learning curve for 1.3 CoR > >> compares with learning curve for WebWork and interceptors? Therefore I > >> have doubts that CoR will be used widely, outside of early adopters' > >> circle. But I am glad that it finally is about to make it officially. > > > > > > The chain stuff is actually available in 1.2.x as well, as an add-on > > package, so it's not exactly new news. It's been available for 2-1/2 > years > > now. It's just that it's not as cleanly integrated in 1.2 as it is in > 1.3. > > > > I was actually talking about forwards compatibility, rather than > backwards > > compatibility. If I'm building a new app using 1.3, and I realise that I > > need some of the same functionality that I built into an earlier 1.2app, > > I > > can, assuming I structured my actions properly, simply pick up my > existing > > actions and drop them into my 1.3 app, even if the rest of the app is > > built > > using chains. > > > > But even for someone who's working on a legacy app, moving to 1.3 will > > allow > > them to use chains for new parts of the application if they want to, > > leaving > > the rest using actions. The learning hump for using chains is very, very > > low. > > > > So, how about clean docs/samples on using CoR? (I asked about this in > >> another thread). What about up-to-date MailReader? > > > > > > Volunteers are always welcome. ;-) > > > > -- > > Martin Cooper > > > > > > To my shame, I have > >> not looked into CoR since my last surge of interest in September last > >> year. Frankly, I am pretty happy with 1.2.x (or maybe I am just lazy). > >> > >> The docs/samples will be the major factor for adoption among Struts > >> 1.2.x public. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >