37 Factories: statistics about Tomcat 6
may want to subscribe
to the RSS feed.
Thanks for visiting!This article is part of the 'Java Project Statistics' series.
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.
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:
A 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)
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:- 1942 classes: statistics about Spring 2.5
- 8.47% is a Resource: statistics about Wicket
- 37 Factories: statistics about Tomcat 6
- 76 Events: statistics about Hibernate 3.2.2
Subscribe |



Very nice idea to split classnames and count the fragments. Neatly exposes bad programming habits.
Peace
-stephan
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.[...]…
What piece of software have you used to create this class cloud? Thanks!
Hi Pawel,
I use Wordle.
- Daan
Leave your response!
(What is RSS?)
.read popular posts
.recent comments
.categories
.blogroll
.now reading
Currently reading:
Recently finished:
View all books
jWeekend
jWeekend: Intensive, 1 and 2 day Java Technology, OO, JPA, Spring courses for busy people.
Recent Posts
Twitter
About
I'm Daan, and this is my blog. I'm a Java software developer, and at work we build open source software for the health care industry. We apply Scrum and some principles of eXtreme Programming.
We use things like Java, Spring, Hibernate, Wicket, OSGI, on Apple hardware.
Feel free to contact me via Skype.