37 Factories: statistics about Tomcat 6

37 Factories: statistics about Tomcat 6

December 29, 2008 08:00 3 comments

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!

3 Comments

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

    Peace
    -stephan

  • Web 2.0 Announcer

    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ł

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

  • Hi Pawel,

    I use Wordle.

    - Daan

Leave a reply


Trackbacks

  1. Web 2.0 Announcer