Category Archives: General Programming

Info related to general programming topics in many different languages, including design patterns, object orientation, memory management etc

Design Patterns Series – Part Five: Adapter pattern

According to wikipedia: In computer programming, the adapter pattern (often referred to as the wrapper pattern or simply a wrapper) is a design pattern that translates one interface for a class into a compatible interface. The adapter pattern is commonly used when there is a need to access an object through the interface which doesn’t […]

Read More →

Design Pattern Series – Part Four: Observer pattern

Today I’m adding another important design pattern to the toolbox. Observer Pattern is commonly used and quite powerful. The Observer Pattern defines one to many dependency between objects so that when one object changes state, all of it dependents are notified and updated. We can create a class structure for the pattern ourselves from scratch […]

Read More →

The Biggest Java WTF

Today one of my co-workers send me the following link. As I couldn’t believe my eyes, I have tested it myself. WTF? package wtfjava; /**  * This program really HANGS!!!!  * @author kris  */ public class Main {     /**      * @param args the command line arguments      */     […]

Read More →

Design Patterns – Part Three: Singleton

Today I will describe the Singleton pattern, one of the simplest, yet generating active discussions all over the net. Some people consider it to be an antipattern. We have many different flavours of this pattern, singleton can be thread safe, lazy loaded, eagerly loaded, implemented as a static class or enum. Simple thread safe implementation: […]

Read More →

Design Patterns Series – Part Two: Template Method

A typical template method pattern consists of the abstract base class which defines one or more template methods (usually set as final) and some abstract methods which the subclass has to implement. Template method defines common algorithm where some of the steps are implemented by subclasses. A Template method pattern provides a skeleton for performing […]

Read More →

Design Patterns Series – Part One: Strategy Pattern

The Strategy Pattern is a first pattern described in a series of post I’m planning to make regarding this topic. The Strategy pattern allows us to select a specific algorithm at runtime and its one of the simples design patterns to grasp. The scenario described on the diagram below shows a simple usage of the […]

Read More →

Simple Guide to basic Javadoc

Javadoc tool is in my opinion one of the most underestimated tools available for a Java developer. Recently I have started digging into some opensource projects when looking for a nice examples of design patterns and I was surprised at high quality of their code in terms of commenting. This is something I, and many […]

Read More →

Apache Click on Google App Engine – Hello World Example

Hello World! If this blog would run on App Engine and was build with Apache Click I could finish this tutorial right here :). But more seriously, I will describe short step by step tutorial on how to get started with Apache Click on Google App Engine. I’m assuming that you have GAE plugin for […]

Read More →

Getting started with Apache Click and Eclipse Galileo

Last couple of days I read here and there about Apache Click, which is now in version 2.1.0. It looks preety cool and easy to learn, so I decided to give it a try and see for myself. I understand that its cool to learn things using vi and shell only, but when you tried […]

Read More →

Jasperberry – the most dynamic reports ever.

Today I will describe in short my latest and simplest quick and dirty trick, generating jasper report dynamically. Jasperberry is a component written very quickly to help me generate pdf report in a situation where I don’t know the number of columns I will have, I don’t know their widths, the data they contain etc, […]

Read More →