The Java EE platform is huge, and I must confess I'm not aware of every one of its API. This is also true of the Spring framework, even though I think I know more of Spring than of Java EE. Lately, I was working on the version 10 of the Vaadin framework also known as Vaadin Flow. This version introduces routes. When a path is requested, the Vaadin Servlet displays the component. Routes are created by annotating specific components with the @Route annotation. Thus, Vaadin needs to list all annotat
Some time ago, I described a couple of surprising design choices in the JDK functional interfaces API. Lately, during a lesson, a student of mine proposed to shallow-copy an ArrayList by using the clone() method: I thought this is another API gotcha worth writing about. Cloning an object means a new object is created with the same state as the original one. As per the JavaDoc: Creates and returns a copy of this object. The precise meaning of 'copy' may depend on the class of the object.
This post is part of a series on learning the Clojure language. A common pattern in software development is the dynamic dispatching (or routing) table. The table is responsible for returning the relevant output for a specific input. In the Object-Oriented programming world, the object model would look something like the following.
For me, learning a new language is like getting into the sea: one toe at a time. Last week was the occasion to get familiar with the spec library. This week, we will have a look at some powerful macros. The problem When you’re not used to Clojure, parentheses may sometimes impair the readability of code. (- 25 (+ 5 (* 3 (- 5 (/ 12 4))))) The Kotlin equivalent of the above snippet would be: 25 - (5 + (3 * (5 - (12 / 4)))) Obviously, it’s related neither to Clojure nor
My new position requires me to get familiar with the Clojure language. In intend to document what I learn in a series of posts, to serve as my personal reference notes. As a side-effect, I hope it will also be beneficial to others who want to take the same path. There are already a multitude of great tutorials available: hence, each post will focus on a specific theme, that is specific to Clojure considering that most of my experience comes from OOP. As a newcomer to Clojure, a big issue of min
Two weeks ago, I started a completely new position at a new company: I'm now Developer Advocate (or to be more accurate, Developer Relationships Manager) at a company called Exoscale that offers Cloud Computing resources. There's nothing technical this week, but a lot about me. You're welcome to skip if that's not your cup of tea. Or read on if you'd like to know more about me.
In one of my previous posts, I described how to create a custom policy file for one's application. The process was manual and incremental. Because of that, it was painstakingly long, and hence not really useful. Since I wrote the post, I found a way to write the policy file under in a couple of hours, instead of days.
Java 8 introduced default methods in interfaces. This post describes what they are, and how they can change the design of APIs. A nominal design Earlier, in Java, interfaces could only have contracts - method signatures with no implementation. In order to add some implementation, a class was required, whether abstract or not. Hence, traditional API design then followed this hierarchy: The root interface defines the contractAn intermediate class implements common behavior i.e. BarIf