Hi, You-Sheng:
Like the servlet spec, the CGI spec has two implementations: a part that
the server (or servlet engine) has to implement, and a part that the
application program can use. For CGI, the spec says the server must
provide a very rudimentary environment for the app program, one that is
quite abstract: standard I/O, environment variables...you can test the
typical perl or C CGI script outside of the CGI environment with very
little effort, and if the scripts only use environment variables, with
almost no effort at all.
The servlet spec provides a richer, less abstract environment, largely tied
to its OO framework (please, please, let no one tell me about OO perl, C++
scripts...all of that is outside the CGI spec). App programs inherit from
a servlet class (no ambiguity as to what the thing is), and they get passed
request/response objects, etc. There are predefined doGet/doPost methods
*as part of the spec*, not some app program implementation. The servlet
engine is also responsible for providing a richer functionality. Just look
at the methods in the javax.servlet and javax.servlet.http packages.
Leaving aside the issue of performance (I'm sure I could code a servlet
engine slower than your Aunt Matilda's CGI script), I think that programmer
productivity, and suitability for constructing large-scale apps is really
the key issue. Especially when you add in the ability to separate
business/data logic from presentation logic through the combination of
servlets-beans-JSP.
>From 20,000 feet, CGI and servlets look the same, but...the air is pretty
thin up there.
Just my $0.02.
----------
> From: Chang You-Sheng <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: Servlets vs CGI
> Date: Monday, June 21, 1999 5:09 PM
>
> Maybe I didn't explain my view related CGI very clear. What I try to say
is as
> following:
> Maybe, we can view CGI as a SPECIFICATION NOT A IMPLEMENTATION. Since
as I
> understand, or what I know when the people are talking about CGI, they
realy
> mean some specific implementation of CGI such as Perl CGI or C CGI or C++
CGI.
> And all those are just specific implementation of CGI. In the OLD TIME.
those
> CGI implementation will create a seperate process from web server.
Because I
> have done the CGI programming in the past. This is what I understand. And
today
> the vendor like Microsoft, SUN and ColdFusion etc. they use ASP, JSP,
Java
> servlet to implementing same functionality. Yes, there are some
additional
> functions in the new technology. However, from CGI point of view, those
> technologies are IMPLEMENTING CGI.
>
> I don't know whether I state clearly or not. If so I really like to
know
> what other people think about. Since now there are lot of confusing
related CGI,
> ASP, JSP,..
>
> thanks
>
> you sheng
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html