You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Ludwig (JIRA)" <ji...@apache.org> on 2010/09/27 13:36:32 UTC

[jira] Created: (WICKET-3082) Introduce IComponentOnInitializeListener for cross-cutting concerns

Introduce IComponentOnInitializeListener for cross-cutting concerns
-------------------------------------------------------------------

                 Key: WICKET-3082
                 URL: https://issues.apache.org/jira/browse/WICKET-3082
             Project: Wicket
          Issue Type: New Feature
          Components: wicket
    Affects Versions: 1.4.12
            Reporter: Sven Ludwig


I suggest the introduction of org.apache.wicket.application.IComponentOnInitializeListener for onInitialize-cross-cutting-concerns on Components. Such a listener should be called for a Component right after the onInitialize Method of the Component has been executed. I hope this has not been discussed already. I have not found any such issues.

A use case: For implementing cross-cutting concerns in Wicket, there are several Listeners that are called at various points during the life-cycle of a Component. Such listeners as in Wicket 1.4.12 are IComponentInstantiationListener, IComponentOnBeforeRenderListener, IComponentOnAfterRenderListener. However, for adding a Validator to all IValidateable Components of a certain type, non of the existing Listeners is really a good option. IComponentInstantiationListener cannot successfully add a Validator in general, because such a listener is executed before the member variable validators in the FormComponent class is actually set to null during instantiation. IComponentOnAfterRenderListener will obviously be to late. And with IComponentOnBeforeRenderListener, the validator itself would (without extra coding) be instantiated and added in each request, which would be an unnecessary overhead.


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


[jira] Assigned: (WICKET-3082) Introduce IComponentOnInitializeListener for cross-cutting concerns

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-3082:
-------------------------------------

    Assignee: Igor Vaynberg

> Introduce IComponentOnInitializeListener for cross-cutting concerns
> -------------------------------------------------------------------
>
>                 Key: WICKET-3082
>                 URL: https://issues.apache.org/jira/browse/WICKET-3082
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.4.12
>            Reporter: Sven Ludwig
>            Assignee: Igor Vaynberg
>
> I suggest the introduction of org.apache.wicket.application.IComponentOnInitializeListener for onInitialize-cross-cutting-concerns on Components. Such a listener should be called for a Component right after the onInitialize Method of the Component has been executed. I hope this has not been discussed already. I have not found any such issues.
> A use case: For implementing cross-cutting concerns in Wicket, there are several Listeners that are called at various points during the life-cycle of a Component. Such listeners as in Wicket 1.4.12 are IComponentInstantiationListener, IComponentOnBeforeRenderListener, IComponentOnAfterRenderListener. However, for adding a Validator to all IValidateable Components of a certain type, non of the existing Listeners is really a good option. IComponentInstantiationListener cannot successfully add a Validator in general, because such a listener is executed before the member variable validators in the FormComponent class is actually set to null during instantiation. IComponentOnAfterRenderListener will obviously be to late. And with IComponentOnBeforeRenderListener, the validator itself would (without extra coding) be instantiated and added in each request, which would be an unnecessary overhead.

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


[jira] Commented: (WICKET-3082) Introduce IComponentOnInitializeListener for cross-cutting concerns

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915279#action_12915279 ] 

Sven Ludwig commented on WICKET-3082:
-------------------------------------

Thanks for the hint. I just found this pattern being used at http://code.google.com/p/wicket-jsr303-validators . However, I still vote for the clean and unambiguous IComponentOnInitializeListener to be introduced.

> Introduce IComponentOnInitializeListener for cross-cutting concerns
> -------------------------------------------------------------------
>
>                 Key: WICKET-3082
>                 URL: https://issues.apache.org/jira/browse/WICKET-3082
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.4.12
>            Reporter: Sven Ludwig
>
> I suggest the introduction of org.apache.wicket.application.IComponentOnInitializeListener for onInitialize-cross-cutting-concerns on Components. Such a listener should be called for a Component right after the onInitialize Method of the Component has been executed. I hope this has not been discussed already. I have not found any such issues.
> A use case: For implementing cross-cutting concerns in Wicket, there are several Listeners that are called at various points during the life-cycle of a Component. Such listeners as in Wicket 1.4.12 are IComponentInstantiationListener, IComponentOnBeforeRenderListener, IComponentOnAfterRenderListener. However, for adding a Validator to all IValidateable Components of a certain type, non of the existing Listeners is really a good option. IComponentInstantiationListener cannot successfully add a Validator in general, because such a listener is executed before the member variable validators in the FormComponent class is actually set to null during instantiation. IComponentOnAfterRenderListener will obviously be to late. And with IComponentOnBeforeRenderListener, the validator itself would (without extra coding) be instantiated and added in each request, which would be an unnecessary overhead.

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


[jira] Commented: (WICKET-3082) Introduce IComponentOnInitializeListener for cross-cutting concerns

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915898#action_12915898 ] 

Hudson commented on WICKET-3082:
--------------------------------

Integrated in Apache Wicket 1.5.x #369 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/369/])
    Issue: WICKET-3082


> Introduce IComponentOnInitializeListener for cross-cutting concerns
> -------------------------------------------------------------------
>
>                 Key: WICKET-3082
>                 URL: https://issues.apache.org/jira/browse/WICKET-3082
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.4.12
>            Reporter: Sven Ludwig
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.13, 1.5-M3
>
>
> I suggest the introduction of org.apache.wicket.application.IComponentOnInitializeListener for onInitialize-cross-cutting-concerns on Components. Such a listener should be called for a Component right after the onInitialize Method of the Component has been executed. I hope this has not been discussed already. I have not found any such issues.
> A use case: For implementing cross-cutting concerns in Wicket, there are several Listeners that are called at various points during the life-cycle of a Component. Such listeners as in Wicket 1.4.12 are IComponentInstantiationListener, IComponentOnBeforeRenderListener, IComponentOnAfterRenderListener. However, for adding a Validator to all IValidateable Components of a certain type, non of the existing Listeners is really a good option. IComponentInstantiationListener cannot successfully add a Validator in general, because such a listener is executed before the member variable validators in the FormComponent class is actually set to null during instantiation. IComponentOnAfterRenderListener will obviously be to late. And with IComponentOnBeforeRenderListener, the validator itself would (without extra coding) be instantiated and added in each request, which would be an unnecessary overhead.

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


[jira] Resolved: (WICKET-3082) Introduce IComponentOnInitializeListener for cross-cutting concerns

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-3082.
-----------------------------------

    Fix Version/s: 1.4.13
                   1.5-M3
       Resolution: Fixed

see IComponentInitializationListener

> Introduce IComponentOnInitializeListener for cross-cutting concerns
> -------------------------------------------------------------------
>
>                 Key: WICKET-3082
>                 URL: https://issues.apache.org/jira/browse/WICKET-3082
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.4.12
>            Reporter: Sven Ludwig
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.13, 1.5-M3
>
>
> I suggest the introduction of org.apache.wicket.application.IComponentOnInitializeListener for onInitialize-cross-cutting-concerns on Components. Such a listener should be called for a Component right after the onInitialize Method of the Component has been executed. I hope this has not been discussed already. I have not found any such issues.
> A use case: For implementing cross-cutting concerns in Wicket, there are several Listeners that are called at various points during the life-cycle of a Component. Such listeners as in Wicket 1.4.12 are IComponentInstantiationListener, IComponentOnBeforeRenderListener, IComponentOnAfterRenderListener. However, for adding a Validator to all IValidateable Components of a certain type, non of the existing Listeners is really a good option. IComponentInstantiationListener cannot successfully add a Validator in general, because such a listener is executed before the member variable validators in the FormComponent class is actually set to null during instantiation. IComponentOnAfterRenderListener will obviously be to late. And with IComponentOnBeforeRenderListener, the validator itself would (without extra coding) be instantiated and added in each request, which would be an unnecessary overhead.

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


[jira] Commented: (WICKET-3082) Introduce IComponentOnInitializeListener for cross-cutting concerns

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915278#action_12915278 ] 

Martin Grigorov commented on WICKET-3082:
-----------------------------------------

You can use IComponentOnBeforeRenderListener for this. Just check 'if (!component#hasBeenRendered())' before adding your validator.

> Introduce IComponentOnInitializeListener for cross-cutting concerns
> -------------------------------------------------------------------
>
>                 Key: WICKET-3082
>                 URL: https://issues.apache.org/jira/browse/WICKET-3082
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.4.12
>            Reporter: Sven Ludwig
>
> I suggest the introduction of org.apache.wicket.application.IComponentOnInitializeListener for onInitialize-cross-cutting-concerns on Components. Such a listener should be called for a Component right after the onInitialize Method of the Component has been executed. I hope this has not been discussed already. I have not found any such issues.
> A use case: For implementing cross-cutting concerns in Wicket, there are several Listeners that are called at various points during the life-cycle of a Component. Such listeners as in Wicket 1.4.12 are IComponentInstantiationListener, IComponentOnBeforeRenderListener, IComponentOnAfterRenderListener. However, for adding a Validator to all IValidateable Components of a certain type, non of the existing Listeners is really a good option. IComponentInstantiationListener cannot successfully add a Validator in general, because such a listener is executed before the member variable validators in the FormComponent class is actually set to null during instantiation. IComponentOnAfterRenderListener will obviously be to late. And with IComponentOnBeforeRenderListener, the validator itself would (without extra coding) be instantiated and added in each request, which would be an unnecessary overhead.

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