1942 Classes: Statistics About Spring 2.5
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. First: Spring 2.5.
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.
Spring is a framework of Factories, Beans, and Exceptions
There are 1942 classes currently in Spring. Of those, 213 classes contain the word Factory. Even more classes contain the word Bean. Spring is clearly a framework that loves factories and beans. There is even a FactoryBean class.
Another high score partial class name is the Exception. Exactly 197 classes have that in their class name. From the humble BindException to the fine-grained JdbcUpdateAffectedIncorrectNumberOfRowsException.
Class Cloud (click to enlarge)
Top 10 of partial class names
- Bean: 239
- Factory: 213
- Exception: 197
- Abstract: 158
- Context: 112
- Source: 97
- Utils: 89
- Transaction: 85
- Resolver: 79
- Request: 78
Longest class name
The grand prize goes to two classes: AbstractInterruptibleBatchPreparedStatementSetter and AbstractTransactionalDataSourceSpringContextTests
Both have a length of 49 characters!
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!
From http://stuq.nl
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)






Comments
Jeroen Wenting replied on Tue, 2008/12/02 - 5:08am
Ronald Miura replied on Tue, 2008/12/02 - 8:36am
Yevgeny Nyden replied on Tue, 2008/12/02 - 9:44am
in response to:
Jeroen Wenting
[quote=jwenting]and to think Spring was created because EJB was too big, cumbersome, complex, and heavyweight :)[/quote]
... still, I don't think you can consider the core Spring functionality "...too big, cumbersome, complex, and heavyweight" comparing it to what EJB used to be (prior v3).
Mario León replied on Tue, 2008/12/02 - 11:49am
Brian S O'Neill replied on Tue, 2008/12/02 - 12:04pm
How about Java 6?
http://www.wordle.net/gallery/wrdl/355036/JavaSE_6
Daan van Etten replied on Tue, 2008/12/02 - 2:29pm
Daan van Etten replied on Tue, 2008/12/02 - 2:29pm
in response to:
Brian S O'Neill
Jeroen Wenting replied on Wed, 2008/12/03 - 5:47am
in response to:
Yevgeny Nyden
[quote=jwenting]and to think Spring was created because EJB was too big, cumbersome, complex, and heavyweight :)[/quote]
... still, I don't think you can consider the core Spring functionality "...too big, cumbersome, complex, and heavyweight" comparing it to what EJB used to be (prior v3).
[/quote]
Depends on how you see it. Spring of course does far more than EJB ever did, and as such can be larger.
But one has to wonder whether it might not be better to split it into several (sub)projects that are (more or less) independent, a more modular structure than is currently the case where you have to Spring the trap on the entire elephant (which was one of the main criticisms of EJB1/2) rather than take just the bits you want without having to bother about the rest.
Personally, I have used Spring in its 1.x and 2.0x incarnations, but really only the IOC/DI container. And even for that you have to work your way through hundreds if not thousands of pages of books and documentation in order to really figure out how it all works if you want something that's a bit different from what the defaults provide.
Liam Knox replied on Thu, 2008/12/04 - 6:19am
I really think you posted this on the wrong site, shouldnt this be on
http://thedailywtf.com/
?
Martin Flores replied on Thu, 2008/12/04 - 10:57am
Daan van Etten replied on Thu, 2008/12/04 - 2:43pm
in response to:
Martin Flores
Hi martinicr,
I'm currently working on the Tomcat statistics. If you have requests for other projects, let me know!
Daan (not Brian ;-))
Martin Flores replied on Thu, 2008/12/04 - 3:36pm
Oops... sorry... you know the names confusion. So believe it or not we found your class cloud very interesting for that reason a couple of friends and me... (classic java geeks) are thinking to put your graph in a t-shirt so I would be interesting count with several versions of class cloud. We work with Spring, Struts2, Hibernate, Tomcat... so if you are planning to create more cloud classes will be happy to create a collection jajaja.
Regards.
Daan van Etten replied on Thu, 2008/12/04 - 4:13pm
Hi martinicr, what a great idea! If you like, you can send me your email address. I'll start working on the stats for the projects you mentioned.
When I finish the clouds I will send them to you. (My email is my first name @ stuq nl)
Niels De Feijter replied on Fri, 2008/12/05 - 2:47am
Hi Daan,
Very nice! Are you planning to share you script with the rest of the world? I would love to hang the walls of our software architect's cubicle with pictures generated from our own products :)
Cheers
Daan van Etten replied on Fri, 2008/12/05 - 3:07am