InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

SonarJ Community Edition Offers Architecture Analysis and Management for Java Applications

Posted by Srini Penchikala on Feb 09, 2009

Sections
Development
Topics
Architecture ,
Java ,
Artifacts & Tools

SonarJ Community Edition offers architecture analysis and management for small to medium size Java applications. hello2morrow, the company behind SonarJ software, recently launched the free version of the architecture analysis tool. The community edition can be used to analyze Java applications with upto 500 internal classes (approximately 50 to 60 KLOC).

Architecture management can help with clear and cycle free dependency structures as well as improve testability and reusability of code. Software architects can use SonarJ to define architecture and quality rules, which will then be monitored in the IDE (Eclipse) on the developer's workspace. Tools like SonarJ help the architects to integrate architecture management earlier in the development process.

InfoQ spoke with Alexander von Zitzewitz, CEO of hello2morrow, about the motivation behind releasing the community edition and the future road-map of SonarJ project.

What was the motivation behind the release of community edition of SonarJ?

Our old pricing model was based on the number of users using SonarJ, but independent from the project size. But the benefit of SonarJ is closely related to the size of the project. Although SonarJ was already free for open source and non-commercial use, we have been approached by many developers to offer a low cost personal license. We also saw, that many projects are still using very basic dependency checking tools like JDepend or Macker. With SonarJ we had a solution that was far superior, but only available to larger projects with a tool budget. So we were thinking about a way to make our solution available to a much larger user base without seriously eroding our revenue base.

We decided to add the project size as a second parameter to the pricing model. We also decided to make SonarJ free for projects with up to 500 classes. This limit already supports the majority of projects and equals about 50 to 60 KLOC. We wanted to make sure that the Community Edition of SonarJ could be used on serious projects. So users can reap the benefits and save time and money by avoiding all the bad consequences of structural erosion.

To make the equation complete, projects with up to 3000 classes pay less for a commercial license than before, bigger projects have to pay more. We think that this approach is much more balanced and fits well with the value provided by integrating SonarJ into the development process.

How does SonarJ compare with other tools like Structure 101?

Structure101 is a powerful tool with a good intuitive user interface. Like SonarJ it supports the definition of an architecture model. On the other hand I think that our architecture meta model and the way we visualize the architecture fits better with larger projects. SonarJ supports the concept of a larger project split into subprojects and not only supports horizontal, but also vertical slicing of projects. Although you can achieve a similar thing in Structure101 by creating two or more separate architecture models, this requires more effort and is not really intuitive. For larger projects the vertical cutting (creation of vertical slices) is a very important technique to keep the size of architectural artifacts manageable.

How does SonarJ tool help with design and architecture enforcement compared to other techniques such as using Aspects, Code Inspections or Model Driven Architecture (MDA)?

First of all using SonarJ is completely non-intrusive and can be used on any Java project, new or old. Using aspects is quite intrusive (you have to integrate AspectJ into your build process) and is not really backed by an architecture meta model. Although you can define powerful restrictions there is never a guarantee for completeness. Every architect will probably use a different style of restrictions. Moreover I think that the complexity of defining a serious set of restrictions tends to get out of control quickly. The architecture meta model behind SonarJ makes it easy to make sure, that you have a complete coverage of all the dependencies in your code.Neither the code nor the build process needs to be touched to use SonarJ.

Code Inspections are not a serious alternative to automatic checking of architectural and quality rules. It takes way too much time and there is a great risk of overlooking serious structural problems.

MDA is another strategy to create applications. If most of the code is generated the benefit of analyzing the generated code for architectural flaws is probably quite small. A good code generator will hopefully make sure, that the structure of the generated code is clean. So if you are using MDA successfully and most of your code base is generated you will probably not need SonarJ.

What is the future road map of SonarJ project?

Currently we are working on release 4.1 which is scheduled for March of 2009. The focus of this release is improved usability and some fine tuning of our architecture meta model. Later this year we think about adding plugins for other IDE's like IntelliJ or NetBeans. We also might launch a C# version of SonarJ called SonarShark.

Srini Penchikala currently works as Security Architect and has 17 yrs of experience in software product management.

Lattix as a nice alternative by Han van Roosmalen Posted
Re: Lattix as a nice alternative by Alexander von Zitzewitz Posted
Re: Lattix as a nice alternative by Srini Penchikala Posted
Structure101 by Ian Sutton Posted
  1. Back to top

    Lattix as a nice alternative

    by Han van Roosmalen

    Thanks Srini,

    Though I like the workings of SonarJ. I must add that it has more competitors then Structure 1on1 or JDepend.

    Both with SonarJ and Lattix you will be able to create logical architecture diagrams and monitor and prevent architecture erosion during the application life cycle, which is absolutely required if you want to keep a quality rich, agile and most desired a maintanable application.

    Lattix takes a slightly different approach by using a Dependency Structure Matrix and does not show detailed graphs. This means that you will see the Desired vs. the realised architecture implementation in a single matrix. This matrix scales extremely well for large systems. Personally I like this approach since the matrix is very easy to set-up and maintain. It takes about half an hour to understand the basics of both the approach as well the tool usage. In most cases SonarJ and Lattix are comparable except for the approach.

    So I like to propose when evaluating an architecture tool that is not only suited for Java, C, C#, but also for Delphi, Ada, Cobol, Spring, Hibernate, Oracle (database and PL/SQL), MS SQL Server and Sybase SQL, that you at least trial Lattix as well as SonarJ and see for yourself what works best for you.

    More information on Lattix and a downloadable trial can be found at: www.lattix.com

    Han van Roosmalen
    Software Architect
    (www.software-architectuur.nl)

  2. Back to top

    Re: Lattix as a nice alternative

    by Alexander von Zitzewitz

    I agree that Lattix definitely belongs to the alternatives in our market segment and covers more platforms than we do.

    But I should mention that the SonarJ Exploration View provides exactly the same information as the dependency structure matrix in a graphical way. Instead of using cells we use bows of different thickness depending on the number of dependencies. Bows on the left side represent cells in the lower left half of the matrix, bows on the right side represent cells in the upper right half.

    Alexander von Zitzewitz
    hello2morrow Inc.

  3. Back to top

    Structure101

    by Ian Sutton

    As one of the guys behind Structure101 (and so not maximally objective ;-), I should comment briefly on your view of how SonarJ compares.

    SonarJ supports the concept of a larger project split into subprojects and not only supports horizontal, but also vertical slicing of projects. Although you can achieve a similar thing in Structure101 by creating two or more separate architecture models, this requires more effort and is not really intuitive.

    Not surprisingly, I can't agree with the last bit. Personally, I much prefer several diagrams, each telling their own little story, to attempting to fit everything into a single monolithic diagram. I also suspect that this approach scales better. But, like I say, I'm not the most objective judge of these things…

    Cheers,
    Ian

  4. Back to top

    Re: Lattix as a nice alternative

    by Srini Penchikala

    Hi Han,
    Lattix tool looks interesting. I have used SonarJ and Structure 101 in the past, so I am curious about how Lattix compares with these tools. I will check it out.
    Thanks
    Srini

Educational Content

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?

Wrap Your SQL Head Around Riak MapReduce

Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.