[ http://nagoya.apache.org/jira/browse/BEEHIVE-135?page=comments#action_56731 ] Kenneth Tam commented on BEEHIVE-135: -------------------------------------
Agree with the selective code-gen for the version check. I thought about the directly injecting the ControlInterface classname into the ControlBean, but shied away from it because it seemed like bad coupling/breaking of encapsulation to encode knowledge of your inheritance chain (beyond your super). Consider A.jcx extends B.jcx extends C.java; it seems ABean.java should only have knowledge of A and B, not C. > Version checking codegen cleanup > -------------------------------- > > Key: BEEHIVE-135 > URL: http://nagoya.apache.org/jira/browse/BEEHIVE-135 > Project: Beehive > Type: Bug > Components: Controls > Versions: V1Alpha > Reporter: Kyle Marvin > Assignee: Kenneth Tam > Priority: Minor > Fix For: V1Alpha > > The code generated static initialization code that does version checking for > ControlBeans could be made better in a couple of ways: > - the code generated by the enforceVersionRequired macro should be > selectively generated. There is no reason to generate class load time > version checking if there is no @VersionRequired annotation on the associated > ControlExtension. > - the ControlInterface to version check against can be (and should) be > determined at codegen time and not runtime. The call to > ControlBean.getMostDerivedInterface can be replaced by directly injecting the > (versioned) ControlInterface class name. This is a) simpler, and b) safer, > because having the class you are version checking against be dynamic doesn't > really make sense. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://nagoya.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
