DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. GlassFish City Revisited

GlassFish City Revisited

Markus Eisele user avatar by
Markus Eisele
·
Aug. 20, 12 · Interview
Like (0)
Save
Tweet
Share
3.88K Views

Join the DZone community and get the full member experience.

Join For Free
More than a year ago I looked at GlassFish from a very high level point of view and did a 3D analysis of the source code. Today I feel like updating the model and re-running the analysis.

The way we are looking at Code
On a day to day basis we are looking at source code. Classess, Packages, Deployment Units. And for what you usually do, this is far than enough. But there are rare cases where you have to get hand on very big code-bases. Need to navigate stuff or find a way to identify problems very quickly. In these cases alternate views onto your problem might help. CodeCity is one of those tools. Developed back in 2009 you can still use it if you are able to generate a FAMIX 2.1 format which is the input for CodeCity. 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. But let's start with some basics.

My first post about this kind of visualization featured a tool called inFusion. This was available for free or at least as a trial to generate the needed models for CodeCity. As of today it is only available as a demo version and a licensed versions. The first one isn't able to export the mse models. Thanks to the team at intooitus I was granted a license to be able to bring you the GlassFish city update. But please don't think that inFusion is only good for that. It's an eclipse based tool which provides intuitive insights, semantics-rich interpretations and matching refactoring recommendations, which identify and address inadequate underlying design decisions. So I will feature some more details about it later on this blog.

GlassFish
For now lets get back to the post. May I introduce GlassFish. More precisely the com.sun.*, org.glassfish.* and javax.* classes and packages that are contained in GlassFish 3.1.2-b15 which was shipped a few months back. On a high level overview (subsystems) this looks like this (thanks to Headwaysoftware for Structure101) :
The complete GlassFish is bigger and also contains work by apache, netbeans and others. Roughly 930K Lines of Code (No comment, no blank lines) and 10.824 Classes overall in 845 packages. The biggest classes are:
com.sun.ejb.containers.BaseContainer
org.apache.catalina.core.StandardContext
com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager
org.apache.catalina.connector.Request
com.sun.enterprise.deployment.EjbDescriptor

GlassFish Skyline
The skyline view is the most impressive one to me. I didn't publish it one year back but without any intention.
The biggest buildings represent the biggest classes from above. Starting right to left. To give you an impression, the StandardContext has 6341 lines of code (which is represented by it's dark blue color), it has a "height" of 390 methods and length and width are calculated based on the 114 attributes. The base container has a "height" of 198 methods but it's width and length are bigger based on 134 methods.

Overview Pictures
Now you know the basics about "city building". Time to look at the overview. The complete city from the front looks like this:
From the back:
And a view from the top which is probably the most commonly known one because many tools tend to use this kind of perspective:

Special Areas
Back in the days I started to look into some special areas. One was the Apache district. The Apache towers are more or less the same. You have some additional areas where you find Apache code. Those are highlighted in green and represent any occurrence of org::apache packages in the sources.


Another interesting area (at least to me) is the weld integration glue code (again, the little green in there). Remarkably less compared with the impact CDI has on the platform. I agree, that this simply is the "glue" and not the complete CDI implementation.

One last area of interest. The complete CMP container spreads over different packages. This is functionality which is going to be pruned with Java EE 7. Your last chance to take a look at it is here:
GlassFish

Published at DZone with permission of Markus Eisele, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Secure Your CI/CD Pipeline
  • Select ChatGPT From SQL? You Bet!
  • 5 Factors When Selecting a Database
  • Top Three Docker Alternatives To Consider

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: