On 5/7/07, James McLaughlin <[EMAIL PROTECTED]> wrote:
I prefer this style of programming too, but I think making it mandatory is
probably not a good idea. If someone isn't careful, they can too easily
create leakage passing the panel between pages. I would vote for an
AbstractVelocityPanel as above, and a VelocityPanel as before. This way we
can get the best (or worst :) ) of both worlds.

That's a possibility as well. Currently, VelocityTemplate is abstract,
but has a convenience factory method:

        public static VelocityPanel forTemplateResource(String id, IModel model,
                        final IStringResourceStream templateResource)
        {
                if (templateResource == null)
                {
                        throw new IllegalArgumentException(
                                        "argument templateResource must be not 
null");
                }

                return new VelocityPanel(id, model)
                {
                        protected IStringResourceStream getTemplateResource()
                        {
                                return templateResource;
                        }
                };
        }


But I could live with having AbstractVelocityPanel and VelocityPanel
as well. My preference is to what we have now, but it's slight.

Eelco

Reply via email to