You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Hai Nguyen <ha...@hotmail.com> on 2001/02/07 19:41:20 UTC

Velocity Design

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
(http://webmacro.org/tutorial/guts.html): introspection, template is
immutable, performance (caching, class analysis), context per thread,
framework is extendable....

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 ?

Other questions:
- Are we close to an official release?  I read the archive and saw that
version 0.71 is "very, very stable".
- Do we have a draft for the developer guide yet ?

Thanks.
--- Hai

Re: Velocity Design

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Hai Nguyen wrote:
> 
> I definitely can do that.  Actually, I am using Velocity with Turbine.
> (Please don't kick me back to the Turbine mailing list :).

LOL!  ROTFL!  "Please! Not the Turbine list!"

> Have successfully set up login screens, doing actions,....
> 
> I'll let you know if I have any problems as I am going.  Right now, I use
> Turbine Context (http://java.apache.org/turbine/context-howto.html) as
> Velocity developer's guide.

All questions about Velocity are fair game here.  But if they are
Turbine issues you are just going to have to firm your resolve and try
the Turbine list :)

geir


-- 
Geir Magnusson Jr.                               geirm@optonline.com
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity

Re: Velocity Design

Posted by Hai Nguyen <ha...@hotmail.com>.
I definitely can do that.  Actually, I am using Velocity with Turbine.
(Please don't kick me back to the Turbine mailing list :).
Have successfully set up login screens, doing actions,....

I'll let you know if I have any problems as I am going.  Right now, I use
Turbine Context (http://java.apache.org/turbine/context-howto.html) as
Velocity developer's guide.

--- Hai
----- Original Message -----
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: <ve...@jakarta.apache.org>
Sent: Wednesday, February 07, 2001 3:46 PM
Subject: Re: Velocity Design


> Hai Nguyen wrote:
> >
> > Hi,
> > Thanks for your response.  It is very helpful.
> > About the developer's guide, I don't see anything there yet.
> > I have checked both the web page
> > (http://jakarta.apache.org/velocity/developer-guide.html) and the CVS.
The
> > User's Guide has been there but not the Developer's guide.
>
> You are correct.  Sorry.
>
> Why not keep track of what you go through to get velocity up and
> running, as a first-time user, any problems you run across, etc?  We can
> then look at incorporating that into the documentation. That would be
> useful.  :)
>
> geir
>
> --
> Geir Magnusson Jr.                               geirm@optonline.com
> Velocity : it's not just a good idea. It should be the law.
> http://jakarta.apache.org/velocity
>

Re: Velocity Design

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Hai Nguyen wrote:
> 
> Hi,
> Thanks for your response.  It is very helpful.
> About the developer's guide, I don't see anything there yet.
> I have checked both the web page
> (http://jakarta.apache.org/velocity/developer-guide.html) and the CVS.  The
> User's Guide has been there but not the Developer's guide.

You are correct.  Sorry.

Why not keep track of what you go through to get velocity up and
running, as a first-time user, any problems you run across, etc?  We can
then look at incorporating that into the documentation. That would be
useful.  :)

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.com
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity

Re: Velocity Design

Posted by Hai Nguyen <ha...@hotmail.com>.
Hi,
Thanks for your response.  It is very helpful.
About the developer's guide, I don't see anything there yet.
I have checked both the web page
(http://jakarta.apache.org/velocity/developer-guide.html) and the CVS.  The
User's Guide has been there but not the Developer's guide.

Thanks,
---- Hai

----- Original Message -----
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: <ve...@jakarta.apache.org>
Sent: Wednesday, February 07, 2001 3:00 PM
Subject: Re: Velocity Design


> > - Do we have a draft for the developer guide yet ?
>
> The current documentation is available in the distribution and on the
> website.
>
> >
> > Thanks.
> > --- Hai
>
> geir
>
> --
> Geir Magnusson Jr.                               geirm@optonline.com
> Velocity : it's not just a good idea. It should be the law.
> http://jakarta.apache.org/velocity
>

Re: Velocity Design

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
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
> (http://webmacro.org/tutorial/guts.html): 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,
etc
- 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
hand...)
 
> 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
website.

> 
> Thanks.
> --- Hai

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.com
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity