Tag Archives: design pattern

[Java] Example of Spring IoC (Inversion of Control) – dependency injection

Tired of changing your Java code and recompiling project when you want to change objects’ properties? The one possible solution is to create external file keeping all desired data and creating objects by hand. But… Wait a minute, doesn’t Java … Continue reading

Posted in coding, enterprise edition, java | Tagged , , , , , , , , | 1 Comment

[Java] The fastest singleton

Everybody know how to write thread-safe singleton. Consider standard approach: public class Singleton { private static Singleton instance; private Singleton() {} public static synchronized Singleton getInstance() { if(instance == null) { instance = new Singleton(); } return instance; } } … Continue reading

Posted in coding, java, standard edition | Tagged , , , | 5 Comments