_Attention_ - this is just a start, the info is NOT deemed correct!   

I hope that others migth spend a bit of time to describe the Velocity architecture and how the engine actually works. A pretty diagram or three might be nice. ;-)

For folks interested in working on the core Velocity engine, this should be helpful.


An engine consumes fuel and moves a car. But how do you improve the engine to make the car go faster? We need to understand some basics of the internal combustion engine, or ICE. The basic ICE consists of cylinders into which a gas/air mixture is injected. An ignition creates an explosion which in turn moves the cylinders which are connected to and turn a crankshaft which propels the rear wheels of the car. This is an oversimplification of course.

A Velocity Engine consumes settings, macro definitions, a 'context' that holds data and a template and merges them to create output. The engine acquires the settings and global macros via configuration files during initialization. Initialization consists of doing foo, bar bleck.

At this point the engine is ready to go and the application creates a "context" which is essentially a hashmap of object references but with additional foo.

Pluggable resource loaders provide various means to load template files from the filesystem, strings, webapps, and databases.

After this mixture of resources is brought into the engine, the app asks the engine to merge the results. At this point a Parser programmatically built using JavaCC tokenizes the template and assembles an Abstract Syntax Tree (AST) which is then visited using the FooRefThingy.java class.


RevisingSyntax Here's a quick explanation of how to revise the syntax of the Velocity language.

VelocityArchitecture (last edited 2009-09-20 23:32:45 by localhost)