As much as Netbeans is my IDE of choice for all development needs, I have recently become quite a fan of IntelliJ. I've used IntelliJ IDE several times in the past and have always liked it, but the fact that you have to pay for the full version (which contains all the good stuff absent from the community edition) has always put me off. However, a fellow consultant working on the same project uses IntelliJ as his primary IDE, and recently when he was demoing all of the features I was quite impressed. So much so that I bought a licence!

So far the whole experience has been great. IntelliJ offers some awesome ways to structure projects (especially when a project is complex, for example containing multiple source directories), great integration with Spring and Hibernate (and just about everything else) and some very useful shortcuts and code generation tools. In simple terms IntelliJ allows me to be more productive within the project I am currently working on (and that's even factoring in the time taken to learn the new features!)

This brings me nicely to the second part of this blog post - one thing I am constanty doing is writing toString() methods for DTOs or other entity classes for logging/debug purposes, simply concatening the values of all the objects properties and returning a String. As you may know, when you have a large number of such classes each with an equally large number of properties this can soon become quite tedious....

No longer will I struggle, as a quick Google search lead my to an IntelliJ plugin aptly named "generate-toString". This clever utility adds another "toString()" option to the code generation menu (accessed by Alt-Insert) which allows you to specify which of the current classes properties should be included in a generated toString() method. Like the best things in life - simple, but brilliant!

Best wishes,

Daniel

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Daniel Bryant (Director) | Tai-Dev Ltd www.tai-dev.co.uk - IT Consultancy Services Specialising in JEE, Web 2.0 and RDBMS