You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Hale <mh...@rolemodelsoft.com> on 2002/01/05 16:39:48 UTC
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: why have another xml file?
Posted by Ted Husted <hu...@apache.org>.
Very well put, Peter.
The Struts configuration does actually create a database of sorts, that
represents the model for the Controller.
You could write Java classes that did the same thing, but they would be
much harder to write and maintain.
The Struts configuration is a script that the digester uses to create a
web of objects (or database), so that we do not have to maintain these
as Java source code.
This makes for a much more agile development environmen. In that you can
make changes to Struts config, and reload it at runtime, without
recompiling anything with Ant. Not unlike JSPs.
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Building Java web applications with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/
Pete Carapetyan wrote:
>
> This question bordelines on flame bait.
>
> It is like asking, "Why use a database, when we could just hardcode all the
> values in the files we are using?"
>
> The xml file is little more than a database for configuration values. Like all
> databases, it makes it a bit tidier to keep it in one neat, organized structure
> rather than spread out all over the place in the places that use the data.
>
> --
> Pete Carapetyan
> http://webAppWriter.com
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: why have another xml file?
Posted by Pete Carapetyan <pe...@datafundamentals.com>.
This question bordelines on flame bait.
It is like asking, "Why use a database, when we could just hardcode all the
values in the files we are using?"
The xml file is little more than a database for configuration values. Like all
databases, it makes it a bit tidier to keep it in one neat, organized structure
rather than spread out all over the place in the places that use the data.
--
Pete Carapetyan
http://webAppWriter.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: why have another xml file?
Posted by Taylor Cowan <t....@usa.net>.
It's an irritation at first until you become familiar with it, then its no
problem. What I see in various applications is a move to place more and
more information in XML files. For example, all the XML files described in
the J2EE spec. I mean, if you don't like XML descriptors, you've obviously
chosen the wrong development platform. web.xml is way more painful than the
struts config xml. You could place that information in code as well, but in
J2EE the roles, resources, connection pools and other items are all defined
in XML.
Consider JSP's and servlets. Any JSP can be duplicated with a servlet ( and
it actually becomes one anyway). Everything is code, but that has been
shown to be more difficult evidenced by the number of people using JSP's or
template engines as opposed to straight servlets. Now the paradigm is to
use tags mixed with HTML. Not much different than XML. As a matter of fact
tags are XML. So no matter where you turn you're already using XML
everywhere in a struts app.
J2EE's use of XML isn't just a one time advantage. You can use that as an
example of how you can get config info out of your application code and into
XML. You can even describe business logic, user interfaces, and workflow as
XML.
Taylor
-----Original Message-----
From: Michael Hale [mailto:mhale@rolemodelsoft.com]
Sent: Saturday, January 05, 2002 10: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:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>