|
From: Chris E. <chr...@co...> - 2004-09-20 12:14:13
|
As my message stated, I think the import tag is a good feature and look
forward to using it. It should solve your 3 * 300 problem.
The part I take issue with is putting conditionals and other
meta-programming into an xml file. Keep in mind, xml and IoC are
intended to divorce configuration from the program. Turning a bean
configuration file into a bean "script" entirely defeats that purpose
because essentially you are putting the program into the configuration.
What is the perceived advantage of using
<condition test="foo"> <import name="sometimes.xml"> </condition>
instead of the java equivalent:
if (foo) {
context = new ClassPathXmlApplicationContext(new String[] {"main.xml",
"sometimes.xml"});
} else {
context = new ClassPathXmlApplicationContext(new String[] {"main.xml"});
}
All you would be doing is mixing your configuration with your program.
bryan wrote:
> Chris,
>
> You must really like keeping 3 * 300 line files in sync with each
> other when just
> 60/70 lines are different in each one .....
>
> I'm not talking about adding #ifdef and #define to the top of your java source
> files here !
>
> --b
>
>
>
> On Thu, 16 Sep 2004 14:46:45 -0400, Chris Eldredge
> <chr...@co...> wrote:
>
>>bryan wrote:
>>
>>
>>><beans>
>>><if value="test" equals="test">
>>> <import resource="myImport1.xml"/>
>>></if>
>>
>>This looks an awful lot like meta-programming to me. This becomes a
>>slippery slope. IMO, xml bean files should be for configuration, not
>>for scripting.
>>
>>The <import>, however, is something that I am looking forward to using
>>on my current project.
>>
>>Chris.
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
>>Project Admins to receive an Apple iPod Mini FREE for your judgement on
>>who ports your project to Linux PPC the best. Sponsored by IBM.
>>Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
>>_______________________________________________
>>Springframework-developer mailing list
>>Spr...@li...
>>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
|