Static Factory Method is very popular pattern that simplify and clarify creation of objects. Can be used instead of or in addition to constructors.
Continue reading Static Factory Method patternPatterns
Design Patterns, Architectural Patterns, Idioms, Principles
Single Responsibility Principle (SRP) is the most important of SOLID software design principles. In this post we explain it and show how to apply!
Continue reading Single Responsibility Principle explainedComposed Method Pattern is the most useful and practical pattern I use. At the same time it’s not known by many developers. It’s the foundation of maintainable code.
Continue reading Composed Method Pattern explainedJava Singleton – enum implementation Singleton as enum is very simple to implement and very safe at the same time thanks to language guarantees for enum instantiation and serialization.
Continue reading Java Singleton – enum implementationJava Singleton – on demand initialization On demand initialization is extension of static final implementation. It will prevent eager initialization of the singleton instance, when other fields are accessed. Also known as Bill Pugh‘s solution.
Continue reading Java Singleton – on demand initializationJava Singleton – static final implementation It is the simplest and most common implementation of Singleton Design Pattern in Java. In this post we’ll show how to implement it correctly and explain why it works.
Continue reading Java Singleton – static final implementation