You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Jason Porter <li...@gmail.com> on 2012/03/25 07:19:43 UTC

ProjectStageProducers before ProjectStage?

As it currently exists in both v0.1 and v0.2 if there is a custom
ProjectStagProducer that value will be used for the project stage instead
any ProjectStage listed in another config. Example:

custom producer sets stage to MyProjectStage

LocalJndi, SystemProperty, EnvironmentProperty or even an
apache-deltaspike.properties file say project stage should be something
else.

The final value for project stage will be MyProjectStage.

Is this really how we want it? I could certainly see admins and developers
thinking it should not. You also can't unset a value with some other config
earlier in the chain.

My current thoughts are that we should first look for a ProjectStage value,
then a ProjectStageProducer if a ProjectStage is not found. If neither of
those are set, then set the project stage to Production as we are currently
now doing it.

WDYT?

-- 
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate
Author of Seam Catch - Next Generation Java Exception Handling

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu

Re: ProjectStageProducers before ProjectStage?

Posted by Jason Porter <li...@gmail.com>.
On Sun, Mar 25, 2012 at 04:02, Mark Struberg <st...@yahoo.de> wrote:

> +1 Imo custom ProjectStageProducers are blurp in any case!
>
> We provide one central ProjectStageProducer which reflects exactly what is
> configured and should pickup all those settings from JNDI, config, etc as
> you mentioned. Having any other producer for ProjectStages is not useful.
>
> Also don't over-use the ProjectStage. This sounds more like you are trying
> to solve orthogonal concerns. I'll give you an example about how we did it.
>

The idea I had is during the development the apache-deltaspike.properties
file works fine. Most developers probably don't want to mess with adding
JNDI entries or changing system properties. Having it all in the project
works great. When the project moves to an environment the developer doesn't
control such as a staging or production environment the admin will probably
want to set things up in the server (either via system / environment
properties or JNDI). Naturally the admin would expect anything setup in the
server or environment to trump the setting in the archive's properties
file.

This works as is today, UNLESS there is a custom ProjectStageProducer. If
we want the extra producers to trump the default stuff we should probably
mark them in the documentation as advanced features and extensively
document what happens when they're used and how they override everything
that's out of the box.


> In our case we created an additional ConfigService which returns the
> proper values not only depending on the ProjectStage, but also depending
> e.g. on the configured Database (MySQL, PostgreSQL, Oracle).
>

This was in CODI?


>
> LieGrue,
> strub
>
>
> ----- Original Message -----
> > From: Gerhard Petracek <ge...@gmail.com>
> > To: deltaspike-dev@incubator.apache.org
> > Cc:
> > Sent: Sunday, March 25, 2012 11:03 AM
> > Subject: Re: ProjectStageProducers before ProjectStage?
> >
> > hi jason,
> >
> > right now we (should) have:
> > - you don't need a custom project-stage producer to provide a custom
> > project-stage
> > - for configuring a custom project-stage (value) just configure the
> custom
> > value.
> > - for using a custom config format,... just provide a custom
> > implementation of ConfigSource.
> > - a custom project-stage producer is just a last resort to
> > customize/replace the default behaviour (in this area).
> > - there is only one (custom) producer and not a chain of custom
> producers.
> > - a custom producer has to implement the whole logic on its own.
> >
> > regards,
> > gerhard
> >
> >
> >
> > 2012/3/25 Jason Porter <li...@gmail.com>
> >
> >>  As it currently exists in both v0.1 and v0.2 if there is a custom
> >>  ProjectStagProducer that value will be used for the project stage
> instead
> >>  any ProjectStage listed in another config. Example:
> >>
> >>  custom producer sets stage to MyProjectStage
> >>
> >>  LocalJndi, SystemProperty, EnvironmentProperty or even an
> >>  apache-deltaspike.properties file say project stage should be something
> >>  else.
> >>
> >>  The final value for project stage will be MyProjectStage.
> >>
> >>  Is this really how we want it? I could certainly see admins and
> developers
> >>  thinking it should not. You also can't unset a value with some other
> > config
> >>  earlier in the chain.
> >>
> >>  My current thoughts are that we should first look for a ProjectStage
> value,
> >>  then a ProjectStageProducer if a ProjectStage is not found. If neither
> of
> >>  those are set, then set the project stage to Production as we are
> currently
> >>  now doing it.
> >>
> >>  WDYT?
> >>
> >>  --
> >>  Jason Porter
> >>  http://lightguard-jp.blogspot.com
> >>  http://twitter.com/lightguardjp
> >>
> >>  Software Engineer
> >>  Open Source Advocate
> >>  Author of Seam Catch - Next Generation Java Exception Handling
> >>
> >>  PGP key id: 926CCFF5
> >>  PGP key available at: keyserver.net, pgp.mit.edu
> >>
> >
>



-- 
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate
Author of Seam Catch - Next Generation Java Exception Handling

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu

Re: ProjectStageProducers before ProjectStage?

Posted by Mark Struberg <st...@yahoo.de>.
+1 Imo custom ProjectStageProducers are blurp in any case!

We provide one central ProjectStageProducer which reflects exactly what is configured and should pickup all those settings from JNDI, config, etc as you mentioned. Having any other producer for ProjectStages is not useful.

Also don't over-use the ProjectStage. This sounds more like you are trying to solve orthogonal concerns. I'll give you an example about how we did it. 

In our case we created an additional ConfigService which returns the proper values not only depending on the ProjectStage, but also depending e.g. on the configured Database (MySQL, PostgreSQL, Oracle).


LieGrue,
strub


----- Original Message -----
> From: Gerhard Petracek <ge...@gmail.com>
> To: deltaspike-dev@incubator.apache.org
> Cc: 
> Sent: Sunday, March 25, 2012 11:03 AM
> Subject: Re: ProjectStageProducers before ProjectStage?
> 
> hi jason,
> 
> right now we (should) have:
> - you don't need a custom project-stage producer to provide a custom
> project-stage
> - for configuring a custom project-stage (value) just configure the custom
> value.
> - for using a custom config format,... just provide a custom
> implementation of ConfigSource.
> - a custom project-stage producer is just a last resort to
> customize/replace the default behaviour (in this area).
> - there is only one (custom) producer and not a chain of custom producers.
> - a custom producer has to implement the whole logic on its own.
> 
> regards,
> gerhard
> 
> 
> 
> 2012/3/25 Jason Porter <li...@gmail.com>
> 
>>  As it currently exists in both v0.1 and v0.2 if there is a custom
>>  ProjectStagProducer that value will be used for the project stage instead
>>  any ProjectStage listed in another config. Example:
>> 
>>  custom producer sets stage to MyProjectStage
>> 
>>  LocalJndi, SystemProperty, EnvironmentProperty or even an
>>  apache-deltaspike.properties file say project stage should be something
>>  else.
>> 
>>  The final value for project stage will be MyProjectStage.
>> 
>>  Is this really how we want it? I could certainly see admins and developers
>>  thinking it should not. You also can't unset a value with some other 
> config
>>  earlier in the chain.
>> 
>>  My current thoughts are that we should first look for a ProjectStage value,
>>  then a ProjectStageProducer if a ProjectStage is not found. If neither of
>>  those are set, then set the project stage to Production as we are currently
>>  now doing it.
>> 
>>  WDYT?
>> 
>>  --
>>  Jason Porter
>>  http://lightguard-jp.blogspot.com
>>  http://twitter.com/lightguardjp
>> 
>>  Software Engineer
>>  Open Source Advocate
>>  Author of Seam Catch - Next Generation Java Exception Handling
>> 
>>  PGP key id: 926CCFF5
>>  PGP key available at: keyserver.net, pgp.mit.edu
>> 
> 

Re: ProjectStageProducers before ProjectStage?

Posted by Jason Porter <li...@gmail.com>.
On Sun, Mar 25, 2012 at 03:03, Gerhard Petracek
<ge...@gmail.com>wrote:

> hi jason,
>
> right now we (should) have:
>  - you don't need a custom project-stage producer to provide a custom
> project-stage
>

Haven't tried that one, just looking at the code


>  - for configuring a custom project-stage (value) just configure the custom
> value.
>  - for using a custom config format,... just provide a custom
> implementation of ConfigSource.
>

I have not seen this work, I had to created the ConfigSourceProducer as
well.


>  - a custom project-stage producer is just a last resort to
> customize/replace the default behaviour (in this area).
>  - there is only one (custom) producer and not a chain of custom producers.
>  - a custom producer has to implement the whole logic on its own.
>
> regards,
> gerhard
>
>
>
> 2012/3/25 Jason Porter <li...@gmail.com>
>
> > As it currently exists in both v0.1 and v0.2 if there is a custom
> > ProjectStagProducer that value will be used for the project stage instead
> > any ProjectStage listed in another config. Example:
> >
> > custom producer sets stage to MyProjectStage
> >
> > LocalJndi, SystemProperty, EnvironmentProperty or even an
> > apache-deltaspike.properties file say project stage should be something
> > else.
> >
> > The final value for project stage will be MyProjectStage.
> >
> > Is this really how we want it? I could certainly see admins and
> developers
> > thinking it should not. You also can't unset a value with some other
> config
> > earlier in the chain.
> >
> > My current thoughts are that we should first look for a ProjectStage
> value,
> > then a ProjectStageProducer if a ProjectStage is not found. If neither of
> > those are set, then set the project stage to Production as we are
> currently
> > now doing it.
> >
> > WDYT?
> >
> > --
> > Jason Porter
> > http://lightguard-jp.blogspot.com
> > http://twitter.com/lightguardjp
> >
> > Software Engineer
> > Open Source Advocate
> > Author of Seam Catch - Next Generation Java Exception Handling
> >
> > PGP key id: 926CCFF5
> > PGP key available at: keyserver.net, pgp.mit.edu
> >
>



-- 
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate
Author of Seam Catch - Next Generation Java Exception Handling

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu

Re: ProjectStageProducers before ProjectStage?

Posted by Gerhard Petracek <ge...@gmail.com>.
hi jason,

right now we (should) have:
 - you don't need a custom project-stage producer to provide a custom
project-stage
 - for configuring a custom project-stage (value) just configure the custom
value.
 - for using a custom config format,... just provide a custom
implementation of ConfigSource.
 - a custom project-stage producer is just a last resort to
customize/replace the default behaviour (in this area).
 - there is only one (custom) producer and not a chain of custom producers.
 - a custom producer has to implement the whole logic on its own.

regards,
gerhard



2012/3/25 Jason Porter <li...@gmail.com>

> As it currently exists in both v0.1 and v0.2 if there is a custom
> ProjectStagProducer that value will be used for the project stage instead
> any ProjectStage listed in another config. Example:
>
> custom producer sets stage to MyProjectStage
>
> LocalJndi, SystemProperty, EnvironmentProperty or even an
> apache-deltaspike.properties file say project stage should be something
> else.
>
> The final value for project stage will be MyProjectStage.
>
> Is this really how we want it? I could certainly see admins and developers
> thinking it should not. You also can't unset a value with some other config
> earlier in the chain.
>
> My current thoughts are that we should first look for a ProjectStage value,
> then a ProjectStageProducer if a ProjectStage is not found. If neither of
> those are set, then set the project stage to Production as we are currently
> now doing it.
>
> WDYT?
>
> --
> Jason Porter
> http://lightguard-jp.blogspot.com
> http://twitter.com/lightguardjp
>
> Software Engineer
> Open Source Advocate
> Author of Seam Catch - Next Generation Java Exception Handling
>
> PGP key id: 926CCFF5
> PGP key available at: keyserver.net, pgp.mit.edu
>