cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <>
Subject Re: Restructuring directory structure[was [Vote] Block artifact directory structure]
Date Tue, 07 Nov 2006 07:32:04 GMT
Leszek Gawron wrote:
> 2. Some components (like CocoonOverridePropertyConfigurer, which has 
> already been fixed) use the Settings object but happily fallback to 
> default mode when settings object is not available. The result of such 
> situation is that a bean that has been incorrectly dependence injected 
> uses other running mode than you might think. Beans using running mode 
> should simply throw if they cannot determine one.
> I am probably picky about this but hey - you're the ones I've learnt my 
> values from :)
:) Actually I'm not sure - now, the reason why I wrote the code like
this is for unit testing. You can write a unit test for the configurer
which does not need to setup any dependency.
But the more I think about it, the more I agree with you: we should
raise an exception when the settings object is not set rather than
falling back to some default value. This comes with the cost to setup a
settings object (or a mock) for testing, but makes the code safer.


Carsten Ziegeler - Chief Architect

View raw message