Without the config file, I'm not exactly sure how you'd tie your own code
into Struts.  Struts, together with your action servlets, is basically the
controller in MVC, so it seems to me that you'd end up re-implementing most
of Struts by yourself if you got rid of the config file.

Some advantages to the config file, as I see them:
* It allows Struts to take care of form input and validation automatically.
* Non-programmers don't have to concern themselves with the class names of
your action servlets.
* Forwards are very useful, imo.  You can conceivably have a global forward
named "error" that forwards to your default error-handling page, then later
on you can add local forwards named "error" that handle errors for a
specific action servlet with no changes in your code.
* It lowers the barrier of entry into MVC design, since, as I said
previously, Struts already does most of the work of the controller.
* Though it's not necessarily any easier for a non-programmer to manipulate
the config xml than the source code, it is much easier for a programmer to
write an application that manipulates the config file for them than it would
be to write one that manipulates your source code.

Disadvantages I can think of offhand:
* It introduces a set of runtime errors that, depending on your controller
implementation, could be caught by the compiler.
* In the current release version of Struts, the config file doesn't lend
itself very well to multi-page forms.  Fortunately, this deficiency is fixed
in the nightly build, as well as in the release version if you install the
workflow extension listed on the resources page.

-----Original Message-----
From: Michael Hale [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, January 05, 2002 9:40 AM
To: Struts Mailing List
Subject: why have another xml file?


Does anyone else find that the struts xml config file is just a pain?  Why
not put this information in the code.  It is not like a non-programmar is
going to know enough to modify an xml file and change the app around.

Just my 2 cents.


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

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

Reply via email to