API evolution is something absolutely non-trivial. Something that only few have to deal with. Most of us work on internal, proprietary APIs every day. Modern IDEs ship with awesome tooling to factor out, rename, pull up, push down, indirect, delegate, infer, generalise our code artefacts. These tools make refactoring our internal APIs a piece of … Continue reading Defensive API evolution with Java interfaces
Tag: API
JavaBeans™ should be extended to reduce bloat
JavaBeans™ has been around for a long time in the Java world. At some point of time, people realised that the concept of getters and setters was good to provide some abstraction over "object properties", which should not be accessed directly. A typical "bean" would look like this: public class MyBean { private int myProperty; … Continue reading JavaBeans™ should be extended to reduce bloat
The depths of Java: API leak exposed through covariance
Java can be very tricky some times, especially in API design. Let's have a look at a very interesting showcase. jOOQ strongly separates API from implementation. All API is in the org.jooq package, and public. Most implementation is in the org.jooq.impl package and package-private. Only factories and some dedicated base implementations are public. This allows … Continue reading The depths of Java: API leak exposed through covariance
The good API design
I've stumbled upon a nice checklist wrapping up API design guidelines. An extract: Favor placing API and implementation into separate packages Favor placing APIs into high-level packages and implementation into lower-level packages Consider breaking up large APIs into several packages Consider putting API and implementation packages into separate Java archives Avoid (minimize) internal dependencies on … Continue reading The good API design
A neater way to use reflection in Java
Reflection in Java really feels awkward. The java.lang.reflect API is very powerful and complete, and in that sense also very verbose. Unlike in most scripting languages, there is no convenient way to access methods and fields dynamically using reflection. By convenient, I mean things like this // PHP $method = 'my_method'; $field = 'my_field'; // … Continue reading A neater way to use reflection in Java
SQL in Scala, where jOOQ could go
I have recently blogged about how simple it is to integrate jOOQ into Scala. See the full blog post here: https://blog.jooq.org/the-ultimate-sql-dsl-jooq-in-scala/ I'm more and more thrilled by that option, as Scala is one of the fastest emerging JVM languages nowadays. The plain integration of a Java library in Scala leaves some open questions. jOOQ knows … Continue reading SQL in Scala, where jOOQ could go
