Home » Author Archives: Rafael Winterhalter

Author Archives: Rafael Winterhalter

Rafael Winterhalter
Rafael is a software engineer based in Oslo. He is a Java enthusiast with particular interests in byte code engineering, functional programming, multi-threaded applications and the Scala language.

Make agents, not frameworks

java-logo

Ever since their introduction, Java annotations have become an integral part of the APIs of larger application frameworks. Good examples for such APIs are those of Spring or Hibernate where adding a few lines of annotation code implements quite complex program logic. And while one can argue about the drawbacks of these particular APIs, most developers would agree that this ...

Read More »

Java 8 default methods can break your (users’) code

java-logo

At first glance, default methods brought a great new feature to the Java Virtual Machine’s instruction set. Finally, library developers are able to evolve established APIs without introducing incompatibilities to their user’s code. Using default methods, any user class that implements a library interface automatically adopts the default code when a new method is introduced to this interface. And once ...

Read More »

Memory leaks and memory management in Java applications

java-logo

One of the more prominent features of the Java platform is its automatic memory management. Many people translate this feature erroneously into there are no memory leaks in Java. However, this is not the case and I am under the impression that modern Java frameworks and Java-based platforms, especially the Android platform, increasingly contradict this erroneous assumption. In order to ...

Read More »

Extending Guava caches to overflow to disk

java-logo

Caching allows you to significantly speed up applications with only little effort. Two great cache implementations for the Java platform are the Guava caches and Ehcache. While Ehcache is much richer in features (such as its Searchable API, the possibility of persisting caches to disk or overflowing to big memory), it also comes with quite an overhead compared to Guava. ...

Read More »

Advanced Java generics: retreiving generic type arguments

java-logo

After their introduction in the JDK5, Java generics quickly became an integral element of many Java programs. However, as easy Java generics seem at first glance, as quickly a programer can get lost with this feature. Most Java programers are aware of the Java compiler’s type erasure. Generally speaking, type erasure means that all generic type information about a Java ...

Read More »

The infamous sun.misc.Unsafe explained

java-logo

The biggest competitor to the Java virtual machine might be Microsoft’s CLR that hosts languages such as C#. The CLR allows to write unsafe code as an entry gate for low level programming, something that is hard to achieve on the JVM. If you need such advanced functionality in Java, you might be forced to use the JNI which requires ...

Read More »

Subtyping in Java generics

java-logo

Generic types introduce a new spectrum of type safety to Java program. At the same type, generic types can be quite expressive, especially when using wildcards. In this article, I want to explain how subtyping works with Java generics. General thoughts on generic type subtyping Different generic types of the same class or interface do not define a subtype hierarchy linear ...

Read More »

Object-based micro-locking for concurrent applications by using Guava

java-logo

One of the presumably most annoying problems with writing concurrent Java applications is the handling of resources that are shared among threads as for example a web applications’ session and application data. As a result, many developers choose to not synchronize such resources at all, if an application’s concurrency level is low. It is for example unlikely that a session ...

Read More »

cglib: The missing manual

java-logo

The byte code instrumentation library cglib is a popular choice among many well-known Java frameworks such as Hibernate (not anymore) or Spring for doing their dirty work. Byte code instrumentation allows to manipulate or to create classes after the compilation phase of a Java application. Since Java classes are linked dynamically at run time, it is possible to add new ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close