myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Code Generation" by SimonKitching
Date Fri, 01 Feb 2008 12:15:05 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by SimonKitching:
http://wiki.apache.org/myfaces/Code_Generation

------------------------------------------------------------------------------
  
  One drawback is that this generated class is visible in the public ancestry of the concrete
class, distorting the "clean" hierarchy. An opinion was expressed that "-1; .. the resultant
OO structure is not clean".
  
- This approach is feasible for libraries like Tomahawk and Trinidad and the !MyFaces Impl.
It is also possible to use it for the myfaces api component classes - if an intermediary package-private
base class is defined (comment: I just tested this in my IDE, and it works - Simon, did you
test it and it didn't work for you?)
+ This approach is feasible for libraries like Tomahawk and Trinidad and the !MyFaces Impl.
+ 
+ Note that (in a feature that may surprise some Java developers) it appears quite valid for
a class to have a package-scoped parent; the class can still be subclassed or instantiated
from outside the package. It inherits public and protected members from its package-scoped
parent which can be called as normal. The only constraint is that it cannot be cast to its
parent type, as this is not accessible (although the Class object for that type can still
be obtained).  It is not yet known whether inserting such a package-scoped ancestor class
into the ancestry of a component class in the javax.faces package scope would be acceptable
to the JSF TCK or not. If the TCK accepts this, then the approach of generating a base class
could also be applied to myfaces core components.
  
  Meta-data would of course still be maintained in configuration files of some sort, external
to the generated code.
  

Mime
View raw message