> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Jason van Zyl
>
> .....
>
> Ok, now I remeber why I did it as well. Looking at
> 
> 1)
> resource.loader = file
> resource.loader = classpath
> 
> resource.loader.file.<prop> = <value>
> 
> versus
> 
> 2)
> resource.loader = file
> resource.loader = classpath
> 
> file.resource.loader.<prop> = <value>
> 
> If I want to grab just the resource loaders then I will use
> 
> Configuration. subset("resource.loader") I'm going to get all the config
> stuff for the resource loaders too, I don't want that.
> 
> Where in 2) performing  Configuration.subset("resource.loader")
> will simply give me back the two configuration entries I expect.
> Then I can use those values ('file', 'classpath') to retrieve the
> values for each individual loader.
> 
> So I think we have to keep it in the form
> 
> <id>.resource.loader.<prop> = value
> 
> In order to make it easy to parse internally, I think it reads more
> like a sentence that way too.
> 
> Is this ok?

Well, you should always check the output of 
    Configuration.subset("resource.loader")
to be sure that all returned nodes have just a "resource.loader" key and 
not a "resource.loader.something" like key.


IMO, the clear advantage of the ordering you defend is a slight gain in 
average performance during initialization. But I think that we all agree 
that initialization performance is not such an important issue.


The other advantage - reading more like a sentence - is not so clear for
me. Most guys reading/writing these files are programmers used to coded
stuff (instead of English teachers or so). 

Taking myself as an example, it takes me much less effort to check 
code/configurations when identifiers in its text are aligned and a 
logical group of identifiers has the same prefix - that way it is easier
to follow the "different" part of the identifier.

All this to say that my personal preference is still with 1).
=:o)


Have fun,
Paulo Gaspar

Reply via email to