why have another xml file?

2002-01-05 Thread Michael Hale

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:   
For additional commands, e-mail: 




RE: why have another xml file?

2002-01-05 Thread Taylor Cowan

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:[EMAIL PROTECTED]]
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:
<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]>




RE: why have another xml file?

2002-01-05 Thread Justin Piper

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]>




Re: why have another xml file?

2002-01-05 Thread Pete Carapetyan

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:   
For additional commands, e-mail: 




Re: why have another xml file?

2002-01-05 Thread Ted Husted

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:   
> For additional commands, e-mail: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: why have another xml file?

2002-01-09 Thread Jeff Canna


At the risk of being flamed..

I've been very interested in struts for quite a while now. Actually tried
using it for a project that I was recently working on. After many days of
fighting with the struts-config.xml file the team decided to implement our
own ModelII framework.

We had this implemented in about a half a day. (Keep in mind we did not do
anything with validation or internationalization.) We did not use anything
like a config file . Essentially we used reflection to create the action
class before calling into it. Making this work in this way has greatly speed
up our development. It was very clear when the submit had the wrong class
name in it.

The answers I saw to the original post were in the vane that everyone else
is using XML so why shouldn't we. I haven't seen a good technical reason for
doing this.

I would be VERY interested to understand the need for this file. In seems it
introduces unnecessary complexity into an application and the same
information can be retrieved from a more straight forward mechanism.

Jeff Canna


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: why have another xml file?

2002-01-09 Thread Ted Husted

What would be most helpful is an example of your alternative approach. 

The struts-config.xml itself is not really required, but is perceived as
a convenient way to initialize and configure the objects used by the
framework. 

Once the objects are initalized, the struts-config is not referenced, so
loading them from an alternate method is certainly feasible. (And it
sounds like you have proven this in practice.)

The purpose of the struts-config is to create the lists of ActionForms,
ActionForwards, and ActionMappings. 

Many applications have many more ActionMappings than classes, so it can
become a very long list. 

An XML format is perceived as the simplest way to create this list. I
doubt that this perception could be easily changed without a working
prototype.

I know that in my work, I have made significant changes and additons to
applications just by changing the struts-config, without touching a
single Java class. Personally, I perceive that as a Good Thing, but your
mileage may vary. 

-- 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/


Jeff Canna wrote:
> 
> At the risk of being flamed..
> 
> I've been very interested in struts for quite a while now. Actually tried
> using it for a project that I was recently working on. After many days of
> fighting with the struts-config.xml file the team decided to implement our
> own ModelII framework.
> 
> We had this implemented in about a half a day. (Keep in mind we did not do
> anything with validation or internationalization.) We did not use anything
> like a config file . Essentially we used reflection to create the action
> class before calling into it. Making this work in this way has greatly speed
> up our development. It was very clear when the submit had the wrong class
> name in it.
> 
> The answers I saw to the original post were in the vane that everyone else
> is using XML so why shouldn't we. I haven't seen a good technical reason for
> doing this.
> 
> I would be VERY interested to understand the need for this file. In seems it
> introduces unnecessary complexity into an application and the same
> information can be retrieved from a more straight forward mechanism.
> 
> Jeff Canna
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: why have another xml file?

2002-01-10 Thread Keith Bacon

here's my 2 bobs worth
One aim is to be able to deploy apps & change optional characteristics without 
recompiling. Big
software is full of config files & programs use symbolic names which are mapped to 
real external
entities in config files. This becomes more desirable the bigger the system. A change 
to config
info is cheaper, easier & lower risk than a change that requires recompiling. This is 
a general
rule to be always followed because developers never quite know what the future will - 
always
follow the rule & you can't go wrong.
In this regard struts is brilliant!

I've read that Web applications maintenance costs have been far too high compared to 
other types
of systems. Things like struts help in this regard. All praise to it's developers (but 
please can
Erich & I have better error messages!).
Thanks, Keith.



--- Ted Husted <[EMAIL PROTECTED]> wrote:
> What would be most helpful is an example of your alternative approach. 
> 
> The struts-config.xml itself is not really required, but is perceived as
> a convenient way to initialize and configure the objects used by the
> framework. 
> 
> Once the objects are initalized, the struts-config is not referenced, so
> loading them from an alternate method is certainly feasible. (And it
> sounds like you have proven this in practice.)
> 
> The purpose of the struts-config is to create the lists of ActionForms,
> ActionForwards, and ActionMappings. 
> 
> Many applications have many more ActionMappings than classes, so it can
> become a very long list. 
> 
> An XML format is perceived as the simplest way to create this list. I
> doubt that this perception could be easily changed without a working
> prototype.
> 
> I know that in my work, I have made significant changes and additons to
> applications just by changing the struts-config, without touching a
> single Java class. Personally, I perceive that as a Good Thing, but your
> mileage may vary. 
> 
> -- 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/
> 
> 
> Jeff Canna wrote:
> > 
> > At the risk of being flamed..
> > 
> > I've been very interested in struts for quite a while now. Actually tried
> > using it for a project that I was recently working on. After many days of
> > fighting with the struts-config.xml file the team decided to implement our
> > own ModelII framework.
> > 
> > We had this implemented in about a half a day. (Keep in mind we did not do
> > anything with validation or internationalization.) We did not use anything
> > like a config file . Essentially we used reflection to create the action
> > class before calling into it. Making this work in this way has greatly speed
> > up our development. It was very clear when the submit had the wrong class
> > name in it.
> > 
> > The answers I saw to the original post were in the vane that everyone else
> > is using XML so why shouldn't we. I haven't seen a good technical reason for
> > doing this.
> > 
> > I would be VERY interested to understand the need for this file. In seems it
> > introduces unnecessary complexity into an application and the same
> > information can be retrieved from a more straight forward mechanism.
> > 
> > Jeff Canna
> > 
> > --
> > To unsubscribe, e-mail:   
> > For additional commands, e-mail: 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: