You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mark Struberg (JIRA)" <de...@myfaces.apache.org> on 2011/05/08 12:50:03 UTC

[jira] [Created] (EXTCDI-174) Introduce @PropertyActivated or @ConfigActivated

Introduce @PropertyActivated or @ConfigActivated
------------------------------------------------

                 Key: EXTCDI-174
                 URL: https://issues.apache.org/jira/browse/EXTCDI-174
             Project: MyFaces CODI
          Issue Type: New Feature
          Components: Core
            Reporter: Mark Struberg
            Assignee: Mark Struberg


While at JAX, I got pretty often asked if there is a way to configure <alternatives> automatically via configuration. I pointed them to @ProjectStageActivated and this solved 60% of the problems.
But there are pretty often more complex scenarios where users like to switch between e.g. database vendors based on an external configuration.

This could e.g. be a normal java properties file and something like

{code}
@PropertyActivated("user.databyse", "mysql")
{code}

where the first parameter is the name and the 2nd is the value which must be set.

Please add further ideas for ways to change those configurations.

The actual implementation should be trivial as we have most of the work done already in ProjectStageActivationExtension.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (EXTCDI-174) Introduce @PropertyActivated or @ConfigActivated

Posted by "Mark Struberg (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/EXTCDI-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034834#comment-13034834 ] 

Mark Struberg commented on EXTCDI-174:
--------------------------------------

Interpreter is a neat idea, but most probably way to complicated for casual users. Also the name should really match with the already existing @ProjectStageActivated.

Btw, what do you mean with 'any expression' ?

> Introduce @PropertyActivated or @ConfigActivated
> ------------------------------------------------
>
>                 Key: EXTCDI-174
>                 URL: https://issues.apache.org/jira/browse/EXTCDI-174
>             Project: MyFaces CODI
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Mark Struberg
>            Assignee: Gerhard Petracek
>
> While at JAX, I got pretty often asked if there is a way to configure <alternatives> automatically via configuration. I pointed them to @ProjectStageActivated and this solved 60% of the problems.
> But there are pretty often more complex scenarios where users like to switch between e.g. database vendors based on an external configuration.
> This could e.g. be a normal java properties file and something like
> {code}
> @PropertyActivated("user.databyse", "mysql")
> {code}
> where the first parameter is the name and the 2nd is the value which must be set.
> Please add further ideas for ways to change those configurations.
> The actual implementation should be trivial as we have most of the work done already in ProjectStageActivationExtension.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (EXTCDI-174) Introduce @PropertyActivated or @ConfigActivated

Posted by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/EXTCDI-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034837#comment-13034837 ] 

Gerhard Petracek commented on EXTCDI-174:
-----------------------------------------

@PropertyActivated("user.database", "mysql")  is imo too error prone

"any expression" is a placeholder. by default i would suggest to support
@ActivatedOn("user.database==mysql;property2==value2")
later on we can extend the syntax e.g. to
@ActivatedOn("user.database==mysql || property2==value2")
that isn't possible with your @PropertyActivated suggestion.
by default it is as easy as your suggestion! and if an >advanced< user would like to extend the syntax s/he can simply do it by providing a custom interpreter implementation.
so we don't have to support all edge cases.

> Introduce @PropertyActivated or @ConfigActivated
> ------------------------------------------------
>
>                 Key: EXTCDI-174
>                 URL: https://issues.apache.org/jira/browse/EXTCDI-174
>             Project: MyFaces CODI
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Mark Struberg
>            Assignee: Gerhard Petracek
>
> While at JAX, I got pretty often asked if there is a way to configure <alternatives> automatically via configuration. I pointed them to @ProjectStageActivated and this solved 60% of the problems.
> But there are pretty often more complex scenarios where users like to switch between e.g. database vendors based on an external configuration.
> This could e.g. be a normal java properties file and something like
> {code}
> @PropertyActivated("user.databyse", "mysql")
> {code}
> where the first parameter is the name and the 2nd is the value which must be set.
> Please add further ideas for ways to change those configurations.
> The actual implementation should be trivial as we have most of the work done already in ProjectStageActivationExtension.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (EXTCDI-174) Introduce @PropertyActivated or @ConfigActivated

Posted by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/EXTCDI-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gerhard Petracek resolved EXTCDI-174.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.0

name of the annotation: @ExpressionActivated

supported expressions:

"key1==value1;key2!=value2"

and it's possible to mark required keys - e.g.:
"key2==*;key2!=value2"

> Introduce @PropertyActivated or @ConfigActivated
> ------------------------------------------------
>
>                 Key: EXTCDI-174
>                 URL: https://issues.apache.org/jira/browse/EXTCDI-174
>             Project: MyFaces CODI
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Mark Struberg
>            Assignee: Gerhard Petracek
>             Fix For: 1.0.0
>
>
> While at JAX, I got pretty often asked if there is a way to configure <alternatives> automatically via configuration. I pointed them to @ProjectStageActivated and this solved 60% of the problems.
> But there are pretty often more complex scenarios where users like to switch between e.g. database vendors based on an external configuration.
> This could e.g. be a normal java properties file and something like
> {code}
> @PropertyActivated("user.databyse", "mysql")
> {code}
> where the first parameter is the name and the 2nd is the value which must be set.
> Please add further ideas for ways to change those configurations.
> The actual implementation should be trivial as we have most of the work done already in ProjectStageActivationExtension.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (EXTCDI-174) Introduce @PropertyActivated or @ConfigActivated

Posted by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/EXTCDI-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030753#comment-13030753 ] 

Gerhard Petracek commented on EXTCDI-174:
-----------------------------------------

suggestion:

@ActivatedOn("any expression")

... by default it would be interpreted by ConfiguredValueInterpreter which delegates to the existing ConfiguredValueResolver (which also allows to add custom resolvers to the lookup chain).

as an alternative it would be possible to overrule the default interpreter via:

@ActivatedOn(value = "any expression", interpreter = CustomInterpreter.class)

-> per default it's simple but still very extensible

> Introduce @PropertyActivated or @ConfigActivated
> ------------------------------------------------
>
>                 Key: EXTCDI-174
>                 URL: https://issues.apache.org/jira/browse/EXTCDI-174
>             Project: MyFaces CODI
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>
> While at JAX, I got pretty often asked if there is a way to configure <alternatives> automatically via configuration. I pointed them to @ProjectStageActivated and this solved 60% of the problems.
> But there are pretty often more complex scenarios where users like to switch between e.g. database vendors based on an external configuration.
> This could e.g. be a normal java properties file and something like
> {code}
> @PropertyActivated("user.databyse", "mysql")
> {code}
> where the first parameter is the name and the 2nd is the value which must be set.
> Please add further ideas for ways to change those configurations.
> The actual implementation should be trivial as we have most of the work done already in ProjectStageActivationExtension.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira