You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by Les Hazlewood <le...@hazlewood.com> on 2010/05/02 01:53:04 UTC

Your thoughts on INI config?

Hi folks,

I'm reaching out to see what people prefer for INI config, as it will
determine the final format for the upcoming 1.0 release:

Currently for a web-based app that uses INI configuration, you can
specify a [filters] and [urls] sections in addition to the other
standard sections ([main], [users] and [roles]).

Strictly speaking, both the [main] and [filters] sections do exactly
the same thing - create object graphs for Dependency Injection-based
configuration.   Since both sections are purely for configuring object
graphs, what do you prefer:

1) Just have a single [main] section that configures _all_ objects
(including filters)? or
2) Retain 2 sections for name-spacing.

If we go with a single section, all of the default filters ('authc',
'authcBasic', 'port', 'ssl', etc) would just be normal beans in the
[main] section for a webapp.  The only risk is that people could
accidentally overwrite these default filters if they name one of their
beans the same as a default filter - but I think the odds of that
happening in practice would be very low.

Thoughts?  Preferences?

Thanks!

Les

Re: Your thoughts on INI config?

Posted by Paul Merlin <pa...@nosphere.org>.
Hi Les,

> If we go with a single section, all of the default filters ('authc',
> 'authcBasic', 'port', 'ssl', etc) would just be normal beans in the
> [main] section for a webapp.  The only risk is that people could
> accidentally overwrite these default filters if they name one of their
> beans the same as a default filter - but I think the odds of that
> happening in practice would be very low.

I think that's true even with two sections. What if I override autcBasic with 
my own bean/filter in the [filter] section ?
I would not bother with this issue as long as it's documented.

More generally, I prefer simple things, that means simple code too. Both 
solutions will work for me and all I have to say is : got the simpler/smarter 
way according to the underlying code so that it's easy to understand/maintain.

my 2c

/P