You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by LS <al...@yahoo.com> on 2001/10/21 00:41:14 UTC

Velocity best practices for large dynamic sites?

I am trying to see how to use Velocity in place of JSP in a situation
similar to Sun's canonical PetStore example, which uses the front controller
(or mediator) pattern and a single master template for the whole
site.(http://java.sun.com/j2ee/blueprints/design_patterns/front_controller/
explains this example if you aren't familiar with it already.)

>From what I can see, it looks like the way to do this in Velocity is to put
a ScreenFlowManager object into the VelocityContext and then call into
that object from a single master site template file. But I'm just now
learning Velocity so I'm not sure if that's the best way to go about it, so I
thought I'd ask the list for some pointers on how to incorporate Velocity into an
architecture for a large dynamic site. My goal is not to have to manually
incorporate site-wide HTML structure into each Velocity template. Are there some
Velocity best practices on this topic?


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Re: Velocity best practices for large dynamic sites?

Posted by LS <al...@yahoo.com>.
Thanks for this information. I had looked at the project page for Turbine once
while glancing through all the Jakarta projects but didn't understand from the home
page copy what it was exactly that Turbine actually did. 

You are exactly right that I want a skin template where nav and body are filled in
dynamically (just like in the PetStore example). So I'm just looking for the most
lightweight way to make that happen. When you say you use this pattern
successfully, have you used Turbine/Maverick to implement it, or something else?

I will take a closer look at Turbine and Maverick. If I have questions about them,
I'll follow up on the appropriate lists. Thanks again for the helpful pointers.

--- "Geir Magnusson Jr." <ge...@optonline.net> wrote:
> On 10/20/01 6:41 PM, "LS" <al...@yahoo.com> wrote:
> 
> > I am trying to see how to use Velocity in place of JSP in a situation
> > similar to Sun's canonical PetStore example, which uses the front controller
> > (or mediator) pattern and a single master template for the whole
> > site.(http://java.sun.com/j2ee/blueprints/design_patterns/front_controller/
> > explains this example if you aren't familiar with it already.)
> > 
> > From what I can see, it looks like the way to do this in Velocity is to put
> > a ScreenFlowManager object into the VelocityContext and then call into
> > that object from a single master site template file. But I'm just now
> > learning Velocity so I'm not sure if that's the best way to go about it, so I
> > thought I'd ask the list for some pointers on how to incorporate Velocity into
> > an
> > architecture for a large dynamic site. My goal is not to have to manually
> > incorporate site-wide HTML structure into each Velocity template. Are there
> > some
> > Velocity best practices on this topic?
> > 
> 
> I will get ahead of the pile of useful suggestions that you will receive
> from this crowd, and suggest that it would be a
> 
> *great*
> 
> project for us to convert the PetStore example to Velocity.
> 
> As for the question asked, I am not familiar with the PetStore example, but
> assuming I can get a few things out of the way (fix for the VM autoload
> loop, for example, which I am working on now...), I will take a look.  My
> first reaction is that I don't know why you want a master site template,
> unless this means you have some sort of 'skin' template where the things
> like nav and body content are the dynamic parts that are filled in.  That is
> a pattern that I use all the time, succesfully...
> 
> One suggestion which may be repeated would be to look at Turbine, which is a
> Velocity-favoring-yet-view-layer-neutral web application framework for ideas
> on how to put things together.  There are others too, that support Velocity,
> like Maverick, Melati, et al.  See the 'Powered By' page on the site.
> 
> geir
> 
> -- 
> Geir Magnusson Jr.                       geirm@optonline.net
> System and Software Consulting
> You're going to end up getting pissed at your software
> anyway, so you might as well not pay for it. Try Open Source.
> 
> 


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Re: Velocity best practices for large dynamic sites?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 10/20/01 6:41 PM, "LS" <al...@yahoo.com> wrote:

> I am trying to see how to use Velocity in place of JSP in a situation
> similar to Sun's canonical PetStore example, which uses the front controller
> (or mediator) pattern and a single master template for the whole
> site.(http://java.sun.com/j2ee/blueprints/design_patterns/front_controller/
> explains this example if you aren't familiar with it already.)
> 
> From what I can see, it looks like the way to do this in Velocity is to put
> a ScreenFlowManager object into the VelocityContext and then call into
> that object from a single master site template file. But I'm just now
> learning Velocity so I'm not sure if that's the best way to go about it, so I
> thought I'd ask the list for some pointers on how to incorporate Velocity into
> an
> architecture for a large dynamic site. My goal is not to have to manually
> incorporate site-wide HTML structure into each Velocity template. Are there
> some
> Velocity best practices on this topic?
> 

I will get ahead of the pile of useful suggestions that you will receive
from this crowd, and suggest that it would be a

*great*

project for us to convert the PetStore example to Velocity.

As for the question asked, I am not familiar with the PetStore example, but
assuming I can get a few things out of the way (fix for the VM autoload
loop, for example, which I am working on now...), I will take a look.  My
first reaction is that I don't know why you want a master site template,
unless this means you have some sort of 'skin' template where the things
like nav and body content are the dynamic parts that are filled in.  That is
a pattern that I use all the time, succesfully...

One suggestion which may be repeated would be to look at Turbine, which is a
Velocity-favoring-yet-view-layer-neutral web application framework for ideas
on how to put things together.  There are others too, that support Velocity,
like Maverick, Melati, et al.  See the 'Powered By' page on the site.

geir

-- 
Geir Magnusson Jr.                       geirm@optonline.net
System and Software Consulting
You're going to end up getting pissed at your software
anyway, so you might as well not pay for it. Try Open Source.