myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <>
Subject [jira] Commented: (MYFACES-2774) Remove MARK_DELETED attribute from the component
Date Thu, 15 Jul 2010 06:58:50 GMT


Leonardo Uribe commented on MYFACES-2774:

Just some comments about how to enhance this patch. I see this part:

    public void addComponentLevelMarkedForDeletion()
        if (_componentsMarkedForDeletion == null)
            _componentsMarkedForDeletion = new Stack<Map<UIComponent, Boolean>>();
        _componentsMarkedForDeletion.push(new HashMap<UIComponent, Boolean>());

By default it creates a HashMap of initial capacity of 16 and load factor of 0.75. But in
this case, addComponentLevelMarkedForDeletion is called from ComponentSupport.markForDeletion
and in that place we know the number of elements we need to add (current component + # children
+ # facets). So, we can take advantage of that information and configure the HashMap initial
capacity / load factor properly.

I don't know which one (Map<UIComponent, Boolean> vs Stack<Map<UIComponent, Boolean>
>)  will be a better structure for deal with this enhancement from the "memory" and "speed"
perspective. Why create a HashMap each time I traverse a component ? What happen if the component
has no children/facets ? Maybe I'm going too far but note this code is critical for performance,
so it is worth to check this stuff carefully. I suggest a Stack<Map<UIComponent, Boolean>
>, but why not an ArrayList<Map<UIComponent, Boolean> >?. 

> Remove MARK_DELETED attribute from the component
> ------------------------------------------------
>                 Key: MYFACES-2774
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General, JSR-314
>    Affects Versions: 2.0.0
>            Reporter: Marius Petoi
>            Priority: Minor
>         Attachments: markDeletedFaceletContext.patch, markDeletedFaceletContext2.patch
> The ComponentSupport.MARK_DELETED attribute is used only inside one request. It doesn't
need to be saved in the state. It should be removed from the attributes of the component.
Instead a list of components marked for deletion should be included in the FaceletContext.

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

View raw message