You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Fritz Pröbstle (JIRA)" <de...@tapestry.apache.org> on 2008/06/27 15:14:45 UTC

[jira] Created: (TAPESTRY-2486) Make MessageBindingFactory,ComponentBindingFactory ... IOC-Services

Make MessageBindingFactory,ComponentBindingFactory ...  IOC-Services
--------------------------------------------------------------------

                 Key: TAPESTRY-2486
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2486
             Project: Tapestry
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.0.13
            Reporter: Fritz Pröbstle


My actual problem: 
 I would like to replace BindingConstants.MESSAGE with my own implemention.
 This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorate it etc. but this is not enough for me)

Solution: 
Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)

General:
This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java






-------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,

                                               @InjectService("PropBindingFactory")
                                               BindingFactory propBindingFactory,

                                               ObjectLocator locator)
    {
        configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
        configuration.add(BindingConstants.PROP, propBindingFactory);

        configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
        configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
        configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
        configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
        configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
        configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
        configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
        configuration.add(BindingConstants.NULLFIELDSTRATEGY,
                          locator.autobuild(NullFieldStrategyBindingFactory.class));
    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2486) Make MessageBindingFactory,ComponentBindingFactory ... IOC-Services

Posted by "Fritz Pröbstle (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fritz Pröbstle updated TAPESTRY-2486:
-------------------------------------

    Description: 
My actual problem: 
 I would like to replace BindingConstants.MESSAGE with my own implemention.
 This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorate it etc. but this is not enough for me)

General Solution : 
Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java

Another soultion:

Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).




-------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,

                                               @InjectService("PropBindingFactory")
                                               BindingFactory propBindingFactory,

                                               ObjectLocator locator)
    {
        configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
        configuration.add(BindingConstants.PROP, propBindingFactory);

        configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
        configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
        configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
        configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
        configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
        configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
        configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
        configuration.add(BindingConstants.NULLFIELDSTRATEGY,
                          locator.autobuild(NullFieldStrategyBindingFactory.class));
    }

  was:
My actual problem: 
 I would like to replace BindingConstants.MESSAGE with my own implemention.
 This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorate it etc. but this is not enough for me)

Solution: 
Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)

General:
This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java






-------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,

                                               @InjectService("PropBindingFactory")
                                               BindingFactory propBindingFactory,

                                               ObjectLocator locator)
    {
        configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
        configuration.add(BindingConstants.PROP, propBindingFactory);

        configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
        configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
        configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
        configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
        configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
        configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
        configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
        configuration.add(BindingConstants.NULLFIELDSTRATEGY,
                          locator.autobuild(NullFieldStrategyBindingFactory.class));
    }


> Make MessageBindingFactory,ComponentBindingFactory ...  IOC-Services
> --------------------------------------------------------------------
>
>                 Key: TAPESTRY-2486
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2486
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Fritz Pröbstle
>
> My actual problem: 
>  I would like to replace BindingConstants.MESSAGE with my own implemention.
>  This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorate it etc. but this is not enough for me)
> General Solution : 
> Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
> This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java
> Another soultion:
> Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).
> -------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
> public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,
>                                                @InjectService("PropBindingFactory")
>                                                BindingFactory propBindingFactory,
>                                                ObjectLocator locator)
>     {
>         configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
>         configuration.add(BindingConstants.PROP, propBindingFactory);
>         configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
>         configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
>         configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
>         configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
>         configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
>         configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
>         configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
>         configuration.add(BindingConstants.NULLFIELDSTRATEGY,
>                           locator.autobuild(NullFieldStrategyBindingFactory.class));
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2486) Refactor the non-trivial BindingFactory implementations into services

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAPESTRY-2486:
-------------------------------------------

    Summary: Refactor the non-trivial BindingFactory implementations into services  (was: Make MessageBindingFactory,ComponentBindingFactory ...  IOC-Services)

One way of accomplishing this would be to introduce a whole slew of marker annotations.  Instead, following the pattern of PropBindingFactory, which is injected by service id.  You can decorate a service to partially or fully replace it.

> Refactor the non-trivial BindingFactory implementations into services
> ---------------------------------------------------------------------
>
>                 Key: TAPESTRY-2486
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2486
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Fritz Pröbstle
>            Assignee: Howard M. Lewis Ship
>             Fix For: 5.0.15
>
>
> My actual problem: 
>  I would like to replace BindingConstants.MESSAGE with my own implemention.
>  This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorateComponentMessageSsource  etc. but this is not enough for me, because i need access to the ComponentResources  )
> General Solution : 
> Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
> This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java
> http://tapestry.apache.org/tapestry5/tapestry-ioc/overview.html says:
> "The problem with new is that it rigidly connects one implementation to another implementation. Let's follow a progression that reflects how a lot of projects get written. It will show that in the real world, new is not as simple as it first seems." :)
> Another soultion:
> Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).
> -------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
> public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,
>                                                @InjectService("PropBindingFactory")
>                                                BindingFactory propBindingFactory,
>                                                ObjectLocator locator)
>     {
>         configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
>         configuration.add(BindingConstants.PROP, propBindingFactory);
>         configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
>         configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
>         configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
>         configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
>         configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
>         configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
>         configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
>         configuration.add(BindingConstants.NULLFIELDSTRATEGY,
>                           locator.autobuild(NullFieldStrategyBindingFactory.class));
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-2486) Make MessageBindingFactory,ComponentBindingFactory ... IOC-Services

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623430#action_12623430 ] 

Howard M. Lewis Ship commented on TAPESTRY-2486:
------------------------------------------------

I think, ultimately, this will be addressed by adding an override() method to MappedConfiguration.

Since all the binding factories have the same interface, we would have to inject them by service id (like PropBindingFactory) or introduce marker annotations for them.  That still leaves us a little hard up to find a way to override the service (since it will be referenced by service id, or by marker interface), though you could decorate the original service.

> Make MessageBindingFactory,ComponentBindingFactory ...  IOC-Services
> --------------------------------------------------------------------
>
>                 Key: TAPESTRY-2486
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2486
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Fritz Pröbstle
>
> My actual problem: 
>  I would like to replace BindingConstants.MESSAGE with my own implemention.
>  This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorateComponentMessageSsource  etc. but this is not enough for me, because i need access to the ComponentResources  )
> General Solution : 
> Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
> This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java
> http://tapestry.apache.org/tapestry5/tapestry-ioc/overview.html says:
> "The problem with new is that it rigidly connects one implementation to another implementation. Let's follow a progression that reflects how a lot of projects get written. It will show that in the real world, new is not as simple as it first seems." :)
> Another soultion:
> Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).
> -------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
> public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,
>                                                @InjectService("PropBindingFactory")
>                                                BindingFactory propBindingFactory,
>                                                ObjectLocator locator)
>     {
>         configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
>         configuration.add(BindingConstants.PROP, propBindingFactory);
>         configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
>         configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
>         configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
>         configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
>         configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
>         configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
>         configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
>         configuration.add(BindingConstants.NULLFIELDSTRATEGY,
>                           locator.autobuild(NullFieldStrategyBindingFactory.class));
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2486) Make MessageBindingFactory,ComponentBindingFactory ... IOC-Services

Posted by "Fritz Pröbstle (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fritz Pröbstle updated TAPESTRY-2486:
-------------------------------------

    Description: 
My actual problem: 
 I would like to replace BindingConstants.MESSAGE with my own implemention.
 This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorateComponentMessageSsource  etc. but this is not enough for me, because i need access to the ComponentResources  )

General Solution : 
Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java


http://tapestry.apache.org/tapestry5/tapestry-ioc/overview.html says:
"The problem with new is that it rigidly connects one implementation to another implementation. Let's follow a progression that reflects how a lot of projects get written. It will show that in the real world, new is not as simple as it first seems." :)

Another soultion:

Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).




-------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,

                                               @InjectService("PropBindingFactory")
                                               BindingFactory propBindingFactory,

                                               ObjectLocator locator)
    {
        configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
        configuration.add(BindingConstants.PROP, propBindingFactory);

        configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
        configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
        configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
        configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
        configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
        configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
        configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
        configuration.add(BindingConstants.NULLFIELDSTRATEGY,
                          locator.autobuild(NullFieldStrategyBindingFactory.class));
    }

  was:
My actual problem: 
 I would like to replace BindingConstants.MESSAGE with my own implemention.
 This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorate it etc. but this is not enough for me)

General Solution : 
Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java


http://tapestry.apache.org/tapestry5/tapestry-ioc/overview.html says:
"The problem with new is that it rigidly connects one implementation to another implementation. Let's follow a progression that reflects how a lot of projects get written. It will show that in the real world, new is not as simple as it first seems." :)

Another soultion:

Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).




-------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,

                                               @InjectService("PropBindingFactory")
                                               BindingFactory propBindingFactory,

                                               ObjectLocator locator)
    {
        configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
        configuration.add(BindingConstants.PROP, propBindingFactory);

        configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
        configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
        configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
        configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
        configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
        configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
        configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
        configuration.add(BindingConstants.NULLFIELDSTRATEGY,
                          locator.autobuild(NullFieldStrategyBindingFactory.class));
    }


> Make MessageBindingFactory,ComponentBindingFactory ...  IOC-Services
> --------------------------------------------------------------------
>
>                 Key: TAPESTRY-2486
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2486
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Fritz Pröbstle
>
> My actual problem: 
>  I would like to replace BindingConstants.MESSAGE with my own implemention.
>  This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorateComponentMessageSsource  etc. but this is not enough for me, because i need access to the ComponentResources  )
> General Solution : 
> Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
> This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java
> http://tapestry.apache.org/tapestry5/tapestry-ioc/overview.html says:
> "The problem with new is that it rigidly connects one implementation to another implementation. Let's follow a progression that reflects how a lot of projects get written. It will show that in the real world, new is not as simple as it first seems." :)
> Another soultion:
> Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).
> -------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
> public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,
>                                                @InjectService("PropBindingFactory")
>                                                BindingFactory propBindingFactory,
>                                                ObjectLocator locator)
>     {
>         configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
>         configuration.add(BindingConstants.PROP, propBindingFactory);
>         configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
>         configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
>         configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
>         configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
>         configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
>         configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
>         configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
>         configuration.add(BindingConstants.NULLFIELDSTRATEGY,
>                           locator.autobuild(NullFieldStrategyBindingFactory.class));
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2486) Make MessageBindingFactory,ComponentBindingFactory ... IOC-Services

Posted by "Fritz Pröbstle (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fritz Pröbstle updated TAPESTRY-2486:
-------------------------------------

    Description: 
My actual problem: 
 I would like to replace BindingConstants.MESSAGE with my own implemention.
 This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorate it etc. but this is not enough for me)

General Solution : 
Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java


http://tapestry.apache.org/tapestry5/tapestry-ioc/overview.html says:
"The problem with new is that it rigidly connects one implementation to another implementation. Let's follow a progression that reflects how a lot of projects get written. It will show that in the real world, new is not as simple as it first seems." :)

Another soultion:

Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).




-------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,

                                               @InjectService("PropBindingFactory")
                                               BindingFactory propBindingFactory,

                                               ObjectLocator locator)
    {
        configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
        configuration.add(BindingConstants.PROP, propBindingFactory);

        configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
        configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
        configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
        configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
        configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
        configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
        configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
        configuration.add(BindingConstants.NULLFIELDSTRATEGY,
                          locator.autobuild(NullFieldStrategyBindingFactory.class));
    }

  was:
My actual problem: 
 I would like to replace BindingConstants.MESSAGE with my own implemention.
 This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorate it etc. but this is not enough for me)

General Solution : 
Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java

Another soultion:

Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).




-------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,

                                               @InjectService("PropBindingFactory")
                                               BindingFactory propBindingFactory,

                                               ObjectLocator locator)
    {
        configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
        configuration.add(BindingConstants.PROP, propBindingFactory);

        configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
        configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
        configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
        configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
        configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
        configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
        configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
        configuration.add(BindingConstants.NULLFIELDSTRATEGY,
                          locator.autobuild(NullFieldStrategyBindingFactory.class));
    }


> Make MessageBindingFactory,ComponentBindingFactory ...  IOC-Services
> --------------------------------------------------------------------
>
>                 Key: TAPESTRY-2486
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2486
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Fritz Pröbstle
>
> My actual problem: 
>  I would like to replace BindingConstants.MESSAGE with my own implemention.
>  This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorate it etc. but this is not enough for me)
> General Solution : 
> Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
> This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java
> http://tapestry.apache.org/tapestry5/tapestry-ioc/overview.html says:
> "The problem with new is that it rigidly connects one implementation to another implementation. Let's follow a progression that reflects how a lot of projects get written. It will show that in the real world, new is not as simple as it first seems." :)
> Another soultion:
> Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).
> -------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
> public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,
>                                                @InjectService("PropBindingFactory")
>                                                BindingFactory propBindingFactory,
>                                                ObjectLocator locator)
>     {
>         configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
>         configuration.add(BindingConstants.PROP, propBindingFactory);
>         configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
>         configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
>         configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
>         configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
>         configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
>         configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
>         configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
>         configuration.add(BindingConstants.NULLFIELDSTRATEGY,
>                           locator.autobuild(NullFieldStrategyBindingFactory.class));
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Closed: (TAPESTRY-2486) Refactor the non-trivial BindingFactory implementations into services

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-2486.
------------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0.15

> Refactor the non-trivial BindingFactory implementations into services
> ---------------------------------------------------------------------
>
>                 Key: TAPESTRY-2486
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2486
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Fritz Pröbstle
>            Assignee: Howard M. Lewis Ship
>             Fix For: 5.0.15
>
>
> My actual problem: 
>  I would like to replace BindingConstants.MESSAGE with my own implemention.
>  This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorateComponentMessageSsource  etc. but this is not enough for me, because i need access to the ComponentResources  )
> General Solution : 
> Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
> This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java
> http://tapestry.apache.org/tapestry5/tapestry-ioc/overview.html says:
> "The problem with new is that it rigidly connects one implementation to another implementation. Let's follow a progression that reflects how a lot of projects get written. It will show that in the real world, new is not as simple as it first seems." :)
> Another soultion:
> Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).
> -------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
> public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,
>                                                @InjectService("PropBindingFactory")
>                                                BindingFactory propBindingFactory,
>                                                ObjectLocator locator)
>     {
>         configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
>         configuration.add(BindingConstants.PROP, propBindingFactory);
>         configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
>         configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
>         configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
>         configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
>         configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
>         configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
>         configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
>         configuration.add(BindingConstants.NULLFIELDSTRATEGY,
>                           locator.autobuild(NullFieldStrategyBindingFactory.class));
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Assigned: (TAPESTRY-2486) Make MessageBindingFactory,ComponentBindingFactory ... IOC-Services

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAPESTRY-2486:
----------------------------------------------

    Assignee: Howard M. Lewis Ship

> Make MessageBindingFactory,ComponentBindingFactory ...  IOC-Services
> --------------------------------------------------------------------
>
>                 Key: TAPESTRY-2486
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2486
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Fritz Pröbstle
>            Assignee: Howard M. Lewis Ship
>
> My actual problem: 
>  I would like to replace BindingConstants.MESSAGE with my own implemention.
>  This is currently not possible because MessageBindingFactory is not IOC Service. ( I could decorateComponentMessageSsource  etc. but this is not enough for me, because i need access to the ComponentResources  )
> General Solution : 
> Make MessageBindingFactory  a IOC service then I could override with contributeAliasOverrides(...)
> This may also make sence for other objects , which are currently instatiated with "new" in TapestryModule.java
> http://tapestry.apache.org/tapestry5/tapestry-ioc/overview.html says:
> "The problem with new is that it rigidly connects one implementation to another implementation. Let's follow a progression that reflects how a lot of projects get written. It will show that in the real world, new is not as simple as it first seems." :)
> Another soultion:
> Allow MappedConfiguration.add to overwrite serviceId's ( with warning ).
> -------------------------------------- instantiotion of MessageBindingFactory with "new" -----------------------------
> public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,
>                                                @InjectService("PropBindingFactory")
>                                                BindingFactory propBindingFactory,
>                                                ObjectLocator locator)
>     {
>         configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
>         configuration.add(BindingConstants.PROP, propBindingFactory);
>         configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
>         configuration.add(BindingConstants.MESSAGE, new MessageBindingFactory());
>         configuration.add(BindingConstants.VALIDATE, locator.autobuild(ValidateBindingFactory.class));
>         configuration.add(BindingConstants.TRANSLATE, locator.autobuild(TranslateBindingFactory.class));
>         configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
>         configuration.add(BindingConstants.ASSET, locator.autobuild(AssetBindingFactory.class));
>         configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
>         configuration.add(BindingConstants.NULLFIELDSTRATEGY,
>                           locator.autobuild(NullFieldStrategyBindingFactory.class));
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org