Today I needed some performance improvements on a application that makes quite a few calls to a database. My default statement is not to implement performance improvements unless there is a issue. Well it just happened.
I did not wanted to change any of the existing code so what to do. In Spring 3.x the added a caching mechanism. Implementing this is simple:
@Configuration @EnableCaching public class SpringConfiguration { /** * Name of the available Cache */ public final static String CORE_CACHE = "default"; /** * Creates a in memory cache using a concurrent HasMap.
It took me some time to get all for the annotation builder into central but it’s there. see previous article for details on usage
Insert the following dependencies to your maven build:
<dependency> <groupId> nl.elucidator.patterns.builder.annotations </groupId> <artifactId>builder-annotations-processor</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId> nl.elucidator.patterns.builder.annotations </groupId> <artifactId>builder-annotations</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>net.jcip</groupId> <artifactId>jcip-annotations</artifactId> <version>1.0</version> </dependency> And you can generate all your builders.
I Think every body should know their patterns. the GoF created that book a long time ago but still not every body knows them by heart?
One of the patterns that is becoming more prominent in the ever-changing world is the requirement for immutable objects grows. The definition found in the books:
Defines an instance for creating an object but letting subclasses decide which class to instantiate Refers to the newly created object through a common interface Well that’s not exactly what we right?