velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Velocity Design
Date Wed, 07 Feb 2001 20:00:43 GMT
Hai Nguyen wrote:
> Hi:
> I like Velocity and would like to use it to build the view for my project.
> However, I would like to learn more about Velocity design so that I can
> explain to my colleagues in detail how good it is.  The Webmacro does a very
> good job in explaining how it works in detail
> ( introspection, template is
> immutable, performance (caching, class analysis), context per thread,
> framework is extendable....

We don't have a nice document like that.  Alas... :(

In general, you will find much in kind :

- similar introspection rules.  Generally, it's 'what you expect'.
- ability to call any public method of an object in the context.  (This
is what I believe is referred to as the 'round bracked hack' in WM)  We
just think of it as accessing a method.
- similar concurrency issues : the template is immutable and safe for
multi-thread use, the Context isn't which is acceptable, very few locks,
- performance issues : templates are parsed into an internal tree
representation for speed and efficiency, and in a production
environment, are cached for reuse.  Class analysis is cached centrally
for introspection efficiency, and 'locally' in your context, which helps
with looping and Velocimacros.  You can also reuse a context and get the
benefit that you will stay out of the central introspection cache for
the most part.
- extensiblity : I think we are making an effort to keep velocity simple
and therefore you can't extend everything that you can in WM.  Many of
the facilities in WM we push to the application layer, such as context
tool managment.  This keeps velocity smaller in code size, and simpler
to maintain because there is less of it :)  However, you can plug in new
directives if you wish, control template loading and caching, to touch a
few of the items listed.

One of the big distinguishing features are the Velocimacros.  See the
site and examples for details.

> I wonder if Velocity has something like that and somebody can point me to
> it.
> Also, Velocity states that its design concept "is borrowed from WebMacro."
> By that, can I assume what Webmacro having in its design (as explained in
> the webmacro web page "how it works" above) also applies to Velocity ?

Sort of : the idea there, I think, is that the programming patterns of
WM and Velocity are identical, in that you take a Context object, put
data into it, choose a template, and then let the engine 'render' the
template for you with the data.

I just converted a WM site to Velocity - it was trivially easy.  We also
include a utility to convert your WebMacro templates, if you wish
(although the template languages are so similar, it's trivial to do by
> Other questions:
> - Are we close to an official release?  I read the archive and saw that
> version 0.71 is "very, very stable".

Yes.  There has been some discussion here and there.  Off the top of my
head, I would assume JavaOne or ApacheCon as one of those events that
would be great to shoot for, but we haven't discussed or formalized it. 
I think it would be good if a bit more adoption and testing takes place
before that.  It is very dependable and stable, but users like you are
needed to really shake things down. So use it :)

I use it exclusively for my consulting work for commercial clients (have
2 in production using it), so I am staking my reputation and income on
it, for what that's worth.

> - Do we have a draft for the developer guide yet ?

The current documentation is available in the distribution and on the

> Thanks.
> --- Hai


Geir Magnusson Jr.                     
Velocity : it's not just a good idea. It should be the law.

View raw message