You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2012/05/31 12:07:23 UTC

[jira] [Created] (MYFACES-3556) [perf] call markInitialState() inside vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions()

Leonardo Uribe created MYFACES-3556:
---------------------------------------

             Summary: [perf] call markInitialState() inside vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions()
                 Key: MYFACES-3556
                 URL: https://issues.apache.org/jira/browse/MYFACES-3556
             Project: MyFaces Core
          Issue Type: Improvement
          Components: JSR-314
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


To ensure compatibility with the RI, In JSF 2.1, markInitialState() call is done after the component tree is built with a visitTree() call. That works fine, but in JSF 2.0 or when you have a dynamic content inside a page, it is necessary to activate markInitialState() call through facelet algorithm as described in MYFACES-3451.

The concept works very good, but I notice a side effect in vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions(). Since markInitialState() call goes from leaf to the root, and these methods traverse the tree to apply changes in child components, all changes done by these two methods are stored into the "delta" part of the state. 

Since vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions() are called in build view time and only when the composite component is created, it is safe to check if pss is used in the view and markInitialState() algorithm has been activated, to call markInitialState() over the child components (the call for the top level component is done in the outside). Maybe it will be some extra calls to markInitialState() for the same component, but it is worth to do it, because this call is very fast, and the effect is get a zero (or almost zero) state size overhead for composite components.

Additionally, it is better in this case to use these classes:

org.apache.myfaces.view.facelets.tag.jsf.PartialMethodExpressionActionListener;
org.apache.myfaces.view.facelets.tag.jsf.PartialMethodExpressionValidator;
org.apache.myfaces.view.facelets.tag.jsf.PartialMethodExpressionValueChangeListener;

to ensure no state is stored in these cases. Note this issue is the solution to the problem described in MYFACES-3551

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MYFACES-3556) [perf] call markInitialState() inside vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions()

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

Leonardo Uribe resolved MYFACES-3556.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.8
                   2.0.14
    
> [perf] call markInitialState() inside vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions()
> -------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-3556
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3556
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.14, 2.1.8
>
>
> To ensure compatibility with the RI, In JSF 2.1, markInitialState() call is done after the component tree is built with a visitTree() call. That works fine, but in JSF 2.0 or when you have a dynamic content inside a page, it is necessary to activate markInitialState() call through facelet algorithm as described in MYFACES-3451.
> The concept works very good, but I notice a side effect in vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions(). Since markInitialState() call goes from leaf to the root, and these methods traverse the tree to apply changes in child components, all changes done by these two methods are stored into the "delta" part of the state. 
> Since vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions() are called in build view time and only when the composite component is created, it is safe to check if pss is used in the view and markInitialState() algorithm has been activated, to call markInitialState() over the child components (the call for the top level component is done in the outside). Maybe it will be some extra calls to markInitialState() for the same component, but it is worth to do it, because this call is very fast, and the effect is get a zero (or almost zero) state size overhead for composite components.
> Additionally, it is better in this case to use these classes:
> org.apache.myfaces.view.facelets.tag.jsf.PartialMethodExpressionActionListener;
> org.apache.myfaces.view.facelets.tag.jsf.PartialMethodExpressionValidator;
> org.apache.myfaces.view.facelets.tag.jsf.PartialMethodExpressionValueChangeListener;
> to ensure no state is stored in these cases. Note this issue is the solution to the problem described in MYFACES-3551

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira