From: Lane S. <la...@op...> - 2005-05-09 23:17:10
|
Hi Jochen, Since I am a developer of WebMacro and since it is the forerunner for Velocity, I can speak with some authority about WebMacro viz Velocity. Velocity does not have the syntax grace as does WebMacro. Velocity introduced some mandatory elements which make it more restrictive for identifying a variable. WebMacro allows you to add/remove/rename directives at will. So, you can restrict or empower your template writers. There is no such ability in Velocity. The directives are "what you have is what you get". WebMacro is and remains lightening fast in both the parsing stage (once) and the eval phase (many). WebMacro has an elegant directive for creating, initializing and referencing objects or using static methods. WebMacro supports templates drawn from any source including a database. Yes, you read that correctly. Include files require some new support for this to be completely workable. WM has done an excellent job with whitespace and I know because I have generated perfectly indented java source files. WM is not perfect. But, it is rock solid and has been around for years proving itself day in and day out. WM has replaceable machinery including its caching API. Lane Jochen Toppe wrote: > Those are almost fighting words :) > > Velocity and Webmacro? I've recently integrated Velocity in a large > cms-based site, alongside with precompiled JSPs. It was easy to > integrate and the syntax easy to understand for dummies, granted. > > The main attraction was that it allowed me to > > - do template staging from a cms (try that with jsp) > - allow calls to be restricted only to the underlying beans (nifty > when you let cms users publish out code) even > though I had to extend it quite a bit, ugly private methods in > Velocity.. :( > > It still follows the same basic principles as jsp, error handling is > _wretched_. And the syntax is ugly, has serious whitespace handling > issues, .... I would say it's not really useable to implement an > enterprise portal. It was fine for me to allow users replace snippets > here and there. > > I would love to see a framework which > > - is xml based (and templates can be edited in an xml editor), well > formed output > - takes beans as an underlying model, not xml (rules out xslt unless > you're talking xalan, but, eew) > - finally throws out EL and replaces it with something useful where > I can do method calls > - is not in need of compilation; transportable across containers > (template staging) > - is restrictable enough for me to let users submit code > (prerequisite of the preceding point, don't want to > let users kill the servers by infinite loops, recursion, > System.exit, ..) > - is fast as hell > - i could think of more... > > I guess I need to write my own templating engine :) > > Cheerio, > Jochen > > P.S. ..and the templating new engine shall be written in Haskell *lol* > > > > Lane Sharman wrote: > >> Rodney, >> >> My advice is to stay away completely from JSP. Use a modern >> templating language like WebMacro or Velocity. Both languages are >> companion text processing engines written in Java allowing you to >> inspect java object values and merge them with text streams. Both >> have great communities and are well documented and in production for >> years. >> >> JSP is rooted in Sun's attempt to keep up with MS and its ASP circa >> 1997 by creating a copy-cat. JSP is just a horrible language for >> templating out a web page and it is one of many reasons why young >> individuals prefer PHP over Java for server-side scripting. When you >> use WebMacro or Velocity, you learn how to do code generation, email >> templates, CSV, and XML generation which cannot be done naturally >> with JSP. (JSP is for web page generation inside a servlet container). >> >> You do not need JBOSS either. This will bury you in J2EE disciplines >> which again were Sun's way to create permanent engineering employment >> but which only created employment pockets where there is a love of >> "don't assemble the bike, I prefer to do it myself. And, I love large >> cost overruns which include performance tuning projects". >> >> Look, please don't flame me those of you who have invested a lot of >> time in JBOSS or JSP. Here is a guy on the following part of the >> quadrant: Easy Application / Modest Skill Sets. Shall we have one >> more guy saying, "gee, this is really hard to do a web app in >> Java..."? I am trying to steer him down a road where he can learn >> Java and not all the J2EE machinery that has buried the purity of the >> language. >> >> If you want to invest the time in Hibernate, I think this is a great >> API for mapping objects to the traditional Database-->Tables-->Row >> schema paradigm. Personally, for small projects, I prefer not to map >> objects at all and have been using VeryLargeHashtable which takes a >> Java map and, behind the scenes, creates it persistently as well as >> the elements contained in the map provided they implement >> Serializable. (See me offline for my latest version of this API, also >> proven over time; http://webmacro.org/VeryLargeHashtable for more >> info; http://opendoors.com/vlh/Very_Large_Hashtable.html for a more >> detailed white paper and description.) >> >> As you can tell, I am about to lauch the next new open source >> project: the Java Reformation Project :). >> >> -Lane >> > **snip** -- Lane Sharman Providing Private and SPAM-Free Email http://www.opendoors.com 858-755-2868 |