Tak Yoshida wrote the following on 11/7/2004 7:05 PM:

I would like to introduce Page Driven development, OzStruts, to all Struts 
developers,
which makes Struts application more clean and maintainable.

Ok, dang, I must be missing something. I've been using Struts now for over four years developing all kinds of applications with it and have only found a few minor annoyances with it. You'll have to dummy this whole OzStruts thing down to show me what it really gains me. To be fair , I've only briefly looked over the OzStruts PDF, but I believe, just following my simple approach below, the majority of Struts use cases are met:


1) I have a DispatchAction that handles related functionality to a particular task at hand... related CRUD stuff... ie. getEmployees, updateEmployee, getEmployee etc. There is also a setUp method that usually doesn't do anything more than call the prep() method in step 3 below.

2) I don't bother having validation take place automatically. It's cleaner and easier to maintain by just calling form.validate() from you particular dispatch method. (You can still use the validation.xml stuff.)

3) Each DispatchActon usually has a simple prep(..) or setup() method that you can call to prep your form with any request objects it needs to have handy (any Lists for drop downs etc). (If validation fails, call it before returning to the form).

I guess some could argue that the Action class shouldn't have to take care of preping the view, but to me it's not that big of a deal and on the flip side you get to stay with the concept of just using Struts 'as is' out of the box so it's easy for any new developer to follow. I'm all for tweaking and modifying where necessary, but the above steps seem to cover 98% of the simple flow of web applications. There are exceptions of course, but they aren't that difficult to work around.

--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to