You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org> on 2007/09/16 17:42:32 UTC
[jira] Created: (TRINIDAD-712) Do not generate final properties
with the maven-faces-plugin
Do not generate final properties with the maven-faces-plugin
------------------------------------------------------------
Key: TRINIDAD-712
URL: https://issues.apache.org/jira/browse/TRINIDAD-712
Project: MyFaces Trinidad
Issue Type: Wish
Components: Plugins
Affects Versions: 1.0.2-plugins
Environment: maven-faces-plugin version 1.0.2 from the maven repository
Reporter: Andrew Robinson
It would be extremely beneficial to not have property methods generated as final by the maven-faces-plugin.
IMO, final should be reserved for constants and only on methods with rare exceptions and good reasons.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-712) Do not generate final properties
with the maven-faces-plugin
Posted by "Adam Winer (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527920 ]
Adam Winer commented on TRINIDAD-712:
-------------------------------------
Simon, Andrew: the methods are not final for performance; there would be no significant boost. The only reason to ever make classes and methods final is for design reasons.
The methods are final ENTIRELY because of the FacesBean architecture. The generated JSP tags write directly to the FacesBean, bypassing the set methods. The renderers read directly from the FacesBean, bypassing the get methods. Overriding the getters and setters would therefore be completely pointless in the current architecture. We could debate (on dev@myfaces!) whether the JSP tags and renderers should do what they do, but it would be very bad to let people think they can override these accessors, when in fact they cannot.
> Do not generate final properties with the maven-faces-plugin
> ------------------------------------------------------------
>
> Key: TRINIDAD-712
> URL: https://issues.apache.org/jira/browse/TRINIDAD-712
> Project: MyFaces Trinidad
> Issue Type: Wish
> Components: Plugins
> Affects Versions: 1.0.2-plugins
> Environment: maven-faces-plugin version 1.0.2 from the maven repository
> Reporter: Andrew Robinson
> Assignee: Adam Winer
>
> It would be extremely beneficial to not have property methods generated as final by the maven-faces-plugin.
> IMO, final should be reserved for constants and only on methods with rare exceptions and good reasons.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-712) Do not generate final properties
with the maven-faces-plugin
Posted by "Simon Lessard (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527896 ]
Simon Lessard commented on TRINIDAD-712:
----------------------------------------
I agree with Andrew here. I had some use case where I wanted to extends a component to decorate the retrieved property, but using override method strategy to do so was impossible because of the final modifier. From the benchmarks made with final, since the performance boost is so insignificant, I don't think accessors should be final either. Also this will be more consistent with basic JSF components that don't make final accessors.
> Do not generate final properties with the maven-faces-plugin
> ------------------------------------------------------------
>
> Key: TRINIDAD-712
> URL: https://issues.apache.org/jira/browse/TRINIDAD-712
> Project: MyFaces Trinidad
> Issue Type: Wish
> Components: Plugins
> Affects Versions: 1.0.2-plugins
> Environment: maven-faces-plugin version 1.0.2 from the maven repository
> Reporter: Andrew Robinson
> Assignee: Adam Winer
>
> It would be extremely beneficial to not have property methods generated as final by the maven-faces-plugin.
> IMO, final should be reserved for constants and only on methods with rare exceptions and good reasons.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-712) Do not generate final properties
with the maven-faces-plugin
Posted by "Simon Lessard (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528032 ]
Simon Lessard commented on TRINIDAD-712:
----------------------------------------
Hello both of you,
I slept over it last night and came to agree with Adam. If we remove the final, users will have the illusion that overriding the accessors is enough to hook all accesses to the attribute, and since it's not really the case, it's bad. However, I think we should provide an easier way to decorate retrieved properties. The only way I see is to override getFacesBean that isn't final. I think we should add a FacesBeanWrapper class to easily implement decorator pattern over FacesBean. Such strategy would give an easy hook to any property if users ever need one.
Sounds good?
p.s. JIRA is not the best place for such discussion, should we move it to dev list instead?
~ Simon
> Do not generate final properties with the maven-faces-plugin
> ------------------------------------------------------------
>
> Key: TRINIDAD-712
> URL: https://issues.apache.org/jira/browse/TRINIDAD-712
> Project: MyFaces Trinidad
> Issue Type: Wish
> Components: Plugins
> Affects Versions: 1.0.2-plugins
> Environment: maven-faces-plugin version 1.0.2 from the maven repository
> Reporter: Andrew Robinson
> Assignee: Adam Winer
>
> It would be extremely beneficial to not have property methods generated as final by the maven-faces-plugin.
> IMO, final should be reserved for constants and only on methods with rare exceptions and good reasons.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-712) Do not generate final properties
with the maven-faces-plugin
Posted by "Simon Lessard (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527897 ]
Simon Lessard commented on TRINIDAD-712:
----------------------------------------
However, there's something to keep in mind even if final is not there. Renderers use direct read in the bean object, making simple accessors override override insufficient to completely hook all accesses to any given property, so I guess that's an argument in favor of final to not give false perceptions to users.
> Do not generate final properties with the maven-faces-plugin
> ------------------------------------------------------------
>
> Key: TRINIDAD-712
> URL: https://issues.apache.org/jira/browse/TRINIDAD-712
> Project: MyFaces Trinidad
> Issue Type: Wish
> Components: Plugins
> Affects Versions: 1.0.2-plugins
> Environment: maven-faces-plugin version 1.0.2 from the maven repository
> Reporter: Andrew Robinson
> Assignee: Adam Winer
>
> It would be extremely beneficial to not have property methods generated as final by the maven-faces-plugin.
> IMO, final should be reserved for constants and only on methods with rare exceptions and good reasons.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-712) Do not generate final properties
with the maven-faces-plugin
Posted by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527895 ]
Andrew Robinson commented on TRINIDAD-712:
------------------------------------------
This is not a correct assessment for a large portion of the time. Most of the time that the properties are used, they are used by people using binding. There are a lot of reasons to want to change this value before it is stored into the FacesBean. If JSF components weren't meant to have properties, then the faces plugin shouldn't generate them, and the attributes map should only be used. If you are going to create properties, you should give people the freedom to extend the components and customize the behavior.
> Do not generate final properties with the maven-faces-plugin
> ------------------------------------------------------------
>
> Key: TRINIDAD-712
> URL: https://issues.apache.org/jira/browse/TRINIDAD-712
> Project: MyFaces Trinidad
> Issue Type: Wish
> Components: Plugins
> Affects Versions: 1.0.2-plugins
> Environment: maven-faces-plugin version 1.0.2 from the maven repository
> Reporter: Andrew Robinson
> Assignee: Adam Winer
>
> It would be extremely beneficial to not have property methods generated as final by the maven-faces-plugin.
> IMO, final should be reserved for constants and only on methods with rare exceptions and good reasons.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (TRINIDAD-712) Do not generate final properties
with the maven-faces-plugin
Posted by "Adam Winer (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Winer resolved TRINIDAD-712.
---------------------------------
Resolution: Invalid
Assignee: Adam Winer
Regarding use of final, a lot of people would strongly disagree with you. Final should be used whereever it makes sense.
Here, it makes absolute sense: the true value is stored on the FacesBean. Overriding the getter or setter convenience is useless, and final is exactly correct.
> Do not generate final properties with the maven-faces-plugin
> ------------------------------------------------------------
>
> Key: TRINIDAD-712
> URL: https://issues.apache.org/jira/browse/TRINIDAD-712
> Project: MyFaces Trinidad
> Issue Type: Wish
> Components: Plugins
> Affects Versions: 1.0.2-plugins
> Environment: maven-faces-plugin version 1.0.2 from the maven repository
> Reporter: Andrew Robinson
> Assignee: Adam Winer
>
> It would be extremely beneficial to not have property methods generated as final by the maven-faces-plugin.
> IMO, final should be reserved for constants and only on methods with rare exceptions and good reasons.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.