The Artima Developer Community
Sponsored Link

Java Buzz Forum
Fight evil with the Metrics Plug-in for Eclipse

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic    
Flat View: This topic has 0 replies on 1 page
Oliver Burn

Posts: 30
Nickname: oburn
Registered: Jun, 2003

Oliver Burn is a solutions architect for KAZ Technology Services.
Fight evil with the Metrics Plug-in for Eclipse Posted: Jun 9, 2003 9:22 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Oliver Burn.
Original Post: Fight evil with the Metrics Plug-in for Eclipse
Feed Title: Oliver's Blog
Feed URL: http://sedoparking.com/search/registrar.php?domain=®istrar=sedopark
Feed Description: Contains the rantings of me. The thoughts are all personal and do not reflect at all on the companies I work for. (mumble: damn lawyers!)
Latest Java Buzz Posts
Latest Java Buzz Posts by Oliver Burn
Latest Posts From Oliver's Blog

Advertisement

Everybody has a pet thing about software design that they absolutely hate. Examples might include: use of multiple inheritance, over abstraction, leaky abstractions etc. My pet hate is circular dependencies. I believe they are evil, and Java makes it all to easy to do.

An example of a circular dependency is having three artifacts (could be a Java class, interface or package) with the following dependencies:

  • A depends on B
  • B depends on C
  • C depends on A

This means that implicitly that A depends on C, and C depends on A. So what I hear you say? Well, IMHO all good software design is broken into components/layers/tiers with very clear hierarchical one-way dependencies. In the example above, it is not possible to make a change to any artifact without (potentially) affecting the others. Or from a configuration management perspective, it is not possible to release artifacts separately.

Well I discovered a really cool plug-in today for Eclipse called Metrics. It produces many metrics about the Java code in your project. The really nice feature is being able to analyse for circular dependencies - something it calls a "tangle" (nice name). Here is an example graph it produces. Certainly a lot easier that using JDepend, so I give it the big "Thumbs Up".

Side note, I used to take my hate of circular dependencies to the extreme - I would not have circular dependencies between classes and interfaces in the same package. I had the pleasure of working for several years with Matt, who is one of the most talented developers I know. Eventually he convinced me to relax this, primarily because Java does not have the notion of forward declarations (like C++).

Read: Fight evil with the Metrics Plug-in for Eclipse

Topic: ctl+shift+v in IDEA Previous Topic    

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use