76 Events: Statistics About Hibernate 3.2.2
Join the DZone community and get the full member experience.Join For Free
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.
what is hibernate?
hibernate is a free, open source java package that makes it easy to work with relational databases. hibernate makes it seem as if your database contains plain java objects like you use every day, without having to worry about how to get them out of (or back into) mysterious database tables.
hibernate listens very carefully
what immediately catched my eye was the amount of classes with event (76) or listener (52) in their name. there are many events in hibernate which can be catched. these events can have some related classes, like:
- the event itself (for example the autoflushevent )
- an interface (the autoflusheventlistener )
- a default implementation (the defaultautoflusheventlistener )
it almost surprised me there was no abstractautoflusheventlistener or a abstractautoflusheventlistenerfactory!
there are 57 factories, which is quite a lot outside of an industrial park. a lot of stuff can be created using factories, for example the basicproxyfactory , the cglibproxyfactory , the cachefactory , the classicquerytranslatorfactory and the mapproxyfactory . i would guess this is the most popular design pattern within the java world. factories are everywhere.
types and collections
luckily, there is also a lot of stuff directly related to the goal of hibernate. there are 85 classes with type in their name, and 54 have something to do with a c ollection .
there are basic types like the floattype and integertype . advanced types like the orderedmaptype and the orderedsettype . persistentcollection and basiccollectionloader . these class names look quite good!
class cloud (click to enlarge)
top 10 of partial class names
- type: 85
- event: 76
- factory: 57
- collection: 54
- cache: 53
- exception: 53
- query: 53
- listener: 52
- entity: 47
- sql: 39
longest class name
the longest class name of hibernate is the collectionfilterkeyparameterspecification , with 41 characters!
the api documentation describes this class:
a specialized parameterspecification impl for dealing with a collection-key as part of a collection filter compilation.
i thought api documentation was meant to clarify? at least the above contains some pointers (like the parameterspecification).
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!
here are all the articles in this series:
Opinions expressed by DZone contributors are their own.