Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Template-Based Code Generation with Apache Velocity, Part 1

Template-Based Code Generation with Apache Velocity, Part I'm going to discuss template-based code generation, explain basic concepts related to templates and transformations, and demonstrate the huge benefits they can bring in code generation.

Tutorial Details:

Templates and Transformations
Template-based transformations are ubiquitous in the software development world. A wide number of tools use templates to transform data from a format to another. For example, XSLT is the standard way to perform XML document transformations based on templates that are written according to the eXtensible Stylesheet Language.

four components involved in a template-based transformation process. They are:

Data Model: Contains data, organized in a specific structure, that have to be transformed.
Template: Formats the data model into the output code. It contains references to entities belonging to the data model.
Template Engine: The application that performs the transformation. It has the input data model and the template, and produces output by replacing the template internal references with real data coming from the model.
Target: The result of the transformation process.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Template-Based Code Generation with Apache Velocity, Part 1

View Tutorial:
Template-Based Code Generation with Apache Velocity, Part 1

Related Tutorials:

Program your Palm in Java, Part 1: The PalmOS Emulator - JavaWorld November 1999
Program your Palm in Java, Part 1: The PalmOS Emulator - JavaWorld November 1999
 
Code generation using Javadoc - JavaWorld August 2000
Code generation using Javadoc - JavaWorld August 2000
 
Mapping XML to Java, Part 1 - JavaWorld August 2000
Mapping XML to Java, Part 1 - JavaWorld August 2000
 
Solve your servlet-based presentation problems - JavaWorld November 2000
Solve your servlet-based presentation problems - JavaWorld November 2000
 
Breathe intelligence into Java - JavaWorld April 2001
Breathe intelligence into Java - JavaWorld April 2001
 
Clean up your wire protocol with SOAP, Part 2 - JavaWorld April 2001
Clean up your wire protocol with SOAP, Part 2 - JavaWorld April 2001
 
Clean up your wire protocol with SOAP, Part 3 - JavaWorld June 2001
Clean up your wire protocol with SOAP, Part 3 - JavaWorld June 2001
 
Reflection vs. code generation
Reflection vs. code generation
 
Axis: The next generation of Apache SOAP
Axis: The next generation of Apache SOAP
 
Integrate Java and C++ with Jace
Integrate Java and C++ with Jace
 
Take the sting out of SAX
Take the sting out of SAX
 
Template-Based Code Generation with Apache Velocity, Part 1
Template-Based Code Generation with Apache Velocity, Part I'm going to discuss template-based code generation, explain basic concepts related to templates and transformations, and demonstrate the huge benefits they can bring in code generation.
 
Apache Geronimo
Apache Geronimo Welcome to Apache Geronimo, the J2EE server project of the Apache Software Foundation. Please help us make this a world class, certified J2EE container!
 
Extensible Code Generation with Java, Part 1
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: today's modern frameworks are extremely code-intensive. Using a code generator to build the code
 
Template-Based Code Generation with Apache Velocity, Part 2
Template-Based Code Generation with Apache Velocity, Part 2 As described in part one of this series, code generation typically uses a template engine to transform some kind of "model" into compilable code, given the formatting specified by a template.
 
Extensible Code Generation with Java
Extensible Code Generation with Java Part 2 In part 1 of this series, we looked at the idea of generated code, which is code written not by hand but by another application. The appeal of generated code is that it can eliminate drudgery (and mistakes) i
 
Attribute-Oriented Programming with Java 1.5, Part 1
In this article, I will consider the case of a status-bar component embedded in a GUI application. I will explore a number of different ways to implement this status reporter, starting with the traditional hard-coded idiom. Along the way, I will introduce
 
Reduce code bloat with XDoclet
Reduce code bloat with XDoclet XDoclet can easily be one of the more versatile cross-technology code-generation tools in your Java programming toolbox. Unfortunately, developers often overlook XDoclet's general utility and use it only when it's bundled a
 
What is Persistence Framework?
What is Persistence Framework? What is Persistence Framework? A persistence framework moves the program data in its most natural form (in memory objects) to and from a permanent data store the database. The persistence framework manages the
 
Open Source Web Frameworks in Java
Open Source Web Frameworks in Java Open Source Web Frameworks in Java Struts Struts Frame work is the implementation of Model-View-Controller (MVC) design pattern for the JSP. Struts is maintained as a part of Apache Jakarta project and is open
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.