On Tue, 30 Jul 2002, Paul Kelly wrote:

> Date: Tue, 30 Jul 2002 17:05:43 +1000
> From: Paul Kelly <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: 'Struts Developers List' <[EMAIL PROTECTED]>
> Subject: XML Config: viewpoints
>
> I'm looking for some constructive thoughts on use and/or over-use of xml
> configuration within struts. The idea has been in my head for a while after
> blowing up application's numerous times with that small typo in a config
> file!
>

IMHO, it makes little or no difference that we're using XML syntax here.
The key issue is that, in order to achieve the low coupling, *you* (the
developer) are going to have to do things like define the mapping between
action paths and the corresponding classes.  There is not any way that
Struts can infer this.  Doing it in an XML file, in a properties file, or
any other way that you have to type the names gives you equal chances to
screw it up.

> Some thoughts...
> - Is it such a good idea to pour much of fundamental application design into
> xml files?
> - Should config files be confined to things such as database parameters?
> - Tendency for xml config to become a mini programming language in itself
> - Lacks type safety, syntax checking (ide / compiler)
> - Ultimately gets parsed back into application config classes
>
> The struts-config provides low-coupling, but could this be achieved more
> easily and efficiently another way e.g. static initialisation of core
> classes?
>
> XML gives language independence - but struts is basically a homogenous java
> environment, so I've lost sight of why I am designing my config in XML.
>
> With the struts-config, you can easily swap new classes, and change
> application parameters without recompiling, but this may actually hinder the
> real burden of ensuring application integrity, regression testing etc.
>
> I'm interested in different views on this to sway me one way or the other...
>

The important benefits that using XML brings to Struts:

* The data is naturally organized in a hierarchical manner,
  which is utilized to good effect when it matches the nature
  of the things being configured.  This is miserably difficult
  in a "flat" file format like properties files.

* The data format is amenable to being generated by tools
  instead of people.  Things like Struts Console already do the
  grunt work of getting the XML syntax right -- extending this
  concept to automatically scanning a JAR file and building you
  a select box of all the classes that implement Action (so that
  you can point and click instead of type a class name) is the
  next logical step.

> Regards
> Paul Kelly
>

Craig



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

Reply via email to