Introduction
Hi there!My name is Andrey Polunin. I’m a software developer. I decided to create this blog to publish my personal thoughts and different kinds of technical information related to software development....
View ArticleBook Review: “Real World Java EE Patterns Rethinking Best Practices”
Recently I finished reading the book “RealWorld Java EE Patterns Rethinking Best Practices” by Adam Bien. Generally speaking, the book is nice. It contains plenty of useful information, but you have to...
View ArticleJoda-Time Tutorial
IntroductionJoda-Time is a quality implementation of the date/time library for Java. It is intended to be a replacement for out-of-the-box JDK Date and Calendar classes. The design of Joda-Time allows...
View ArticleGet Sources and Javadocs with Maven
If you are using Maven and IDE to develop your Java projects, you can leverage a very easy way to get sources and javadocs for all your dependencies. Here it is:# mvn dependency:sources# mvn...
View ArticleBreaking Nested Loops in Java
Recently I was very surprised by the fact that even experienced Java developers may not know how to break nested loops effectively in Java. Probably that’s because the usage of this language feature is...
View ArticleDouble Brace Initialization in Java: Pros and Cons
A month ago I’ve encountered an interesting idiom for the Java programming language – double brace initialization. I suppose it emerged because the language currently doesn’t have convenient syntax for...
View ArticleClass Clusters in Java
IntroductionEvery good Objective-C programmer knows (or at least should know) what is a class cluster. Indeed this term is frequently mentioned in Apple documentation. It is one of the core patterns of...
View ArticleVariation of "State" Design Pattern in Java
This post is about a variation of “State” design pattern implemented in Java. I used similar approach in one of the projects I’ve been working on and I found it pretty useful. I assume you are familiar...
View Article"Singleton" Design Pattern in Java
Introduction Singleton design pattern is a very disputable issue. There are tons of discussions in the Internet about Singleton usage in application design, why to use it, why not to use it, why...
View Article"Observer" Design Pattern in Java
IntroductionThe Java Platform used to have support for Observer design pattern in the form of Observer interface and Observable class starting from its initial release. However a long time passed since...
View ArticleGet and Put Principle in Java Generics
Introduction It is hard to imagine modern Java development without using generics. While they look more simple and straightforward than C++ templates, it makes sense to invest some time to learn their...
View ArticleMystery of Collections.max() Declaration
Introduction I'm sure that every software developer who used Java for a while knows about Collections utility class. It contains a lot of useful methods which facilitate collection sorting, finding...
View ArticleJava 7 try-with-resources Statement
Introduction One of the most exciting features added in Java 7 is automatic resource management (a.k.a. try-with-resources or TWR). While basic TWR usage looks simple and straightforward there are...
View ArticleSecret Way of Returning Array from Method in Java
IntroductionThis post is like a little travel in time. It is quite short and doesn't bring a lot of practical sense, but rather a small historical trick that was known better in the early days of Java....
View ArticleLRU Cache in Java - Part 1
IntroductionCaching is an optimization technique which can dramatically boost application performance when used appropriately. There are a lot of different approaches to implement caching ranging from...
View ArticleLRU Cache in Java - Part 2
IntroductionIn the previous post I described LRU cache notion and showed how it can be easily implemented using LinkedHashMap data structure. But sometimes there is a requirement to implement LRU cache...
View ArticleEuclid's Algorithm in Java and Scala
Euclid's algorithm (a.k.a. Euclidean algorithm) is an efficient way of finding the greatest common divisor (gcd) of two numbers - the largest positive integer that divides both numbers without a...
View ArticleTomcat Administrator Login and Password
Tomcat web server has several web applications bundled with it which supply nice GUI to perform administrative tasks. In order to access them you need to authenticate with login and password. Where to...
View ArticleCreate Web Application with Maven (Tomcat, WAR File)
This post is a step-by-step tutorial which shows how to create a simple Java webapp project using Maven - a popular Java build tool. The project will be packaged into a WAR file and deployed to a local...
View ArticleHow to Avoid Null Checks in Java
I suppose every Java developer wrote checks similar to the following many times:if (obj != null) { // ... obj.doSomething(); // ...}Sometimes such code seems reasonable and its usage can be justified....
View Article
More Pages to Explore .....