PDA

View Full Version : Validating the whole xml configuration


Thibaut
09-21-2005, 03:43 PM
Hi,

I'd like to know if it's possible to validate the spring configuration file before actually running the application: I'm thinking about adding a validation stage in an automated build system.

Is there some built-in functionality in spring ioc to achieve this ? (Ideally I'd like to detect things such as type name typo error, but also to detect if say a constructor has 3 parameters in the code but is only invoked with 2 parameters in the spring configuration).

any thoughts welcome

Thibaut
--
[blog] http://www.dotnetguru2.org/tbarrere

Rick Evans
09-21-2005, 07:46 PM
Hi Thibaut

Nope, there is no support out of the box for this (validating a Spring.NET configuration file before actually running the application).

There is some talk... but talk is all that it is at the moment... of creating a tooling SPI that will allow tool vendors to better control and interact with a Spring / Spring.NET container. Spring.NET's current approach is fail-fast, in that as soon as an error is encountered (in an object definition) it (the Spring.NET container) crashes immediately. This is good from an application point of view, but bad for tool vendors who would (one assumes) like to see all of the errors at once (similar to the way a compiler reports more than one error at a time).

I daresay the multitude of integration tests that one runs prior to deploying one's application will fully exercise the Spring.NET configuration file(s) in one's application. Mmm, thats not the most helpful reply is it, but well... watch this space I guess.

Ciao
Rick