Category: Design

All the stuff related to code quality and design patterns.

The Art of Debug Logging

The Art of Debug Logging

Almost everybody is well equipped with logging essentials. But, only a few understand the purpose and power of the debug logs. Lets just refresh our basics as far as debug logging is concerned. To me personally, a best practices reminder time to time, inspires me to write quality code. WHEN EXACTLY DO WE NEED IT? …

+ Read More

SonarQube: Using PostJob in Plugins

SonarQube: Using PostJob in Plugins

The last post was all about creating a new plugin for sonar. Now, lets get off the beaten path and create a post job in a plugin instead of a decorator or sensor. But, first it is important to understand the difference. Please read the previous articles on sonar if your haven’t gone through them …

+ Read More

Coding Custom SonarQube Plugin

Coding Custom SonarQube Plugin

This will be a continuation of the sonar series in code quality section. This article is for users who have been using sonar and wish to extend and explore the possibilities of customization. Go through the previous posts if you already haven’t: Setting up sonar Sonar analysis using eclipse plugin If you already use sonar, …

+ Read More

Sonar Analysis From Eclipse

Sonar Analysis From Eclipse

Sonar is a great tool for ensuring quality and maintainable code. Sonar is like a code reviewer every developer should have. One shouldn’t wait for a formal code review and peer code review to find fault with one’s own code. So, the best way of writing quality code is to run a sonar analysis after …

+ Read More

Admiring and Understanding LinkedBlockingQueue take Method

Admiring and Understanding LinkedBlockingQueue take Method

In order to admire the code of the implementation of the BlockingQueue, lets have a look at the LinkedBlockingQueue take method. Lets go through the code line by line, understanding the role of each line of code. Line 4: final AtomicInteger count = this. count; In case you already know, AtomicInteger is used for atomic modifications to integers. …

+ Read More

JavaEE CDI in one page

JavaEE CDI in one page

I’ve been reading and checking out the (javaee cdi) CDI- Context and Dependency Injection in JavaEE lately. The more I read, more I fall in love with it. I’ll try and make the article short and less painful for you. And will quickly brush over the important concepts covered in the CDI. Important Basic Features one …

+ Read More

So, Singleton or Monostate?

So, Singleton or Monostate?

Continuing with the design pattern fun, lets talk about one of the most commonly used pattern, Singleton and an alternative called Monostate. I too wrote about singleton pattern relative to Joshua Bloch’s Effective Java a few days back. The Basic Difference in Two Well what is this monostate we talk about? Monostate is very similar …

+ Read More

Generics And Parameter Type Hiding

Generics And Parameter Type Hiding

Generics is an essential ingredient for a extensible and crafty design. When used wisely, generics make a programming language look good. Spiderman has reminded us repeatedly that with great power comes great responsibility. With all the extensibility we might toss the whole point type safety if generics are not used carefully. The following is a discussion …

+ Read More