That’s what I’m talking about!!!


Every so often I get myself into a jam. Typically it involves some deadline, a low-ball estimate I gave, or inaccurate progress reported against an individual assignment. When I get into these tight situations sometimes I pray. Sometimes I cheat, and sometimes I just bang my head and look stoopid. Then there are those times when I reach into my Idea bag of tricks and pull out something so wild that I amaze myself. Actually I don’t amaze anybody, its Idea that continues to amaze me…

What’s up? The name’s Cliff and your here because you terminate your line statements with a semicolon while enclosing the majority of your bright ideas in curly braces “{” and “}”. Today’s discussion involves what we do when we’re asked the impossible. Common requests to consider are things like, “I want you to rename all of your class and package names to include the initials J.D.E. and pay tribute to the CEO of the company” or “can you delete half of your source base and still have a functional app?” requests like these sometimes come from well meaning but heavily pressured project stakeholders or management and other times come from an innocent misuse of potentially offensive English. (I recall a scenario where racial terms “master” and “slave” proliferated our entire source base and needed to be cleaned up at the eleventh hour.)

Today I was saved by Idea’s dependency management elegance. You see I have the unfortunate task of cleaning up duplicated effort in the codebase (hereafter referred to as the fork) which resulted from two well meaning developers mis communicating with one another. (I was one of the guilty with a major problem in communication.) The fork (hereafter referred to as “the day the developer went dark”) consisted of duplicate classes residing in differing packages providing identical but incompatible functionality. There was supposed to be a “merge” (will now be aliased as a “best of both worlds”) after our last sprint wherein both coding efforts were to be reconciled into one common mixture of great ideas. Midway through my analysis of “the day the developer went dark” I realized that there would be a great deal of effort involved, much more than grabbing classes from one package and using them in another. It then became an exercise of re-inventing the ideas the were reinvented from other ideas that came from a port of yet further ideas. In short I had to recode some logic.

Idea to the rescue
This time I knew it was there. It was one of those features that caught my eye about a month ago when I said, “Wow that menu option look like it’s worth exploring. I’ll have to play with it soon because I feel a need coming on.” And right when I said that I tucked the location to the option away in the left-rear corner of my brain. (I lost sleep that night because it’s hard to relax when you’re lying on a nugget.) So when I started puzzling over how I was going to track down all the related objects and references to one branch of the day the developer went dark I needed only to cycle through the main file menus until I tripped over what resembled the familiar option. Analyze Dependency Matrix was the title. It sounded real cool too. Matrix, like I was gonna bend over backwards and doge bullets in slow-mo possibly catching one in the corner of my shiny black ankle length leather overcoat. I took the option and lo and behold! What I saw was a visual graph. It was a little intimidating at first but a quick gander at Idea’s help docs cleared things immediately. I could easily click and highlight either packages or invidividual classes to bring up color cues of what was tied to them and what was calling into them. Within ten minutes I had the entire branch cleaned. Comparing that to a more traditional approach of find-usages or even a more cave-man like file search in project paints a vivid picture of why IntelliJ Idea should be spinning along on every Java developer’s hard drive.

Keep it locked on this post because I want to put a screen-shot of the Matrix up but I also want to hit publish before lunch is over so I don’t have time right now.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s