当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: Code generation is a key new tre
 

 

 ·introduction to sitemesh    »显示摘要«
    摘要: does the page specifically request a decorator using a meta decorator tag? is the page a frame set (if so, dont apply a decorator)? does the page have a printable=true parameter> (if so, use th......
    摘要: what do you think of when i say "scripting?" if you are a programmer, you might think of using bash or perl to automate command-line programs. if you are a designer, you may think of dhtm......


Extensible Code Generation with Java, Part 1

code generation is a key new trend in engineering, one that you need to understand well. the reason is simple: todays modern frameworks are extremely code-intensive. using a code generator to build the code for you can save you a lot of time, both in writing the code and fixing the inevitable bugs that spring from swathes of hand-written code.

building a custom generator is an easy, fun, and cheap (free) way to understand how generation works. with a new understanding about code generation in hand, you will be able to evaluate off-the-shelf tools as well as have the ability to write something yourself. 【程序编程相关:Is Linux Ready for U

there are a number of code generation options for java development. these range from canned solutions that generate whole applications (e.g. compuwares optimalj), to open source generators (e.g. xdoclet), to custom-built solutions. this article focuses on using xslt to build custom generators. more information about xslt is presented below. 【推荐阅读:Keep Changes Small:

the basics 【扩展信息:Migrating the Deskto

lets start with the basics of code generation.

code generation is using one application to build code for another application. in this case, xslt will be our generator application. input for a code generator can come in many forms (source code, database schemas, xml models, etc.). regardless of the source, we call the input the model because it represents (models) what is to be built. on the other side are the templates. the templates render the model into code, or other artifacts such as documentation. figure 1 illustrates this process.

figure 1. flow chart for basic xslt-based code generation


...   下一页
 ·introduction to tag unit, part 2    »显示摘要«
    摘要: in java.net/pub/a/today/2004/07/05/tagunitintro.html">introduction to tagunit: part 1, we looked at some of the various ways in which custom tags can be tested before demonstrating some of the basi......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE