|
From: <jue...@we...> - 2003-04-10 17:14:51
|
Hi everybody, I've noticed a naming issue within Spring, concerning parameters that = specify a path or URL to a file resource, as bean properties or method = parameters. In some places such parameters are resp. were called = "url"/"configUrl" etc, in other places "filename"... E.g.: = XmlWebApplicationContext, VelocityConfigurer, Log4jConfig, = PropertyResourceConfigurer, VelocityConfigurer. I've introduced such = parameters in some places and named them "path", according to the = parameter name used by the File(String) constructor and the = ServletContext.getResource(String) method. I've also renamed some of the = former "url" parameters to "path" when working on respective classes. Note that nearly all resource/file lookups work via = ApplicationContext.getResourceAsStream now. This method supports fully = qualified URLs, absolute file paths, and relative paths. The latter are = interpreted by the respective ApplicationContext implementation, = currently either relative to the working directory of the VM or relative = to the web app root directory. This is very powerful: For example, it = allows for using the same relative paths for both executing within a web = container and as JUnit test suite, provided that the latter uses the web = app root as working directory. So the parameter name "url" is not perfect, as the normal case is a = (relative) path - an actual URL is possible but rather uncommon. = "filename" isn't perfect either, as it doesn't really suggest a full = path (ending with a filename). That's why I chose "path" resp. = "configPath" or the like, but I'm not sure if this is optimal. What do you think? "url"? "filename"? "path"? "filePath"? "location"? = Other suggestions? We need a consistent naming strategy to avoid = confusion! After we've settled on one, I will look up all of those = parameters and adapt the naming accordingly. Juergen DI J=FCrgen H=F6ller Senior System Architect ______________________________________ werk3ATS - division systementwicklung part of werk3AT internetmedien oeg europaplatz 4 A - 4020 linz t. +43 (0) 732 71 65 29 502 f. +43 (0) 732 71 65 29 3 jue...@we... www.werk3at.com ______________________________________ werk3ATS - WIR ENTWICKELN ERFOLG |