I like it. Maybe change 'ordinal' to precedence. And maybe spread out the built-in configurations a bit so it could be possible for someone to slip in some configuration in-between them. With essentially 0-99 still being lower than default, there's plenty of room. So maybe something like:
webbeans-impl/ openwebbeans.properties with 'configuration.ordinal=10' webbeans-web/ openwebbeans.properties with 'configuration.ordinal=20' webbeans-jsf/ openwebbeans.properties with 'configuration.ordinal=30' -David On Aug 16, 2010, at 2:09 PM, Mark Struberg wrote: > Hi! > > I was on vacation over the weekend and had an idea about how to improve our > configuration mechanism. I hacked the idea while flying back from Cologne and > now all is working again. > > The change is actually not really big, I just like to get rid of our > openwebbeans-*.properties and replace them with the following mechanism: > > There are still multiple property files for the same configuration, thus > still > allowing 'overriding' a configuration. But instead of manually looking for > defined 'extensions' I just define a 'configuration.ordinal' inside the > property > > thus I define > > webbeans-impl/ openwebbeans.properties with 'configuration.ordinal=10' > webbeans-web/ openwebbeans.properties with 'configuration.ordinal=11' > webbeans-jsf/ openwebbeans.properties with 'configuration.ordinal=12' > > If a properties file doesn't define 'configuration.ordinal' then a value of > 100 > is assumed. > > > The algorithm is easy: > .) load all properties you can find with the name > .) sort them via configuration.ordinal in ascending order > .) overload them as we do already, but instead of some defined names we now > just > use the sorted list of properties. > > WDYT? > > It's all ready to get checked in :) > > LieGrue, > strub > > > >
