Kode Log

Change is now. Learn, unlearn & relearn.

Page 5 of 11

Item 13: Minimize the accessibility of classes and members

Data hiding and encapsulation is one of the building blocks of a great design. Well minimizing the accessibility seems to be a pretty obvious thing. Well, although it is, its benefits are worth mentioning. Decoupled Modules – Since the exposed… Continue Reading →

Observer Design Pattern

As I mentioned in my previous example for Strategy Design Pattern, that the design patterns are best understood with examples. Without wasting any more time, I’ll just define our simple problem. Problem: We have a newspaper say, “GlobalTimes” (fictitious name)…. Continue Reading →

Legacy Programming Languages: Need of the hour ?

On the 50th anniversary of COBOL in Aug 2009, a blogger Jeff Atwood shared some interesting statistics regarding COBOL (one of many legacy languages) and explained why COBOL is found “Everywhere & Nowhere”. You may call the statistics outdated now but mere… Continue Reading →

Legacy Programming Languages: Need of the hour ?

On the 50th anniversary of COBOL in Aug 2009, a blogger Jeff Atwood shared some interesting statistics regarding COBOL (one of many legacy languages) and explained why COBOL is found “Everywhere & Nowhere”. You may call the statistics outdated now but… Continue Reading →

Strategy Design Pattern

Design patterns are better understood when we try learning them with an example. Lets take up a problem here. Problem: Lets say there are Animals which can fly and those which cannot. Since, the world is constantly evolving, any animal… Continue Reading →

Builder Pattern For Complex Validations

So, here is an extensible API for complex validations. I’ve written a small piece of code for common validations. The code can be extended to introduce more complex validations. Highlights – Builder Pattern Extensible code Non-instantiable Validation class Used a… Continue Reading →

Item 12: Consider implementing comparable

Usually while thinking of real time examples for a code solution, one often ends up comparing two objects. e.g. listing the companies in IT in the reverse order of their turnovers. This needs some comparison between 2 instances of object… Continue Reading →

Item 11: Override clone judiously

Before talking on the clone method in java, I must list some very important facts. Object class has a clone method, but it is protected. So, it is not available to our objects.  One can always override the clone method,… Continue Reading →

« Older posts Newer posts »

© 2017 Kode Log — Powered by WordPress

Theme by Anders NorenUp ↑