Good template systems

Bloated, I dont need them   0 votes - 0 %
What can they do that I can't?   0 votes - 0 %
I dont want to learn another language   0 votes - 0 %
Put control logic where it belongs   0 votes - 0 %
Cuts back on code bloat   0 votes - 0 %
A real lifesaver   0 votes - 0 %
Makes working on systems fun   1 vote - 50 %
Couldn't live without them!   1 vote - 50 %
 
2 Total Votes
I would be major time f'd by cam (2.00 / 0) #1 Sun Jun 18, 2006 at 06:22:37 PM EST
Velocity is good by Weapon of Pack Destruction (2.00 / 0) #2 Sun Jun 18, 2006 at 07:20:44 PM EST
Freemarker looks like a better idea.  With Velocity I'm screwed without VelocityTools.  JSP 2.0 with liberal use of the EL comes close.  Still too many pointy tags though.

[ Parent ]

You can jam stuff into the context by cam (2.00 / 0) #4 Sun Jun 18, 2006 at 08:34:33 PM EST
including some gateway object from your API. Why do you feel reliant on velocity tools?

cam
Freedom, liberty, equity and an Australian Republic
[ Parent ]

Here's why: by Weapon of Pack Destruction (2.00 / 0) #5 Sun Jun 18, 2006 at 09:49:03 PM EST
RenderTool

I used this to build <spring:bind> - like macros to autopopulate the id, name, value and for attributes of label/form element pairs.

Uniform access to the Form object in struts: FormTool

Simplified access to Commons Validator:
ValidatorTool

Actually when I was using Velocity with Struts, I used the whole VelocityStruts library.

And then there's the broken way Velocity accesses arrays, necessitating ArrayTool (deprecated by ListTool).  I understand that Freemarker handles that much more transparently.

Here you go: Velocity vs. Freemarker

[ Parent ]

While prototype totally rocks, by Weapon of Pack Destruction (2.00 / 0) #3 Sun Jun 18, 2006 at 07:27:09 PM EST
there is something just ugly about taking a javascript library that bitchslaps javascript into Ruby shape, and then grafting perl accessors on top of it.  It reminds me of a pigeonrat.  But then again, perl is an ugly, ugly language to start with, so that's probably where most of my aesthetic displeasure is coming from.

I tried using AjaxTags, which is a similar effort to JSPify Prototype, and found that it was easier to just write out the JSONs than to write the JSP wrappers.



Prototype by coryking (2.00 / 0) #6 Mon Jun 19, 2006 at 12:49:52 AM EST
I'm almost with you on the prototype thing.  It looks like all the thing is doing is acting as a code generator for the script.aculo.us library.

I suspect that once I get more comfortable with the underlying javascript API, I'll stop using the prototype library and just write to the API instead.  Hence, I belive, it's name "prototype" :-)

As for perl, people write ugly code, not languages.  Sadly the perl community is rife with poor programmers.  Once you "get" perl and if you care about writing readable code, perl is a thing of beauty.  I love it!
We are Siamese if you please. We are Siamese if you don't please.
[ Parent ]

Getting terms straight by Weapon of Pack Destruction (2.00 / 0) #7 Mon Jun 19, 2006 at 01:13:52 AM EST
I think you're saying that you'll dump the perl prototype library and just use script.aculo.us instead, in which case I'd agree.

The name "prototype" refers to two things.  First, Sam Stephenson's "prototype" javascript library, which script.aculo.us and moo.fx are built on.  Second, a language feature of javascript, whereby you can dynamically add objects and methods to a class, and have those objects and methods then accessible by any instance of that class.  Sam uses this to extend javascript built-in classes and provide a very Ruby-like interface.

Go look here or just google "prototype"  It's worth it just for the $ function, but the $$ function rocks my world.

$$(div#main form input.required) returns an array of all input elements of class "required" that are members of a form that is inside a div with the id of "main"

For information about prototyping languages, here you go

[ Parent ]

Oh wow by coryking (2.00 / 0) #8 Mon Jun 19, 2006 at 12:10:07 PM EST
you learn something every day!  Thanks for the link!

I dont know who does what in the AJAX world I guess. 
We are Siamese if you please. We are Siamese if you don't please.
[ Parent ]