About software development for the enterprise. Focus on Java EE and more general Java platforms.
You'll read a lot about Conferences, Java User Groups, Java EE, Integration, AS7, WildFly, EAP and other technologies that hit my road.

Tuesday, February 8, 2011

GlassFish City - Another view onto your favorite application server

06:29 Tuesday, February 8, 2011 Posted by Markus Eisele
,
Have you ever wondered, how GlassFish would look like? I mean .. not the well know logo. Or even the non existent Oracle GlassFish logo. More in terms of daily live? What would GlassFish look like, if you transform the sourcode into something that you "could" compare to dimensions you probably have a feeling for. I stumbled about an awesome tool a few months ago. And always being on the hunt to present new view for well known things I had the chance to run this analysis today. Get excited ...

GlassFish City
If you are into Enterprise Architecture and ever have heard about software landscapes, you probably know, what will follow. I used a tool called CodeCity to visualize the project. CodeCity is an integrated environment for software analysis, in which software systems are visualized as interactive, navigable 3D cities. The classes are represented as buildings in the city, while the packages are depicted as the districts in which the buildings reside.

GlassFish City from front
GlassFish City from back

EJB District

Apache District

Logging District

The facts
In order to be able to use CodeCity, you first need to generate a MSE model. This is done with the help of inFusion. inFusion is an integrated environment for performing in-depth code and architectural reviews of object-oriented and procedural software systems, written in C, Java or C++. inFusion supports the analysis, diagnosis and quality improvement of your systems at the architectural, as well as at the code level. After the parsing you get some first basic facts for the GlassFish development trunk 3.1-b41 according to inFusion:
445613 lines of clean code.
Packages: 1072
Classes: 10427
Methods: 69852
Attributes: 30885
Parameters: 62484
Local Var: 78937
Annotations: 149
Annotation References: 5515
Calls: 191858
Accesses: 154880
Exceptions: 27304
Primitive Types: 0

Basic interpretation
Class hierarchies tend to be shallow and of average width (i.e. inheritance trees tend to have only few depth-level(s) and base-classes with several directly derived sub-classes)
Classes tend to contain an average number of methods; and are organized in rather fine-grained packages (i.e. few classes per package);
Methods tend to be average in length and having a rather simple logic (i.e. few conditional branches); Methods call several other methods from several other classes.
There are many other conclusions to draw and I simply presented the ones that got generated automatically. But the idea behind all this was simply to present an awesome picture and nothing more (for now :)).

What I learned
JRockit is awesome. The conversion from Java into the MSE model via inFusion took more than five minutes and consumed roughly 1.7 GB heap. One of the basic steps is analyzing the files, which took 21 seconds with HotSpot and 18 seconds with JRockit. Which is not too much but a little faster. Beside this, the whole calculation takes time. In general I was stuck for more than 30 minutes with calculating for the final city model.
Hope you enjoyed it! Happy to read about your thoughts!

Download Wallpaper 1440x900px
Wallpaper two. On Grey 1440x900px


Links and resources
Latest 3.1-b41 Source
CodeCity
Import Java System with inFusion
inFusion Trial

Further Background Reading