tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Manolache <cos...@eng.sun.com>
Subject Re: Tomcat, Catalina, and Java2
Date Tue, 11 Jul 2000 05:52:09 GMT
To give you a different perspective,


> > Newbie question here, but is all of the Catalina code still experimental,
> > i.e. none of it is used in 3.x?
>
> None of the Catalina code is directly used in Tomcat 3.x, although Catalina
> has influenced the current design of some Tomcat 3.x functionality.

- Tomcat uses the session management code from Catalina ( not the latest one
thought, there is a big effort in reusing code from Catalina due to big
internal interdependencies ). Tomcat session manager is independent of tomcat
core, and uses just an "adapter" to plug it in.

- I am in process of porting back the partial HTTP 1.1 implementation from
Catalina,
and maybe ( I'm not very sure ) the static caching of objects. It's good for
benchmarks,
but probably not in production.

- probably few hacks in authentication will be added back to the main branch
( storing the user in the session to avoid multiple auth in basic)

> To get a feel for why Catalina exists, you need to go back a little -- to the
> code that Sun originally contributed to the Jakarta project (which
> subsequently was massaged into Tomcat 3.0).  The code then was a total
> disaster from a maintenance and enhancement point of view -- the code paths
> that were actually followed when handling servlet requests fit the classical
> description "spaghetti code", the Javadoc comments were mostly non-existent
> or non-current, and there was no overall architecture documentation.

I fully agree, but I want to add that tomcat started with a very good design
and patterns ( thanks to James ), and that's what allowed us to clean up
the spaghetti.

Tomcat 3.2 have very little code in common with tomcat 3.0 - and none in
the critical path (AFAIK). It is a full rewrite, component by component,
and if something is missing - 3.3 will take care of that.

The design of tomcat is still based on the original patterns, plus few more
enhancements for smoother integration into web servers.

> * Clearly defined component-based architecture based
>   on Java interfaces.  Tomcat 3.x is moving in this
>   direction, but it's not as clearly documented.

Documentation will show up in the next few weeks. Both tomcat
and catalina are component-based architecture, the difference is
in how this is done - tomcat uses the same path as Apache,IIS,
NES, while Catalina is similar with Jigsaw ( maybe Dynamo ).

That's probably the biggest architectural difference, and affects
the request processing and the critical path.

Another big difference is that tomcat tries very hard to
keep the modules independent of the core design and
abstractions ( by using extensive use of "Adapters")

> * Plug-replaceable components for virtually everything,
>   so that servlet container implementors or integrators
>   can customize it.  (Tomcat 3.x does this for some
>   components, but not all.)

Can you give some examples ?

> * Extensible request processing, using a well-defined
>   mechanism (Valves) that has lower runtime overhead
>   than the current Tomcat approach (RequestInterceptors).

That's of course an assertion that have to be proven :-)
So far the numbers show a different picture.


> * Support for integration with the existing APIs of a larger
>   server, such as logging and user authentication.  (Particularly
>   in the area of authentication realms, Tomcat is getting closer
>   to the Catalina approach).

:-)
Tomcat model for authentication ( and session ) is the use of
"Adapter" pattern - i.e. you use whatever API you want, and
just write an adapter to plug it into tomcat.

Right now both tomcat and catalina are using a simple
user/password model, execept that in catalina it's part
of the set of interfaces while in tomcat is just an implementation
detail.



> * Ability to use Catalina as the basis for non-HTTP servers
>   (although such servers are unlikely to be built in to the
>   standard release).  Tomcat 3.x is only interested in
>   serving HTTP requests.

Tomcat 3.x is interested in serving protocols that maps to the
HTTP req/res, and supports 4 different protocols right now.

Tomcat is based on components that can be used in any
other server ( very soon you'll see POP3 and SMTP servers)

Anyway - the main architectural difference remain in the patterns
used for request processing, and also in the way modules are
structured.  I would be happy to see Catalina prove that the
patterns it uses are better - that would mean interesting times
for IIS, NES and Apache ( that still use the same old set of patterns)

Costin


Mime
View raw message