I am currently working on a legacy application that has a lot of the following:
show_article() goes out, grabs the article (based on some evil global variables ;) and prints it out as it goes.
This makes it bloody hard to test, and *really* hard to cache. To handle scalability I may want to get that article and save the HTML to disk for use later, or grab the article object and put it in a distributed cache, or ….
The fact that most of the methods in this application do not return strings, but rather just go ahead and print to STDOUT makes life a real nightmare.
This is one of the pros of Velocity vs. JSP. Why can’t we create a JSP engine, setup bindings, execute, and get back a string? Then we could even use JSP outside of the web scope (e.g. to generate emails).