Kode Log

Change is now. Learn, unlearn & relearn.


April 2013

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… Continue Reading →

HttpClient and Web Sniffers

Introduction When I say HttpClient, I talk about a package i.e. org.apache.commons.httpclient in commons-httpclient. HttpClient is used for making post and get request to particular URIs. And one can all kinds of things with the response and response headers. A… Continue Reading →

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… Continue Reading →

Validation API for Complex and Multiple Validations

I designed a very simple validation API when I was learning about Builder Pattern. Now, I have improved the code and used it in a small project. The code is now- Generic Can return return objects Has support for compound… Continue Reading →

Kth maximum element in unsorted collection

Finding the Kth maximum element in an unsorted array doesn’t seem to be a big deal. Because, we know that finding the maximum and if we keep on eliminating the largest element from the array. And this we will take… Continue Reading →

Item 15: Minimize Mutability

Confused what Item 15 is? Well, as I have already mentioned in my previous posts, ‘Items’ are 78 items mentioned in Joshua Bloch’s book ‘Effective Java’. Those, well versed with the items in Effective Java may read them as a… Continue Reading →

Item 14: In public classes, use accessor methods, not public fields

So, do you see what’s wrong with this code? Well, not much actually. Item 14 in effective java is pretty simple to understand. In fact its just a by product of using common sense while writing code. Problem with the… Continue Reading →

String Intern

  String#intern Probably you already know what it is, in case you don’t, please don’t stop unless you read and understand the whole thing.   String Interning String interning is a method where each distinct and immutable value of string… Continue Reading →

© 2018 Kode Log — Powered by WordPress

Theme by Anders NorenUp ↑