You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Mark Struberg <st...@yahoo.de> on 2010/08/16 23:09:39 UTC

[DISCusS] openwebbeans.configuration new

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


      

Re: [DISCusS] openwebbeans.configuration new

Posted by Gerhard <ge...@gmail.com>.
+1

regards,
gerhard

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2010/8/17 Gurkan Erdogdu <gu...@yahoo.com>

> Hello Mark;
>
> Great idea!
>
> Thanks
>
>
> --Gurkan
>
>
>
>
> ________________________________
> From: Mark Struberg <st...@yahoo.de>
> To: dev@openwebbeans.apache.org
> Sent: Tue, August 17, 2010 12:09:39 AM
> Subject: [DISCusS] openwebbeans.configuration  new
>
> 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
>
>

Re: [DISCusS] openwebbeans.configuration new

Posted by Gurkan Erdogdu <gu...@yahoo.com>.
Hello Mark;

Great idea!

Thanks


--Gurkan




________________________________
From: Mark Struberg <st...@yahoo.de>
To: dev@openwebbeans.apache.org
Sent: Tue, August 17, 2010 12:09:39 AM
Subject: [DISCusS] openwebbeans.configuration  new

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


Re: [DISCusS] openwebbeans.configuration new

Posted by Mark Struberg <st...@yahoo.de>.
Txs David, feel free to tweak :)

Doesn't 'precedence' sound like as if the most important configs would get the 
lowest numbers? I'm not a native english speaker though, so I'll use whatever 
you all together suggest ;)

I started our default config with 10 but we can easily move this to 1 as well. 
Because if e.g. geronimo would tweak something, it would most probably be 
somewhere around 50 or so. The ordinal of our internal configs is not so 
important imo. Our former openwebbeans-default.properties must be the base with 
the lowest number, and most of the plugin configs do have their own set of 
configurations. 


So from our own jars I think there are only 4 layers:
*) core
*) resources
*) web/jpa/jms
*) vendor & implementation specific parts (e.g. openebj, jsf12)

But most important for me is the ability to easily provide a configuration 
default for the app server integration (e.g. with configuration.ordinal=50). The 
ability to use a single base configuration e.g. in a backend-service.jar in an 
EAR/lib + override those settings in each WAR if needed.


LieGrue,
strub



----- Original Message ----
> From: David Blevins <da...@visi.com>
> To: dev@openwebbeans.apache.org
> Sent: Tue, August 17, 2010 8:37:08 PM
> Subject: Re: [DISCusS] openwebbeans.configuration new
> 
> 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
> > 
> > 
> > 
> > 
> 
> 


      

Re: [DISCusS] openwebbeans.configuration new

Posted by David Blevins <da...@visi.com>.
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
> 
> 
> 
>