You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2008/02/01 08:07:51 UTC

[Myfaces Wiki] Update of "Code Generation" by SimonKitching

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

------------------------------------------------------------------------------
   * the IDE must be told about the "generated source" directory
  
  With this approach, there is also the issue that a concrete class needs to be hand-created and checked in, even if there are actually no customisations needed. However, writing an empty class should not be too much of a problem. Possibly a tool could detect this case, though, and create the concrete class definition too. 
+ 
+ This comment was made about this approach:
+ {{{
+ For what it's worth, what you're describing here is the Generation Gap
+ pattern.   I've got a lot of experience using it with Cayenne over the
+ years (and WebObjects years before that), and it's effective.   It's
+ sometimes painful to write and maintain your base class in a
+ templating language, though, but once your base class is done, you
+ don't need to mess with it again, so this is a one-time painful
+ experience.   And yes, you would typically generate an empty concrete
+ subclass whenever one doesn't exist (the first time code generation
+ runs for a given component).
+ 
+ I check the code thus generated into the repository.   I also keep the
+ generated code in a subpackage called *.generated off the concrete
+ subclasses's package.
+ }}}
  
  === An annotation-driven approach ===