Home » Java

37 Factories: statistics about Tomcat 6

29 December 2008 4 Comments
If you're new here, you
may want to subscribe
to the RSS feed.
Thanks for visiting!
This article is part of the 'Java Project Statistics' series.

Tomcat 6 statistics class cloudFrameworks are growing with every release. Classes are changed, removed and added. In this series I zoom in on some well known projects and analyze their class names with completely meaningless statistics. This is the analysis of Tomcat 6.

To get these statistics, I wrote a script that analyzed all classes. They get chopped up on word boundaries, so for ContextAwareFactoryBean the words Context, Aware, Factory and Bean are counted. From the output I generated a Class Cloud.

Tomcat is definitely Context-aware

Tomcat consists of 956 classes. Of those, 55 classes contain the word Context, a percentage of 5.75%. Remember that every live object has its own ‘context’, and the word instantly loses a lot of meaning. The API documentation gives some clearance about the subject:

Context is a Container that represents a servlet context, and therefore an individual web application, in the Catalina servlet engine.

Factories? Sure!

Every self-respecting framework has factories. It nicely keeps the newcomers out and makes it ‘easier’ for the experts. Well, Tomcat has 37 of them. Just like Spring, Tomcat has a BeanFactory. The API documentation say just enough to leave me in confusion:

BeanFactory: Object factory for any Resource conforming to the JavaBean spec.

The AbstractObjectCreationFactory

It was love on first sight with the AbstractObjectCreationFactory. It all comes together in this single class. Every project should have this… until now you created all your abstract objects yourself, this is not needed anymore! All those years!

Unfortunately, I had it wrong. This is an abstract implementation of the ObjectCreationFactory interface. Further investigation revealed that this is part of the Digester package.

The Digester package provides for rules-based processing of arbitrary XML documents. 

I have no idea why this is in Tomcat. A leftover? Bad refactoring? Who knows?

 

Class Cloud (click to enlarge)

Tomcat 6 statistics Class Cloud

Top 10 of partial class names

  • Context: 55
  • Factory: 37
  • Task: 33
  • Ast: 33
  • Channel: 33
  • Rule: 32
  • Base: 31
  • Constants: 30
  • Handler: 30
  • Jsp: 27

Longest class name

The grand prize goes to: MbeansDescriptorsIntrospectionSource, with 36 characters!

The API documentation does not contain a description of this class, so I have no idea what it does…

Stay tuned for more useless statistics for other well known projects! If you have suggestions for which projects you want to see, please let me know in the comments!

This article is a part of the 'Java Project Statistics' series

Here are all the articles in this series:
  1. 1942 classes: statistics about Spring 2.5
  2. 8.47% is a Resource: statistics about Wicket
  3. 37 Factories: statistics about Tomcat 6
  4. 76 Events: statistics about Hibernate 3.2.2

4 Comments »

  • Stephan Schmidt said:

    Very nice idea to split classnames and count the fragments. Neatly exposes bad programming habits.

    Peace
    -stephan

  • Web 2.0 Announcer said:

    37 Factories: statistics about Tomcat 6…

    [...]Frameworks are growing with every release. Classes are changed, removed and added. In this series I zoom in on some well known projects and analyze their class names with completely meaningless statistics. This is the analysis of Tomcat 6.[...]…

  • Paweł said:

    What piece of software have you used to create this class cloud? Thanks!

  • Daan (author) said:

    Hi Pawel,

    I use Wordle.

    - Daan

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.