You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Jon Stevens <jo...@latchkey.com> on 2001/03/03 09:40:07 UTC

You make the decision.

After a few weeks of working on this in my off hour not-so-spare time, I
present, for your enjoyment and pleasure, an essay titled:



    You make the decision.
    <http://jakarta.apache.org/velocity/ymtd/ymtd.html>



Love and Kisses,

-jon


Re: You make the decision.

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Rafal Krzewski wrote:
> 
> Rafal Krzewski wrote:
> >
> > Jon Stevens wrote:
> > > After a few weeks of working on this in my off hour not-so-spare time, I
> > > present, for your enjoyment and pleasure, an essay titled:
> > >
> > >     You make the decision.
> >
> > Great work Jon! It's good to have such a paper in case some people
> > need to be shown the light...
> >
> > You didn't hear from me in a while,
> <snip>
> 
> OOPS! That was supposed to be a private message to Jon... Stupid me :-)
> To: undisclosed recipients + hidden Reply-to: (brief header view) bit
> me...
> 
> Sorry everybody
> 
> Rafal
> 

No worries!  I found your reply interesting and a good read, and nice to
know that someone else (your friend) is using Velocity for the forces of
good.

It might be nice if we all did something like that - 

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.com
Developing for the web?  See http://jakarta.apache.org/velocity/

Re: You make the decision.

Posted by Rafal Krzewski <Ra...@e-point.pl>.
Rafal Krzewski wrote:
> 
> Jon Stevens wrote:
> > After a few weeks of working on this in my off hour not-so-spare time, I
> > present, for your enjoyment and pleasure, an essay titled:
> >
> >     You make the decision.
> 
> Great work Jon! It's good to have such a paper in case some people
> need to be shown the light...
> 
> You didn't hear from me in a while, 
<snip>

OOPS! That was supposed to be a private message to Jon... Stupid me :-)
To: undisclosed recipients + hidden Reply-to: (brief header view) bit
me...

Sorry everybody

Rafal

--
Rafal Krzewski
Senior Internet Developer
mailto:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl

Re: You make the decision.

Posted by Rafal Krzewski <Ra...@e-point.pl>.
Jon Stevens wrote:
> After a few weeks of working on this in my off hour not-so-spare time, I
> present, for your enjoyment and pleasure, an essay titled:
> 
>     You make the decision.

Great work Jon! It's good to have such a paper in case some people
need to be shown the light...

You didn't hear from me in a while, because I was away this week. I went
to the Karkonosze Mountains with my gf to do some cross-country skiing.
We had great time!

My school is coming along nicely too. I'm working for the example
program
for my paper. I'm writing a toy application server in Java. It won't
be a J2EE implementation (too large & too much useless crap in it) but
something similar to a Servlet container. I'm going to define an API
similar to Java Servlets but simpler. (I think I'll all it Servlite).
I spent some time reverse engineering Catalina and I copied large part
of the design (I mean the intefaces in org.apache.catalina), stripped
it down of everthing that I felt unnecessary, and now I'm writing the
implementation. At the moment I have a server that can contain 
multiple webserver contexts in it and is talking HTTP/1.0. The jar
file has 61kb :-)
A very important feature of my server will be clustering capabitilties.
It will have an admin console that will allow deploying of war-style
application archives on a cluster of machines.
I think that given some work after I finish school (mainly implementing
HTTP/1.1 keepalive connections) can make it a lightweight, efficient
and durable alternative to J2EE. BTW. the university will hold the
copyright
but my professor allowed me to put GPL or BSD license on the program.
My collegue Damian is working on a stripped down to the basics
reimplementation
of Turbine for his Masters. He'll use Velocity as the templating tool,
and the
whole thing will run on top of my server and it's Servlite API. The same
thing
with GPL/BSD license.

All of this might sound a bit useless after all, but I think that it's
not
the worst thing to do for your Master's degree...

Rafal


--
Rafal Krzewski
Senior Internet Developer
mailto:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl

Re: You make the decision.

Posted by Jon Stevens <jo...@latchkey.com>.
on 3/4/01 10:14 AM, "Jan-Henrik Haukeland" <ha...@tildeslash.com> wrote:

> Jon Stevens <jo...@latchkey.com> writes:
> 
>> [Spaghetti]
>> AHHHHHHHHH! I have a head/sinus cold. I can't code today at all.
>> 
>> Move the int i=0; out of the loop.
> 
> I rest my case ;->
> 
> Ps. Sorry Jon, but if you put your head on the block like that..

Yea, I have been fighting a HEAD COLD you idiot. I want to see you write
code with a 102 temperature and have it come out perfect every time.

p.s. At least this time you spelled Spaghetti correctly. Duh.

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


Re: You make the decision.

Posted by Jan-Henrik Haukeland <ha...@tildeslash.com>.
Jon Stevens <jo...@latchkey.com> writes:

> [Spaghetti]
> AHHHHHHHHH! I have a head/sinus cold. I can't code today at all.
> 
> Move the int i=0; out of the loop.

I rest my case ;->  

Ps. Sorry Jon, but if you put your head on the block like that..

-- 
Jan-Henrik Haukeland

Re: You make the decision.

Posted by Jon Stevens <jo...@latchkey.com>.
on 3/3/01 11:30 AM, "Jon Stevens" <jo...@latchkey.com> wrote:

> Hashtable strings = new Hashtable();
> while (true)
> {
> int i = 0;
> strings.put ("dead" + i, new StringBuffer(9999999));
> i++;
> }

AHHHHHHHHH! I have a head/sinus cold. I can't code today at all.

Move the int i=0; out of the loop.

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


Re: You make the decision.

Posted by Jon Stevens <jo...@latchkey.com>.
on 3/3/01 10:11 AM, "Jon Stevens" <jo...@latchkey.com> wrote:

> while (true)
> {
> Hashtable strings = new Hashtable();
> while (true)
> {
> strings.put ("dead", new StringBuffer(9999999));
> }
> }

Damn. I can't let bad code affect me like that. The above should be written
more like this:

    Hashtable strings = new Hashtable();
    while (true)
    {
        int i = 0;
        strings.put ("dead" + i, new StringBuffer(9999999));
        i++;
    }

That will quickly lead to out of memory errors and because JSP pages
themselves can't catch those (read my essay for examples), there is no real
good way to nicely handle that error and your entire server will be taken
down.

On the converse, with Velocity, you can control what is in the Context on a
shared server. This allows you to define a nice simple API that your users
can take advantage of (giving them the functionality they need) without
having to worry about taking down the entire server.

Anyway, you get my point.

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


Re: You make the decision.

Posted by Jon Stevens <jo...@latchkey.com>.
Hi Glenn,

Thanks for the excellent feedback. I will integrate your statements and my
responses into the document. :-)

on 3/3/01 7:15 AM, "Glenn Nielsen" <gl...@voyager.apg.more.net> wrote:

> Jon,
> 
> That is an interesting read.  I have a few comments.
> 
> 1. You did not address the issue of web publishing tool support for
> JSP and JSP taglibs.
> 
> Your argument concerning the amount of typing it takes to accomplish
> the same task only has merit if someone is editing an application directly.
> 
> A web publishing tool would hide the scripting language from the user,
> how wordy the scripting language is wouldn't matter then.

<http://jakarta.apache.org/velocity/ymtd/ymtd-javabeans.html>

"Above, we have a very simple example of using a bean in a page. Pass it
some properties and then retrieve the results. This is the right way to do
things when using JSP. However, if we look at an example of doing the same
exact thing in Velocity, the extra amount of needless typing that one needs
to perform to simply retrieve a property seems a just bit absurd. Of course
there are always GUI based drag and drop tools to make typing a thing of the
past. Really."

My point here (and I will expand more in the essay) is that the drag/drop
tools are not only commercial (and fairly expensive) products, but the
history of these type of products is strongly biased towards only being
partial solutions. As soon as you need something more complex than the
product offers, they tend to fall down and you are back to hand editing the
pages.

> 2. Syntax of JSP taglibs vs Velocity
> 
> JSP taglib syntax is similar to that of HTML, this syntax will be easier
> for non programmers to pick up.
> 
> Velocity syntax is more like programming, great for programmers, perhaps
> not so easy for web publishers to use.

That is your opinion. Thank you.

I have seen (with my own two eyes) HTML designers pick up and use Velocity
without any problem. The WebMacro project has been around for ages and there
are TONS of reports on the mailing list of people being able to deal with
the syntax. This is really a moot point because, as I say in my essay, it
really comes down to preferences. Personally, I find Velocity's syntax much
easier to read (and write) than HTML'ish syntax. That is why I also give
several examples of this in the essay.

You make the decision.

> 3. Extending or adding new features
> 
> JSP 1.1 with taglibs allows web publishers to add new features and capabilites
> to their web application by installing a tag lib that implements what they
> want to do.  And there are more and more taglibs every day.  For example,
> the new Jakarta-taglibs scrape taglib.  Those taglibs can be imported into
> web publishing tools for easy incorporation into a web application.

Same with Velocity. In fact, with Velocity there is no need to define a
namespace at the top of the file before you need to use the tags nor write
Java code to expand it because you can use Velocimacro's. You can also
define your own #directives that are backed by Java code as well.

You are also missing the point that *any* Object can be placed into the
Context. By doing this, you are developing a more Pull oriented application.
My argument is that this is a more strictly MVC design and therefore is a
better design.

> 4. Velocity has its place along with other technologies such as Cocoon,
> Web Macro, etc. as a tool to use for developing web applications. JSP
> with taglibs also has its place.  From my perspective, where we support
> 100's of virtual hosted sites and over a thousand web publishers (most of
> whom think HTML is programming), JSP with taglibs is the best solution.
> For internal applications we develop we will choose what we think is the
> best tool.

How do you know if you haven't tried it? :-)

In fact, I assert that Velocity is safer to use in that type of an
application (ie: hosted) because it is impossible to do things in the
templates like spawn new threads (of course which can be controlled by Java
Security) and create a tight infinite while loop that could potentially take
down the entire server as a DoS attack (which can't be controlled with JSP).

while (true)
{
    Hashtable strings = new Hashtable();
    while (true)
    {
        strings.put ("dead", new StringBuffer(9999999));
    }
}

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/> && <http://java.apache.org/turbine/>


Re: You make the decision.

Posted by Glenn Nielsen <gl...@voyager.apg.more.net>.
Jon,

That is an interesting read.  I have a few comments.

1. You did not address the issue of web publishing tool support for
JSP and JSP taglibs.

Your argument concerning the amount of typing it takes to accomplish 
the same task only has merit if someone is editing an application directly.  

A web publishing tool would hide the scripting language from the user,
how wordy the scripting language is wouldn't matter then.

2. Syntax of JSP taglibs vs Velocity

JSP taglib syntax is similar to that of HTML, this syntax will be easier
for non programmers to pick up.

Velocity syntax is more like programming, great for programmers, perhaps
not so easy for web publishers to use.

3. Extending or adding new features

JSP 1.1 with taglibs allows web publishers to add new features and capabilites
to their web application by installing a tag lib that implements what they
want to do.  And there are more and more taglibs every day.  For example,
the new Jakarta-taglibs scrape taglib.  Those taglibs can be imported into
web publishing tools for easy incorporation into a web application.

4. Velocity has its place along with other technologies such as Cocoon,
Web Macro, etc. as a tool to use for developing web applications. JSP
with taglibs also has its place.  From my perspective, where we support
100's of virtual hosted sites and over a thousand web publishers (most of
whom think HTML is programming), JSP with taglibs is the best solution.
For internal applications we develop we will choose what we think is the
best tool.

Regards,

Glenn

Jon Stevens wrote:
> 
> After a few weeks of working on this in my off hour not-so-spare time, I
> present, for your enjoyment and pleasure, an essay titled:
> 
>     You make the decision.
>     <http://jakarta.apache.org/velocity/ymtd/ymtd.html>
> 
> Love and Kisses,
> 
> -jon
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org

-- 
----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Re: You make the decision.

Posted by Jon Stevens <jo...@latchkey.com>.
Good feedback. I will integrate it into the document.

on 3/3/01 6:50 AM, "Weiqi Gao" <we...@networkusa.net> wrote:

> It sounds like the lack of a specification is the only reason that there
> is only one implementation.

It is one reason I'm sure.

>  As soon as the specification is complete,
> how are you going to prohibit other implementations?

Actually, there are already other implementations of the *concept*. Remember
where Velocity came from. It came from WebMacro.

The difference between Velocity and JSP in this case is that the
specification, source code and whole process is open and is not controlled
by corporate politics (and believe me, in JSP land there are quite a few of
them).

thanks,

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/> && <http://java.apache.org/turbine/>


Re: You make the decision.

Posted by Weiqi Gao <we...@networkusa.net>.
Jon Stevens wrote:
> 
> After a few weeks of working on this in my off hour not-so-spare time, I
> present, for your enjoyment and pleasure, an essay titled:
> 
>     You make the decision.
>     <http://jakarta.apache.org/velocity/ymtd/ymtd.html>
> 
> Love and Kisses,

I find this argument a little bit unsettling:
========quote======================================
Velocity is actually a more reliable implementation
because there is currently only one implementation,
the modifications to the code base are discussed in
the open (anyone is welcome to participate) and the
testing suite is strictly maintained.
========end-quote==================================

It sounds like the lack of a specification is the only reason that there
is only one implementation.  As soon as the specification is complete,
how are you going to prohibit other implementations?

--
Weiqi Gao
weiqigao@networkusa.net

Re: You make the decision.

Posted by Jon Stevens <jo...@latchkey.com>.
on 3/5/01 6:01 AM, "David Esposito" <es...@newnetco.com> wrote:

> Every page must be constructed using a back-end
> servlet ...

I agree with everything that Geir said, however I need to touch on this
point.

As I suggested on the first page of YMTD, you should read about the Pull
Model which is about not having a back end servlet for each page.

> Yes, I know ... you may think that I have a pretty weak argument ... But in
> practice, using the same language/technology for the production application
> and the prototype does amazing things for speed of development ... Several
> web projects that I worked on had incredible speed increases because the
> designer and I were working on the same physical project and I could add
> functionality to the pages that he already designed and linked ... and vice
> versa ...

I don't see why you can't do that with Velocity and a well defined Pull
based API.

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


RE: You make the decision.

Posted by David Esposito <es...@newnetco.com>.
Ok, I know this is going to bring on some flames ... but whatever ...

The article brings up some pretty interesting points and certainly
illustrates a lot of the reasons why we ultimately decided to use Velocity
for our project. But it is certainly not a resource for someone that is
trying to "make the decision" ... It doesn't even come close to illustrating
any of the downsides of using Velocity (or any true MVC architecture) ... a
very one-sided article by almost anyone's standards ...

One particular peeve I have about the article is its lack of illustrating
one point ... prototyping an application ... One of the reasons that Cold
Fusion and JSP have gained such market share is because the first person to
take a whack at a prototype for an application is often the web designer ...
Non-developers can build screen shots and even demonstrate some basic
functionality by using a few <CFOUTPUT> or <%= %> tags and a few HREF links
... On the other hand, building a prototype by a non-developer using
Velocity is not possible. Every page must be constructed using a back-end
servlet ... This means that the prototype and the production app must be two
independent projects (unless you want to allocate a developer to build a
servlet and modify the deployment descriptor for the web app for each page
that the designer wants to add)...

Yes, I know ... you may think that I have a pretty weak argument ... But in
practice, using the same language/technology for the production application
and the prototype does amazing things for speed of development ... Several
web projects that I worked on had incredible speed increases because the
designer and I were working on the same physical project and I could add
functionality to the pages that he already designed and linked ... and vice
versa ...

Like I said ... ultimately, we decided to go with Velocity but it certainly
wasn't a 'no-brainer' like the article implies it should be ...

-Dave


> -----Original Message-----
> From: Jon Stevens [mailto:jon@latchkey.com]
> Sent: Saturday, March 03, 2001 3:40 AM
> To: undisclosed-recipients:;
> Subject: You make the decision.
>
>
> After a few weeks of working on this in my off hour not-so-spare time, I
> present, for your enjoyment and pleasure, an essay titled:
>
>
>
>     You make the decision.
>     <http://jakarta.apache.org/velocity/ymtd/ymtd.html>
>
>
>
> Love and Kisses,
>
> -jon
>