jOOQ’s fluent API in BNF notation

I have recently posted an article about how to generally design a fluent API in Java. By fluent API, I don't mean simple constructs such as new Builder().withSomething(x) .withSomethingElse(y) .withSomething(z) .withAnotherThing(xx); The above is just simple method-chaining, without any sophisticated formal language definition. Most often in method-chaining contexts, the order of method calls is irrelevant … Continue reading jOOQ’s fluent API in BNF notation

if – else coding style best practices

The following post is going to be an advanced curly-braces discussion with no right or wrong answer, just more "matter of taste". It is about whether to put "else" (and other keywords, such as "catch", "finally") on a new line or not. Some may write if (something) { doIt(); } else { dontDoIt(); } I, … Continue reading if – else coding style best practices

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

Let’s revise the SQL FROM clause

Intuitive SQL SQL is extremely simple and yet at times, tricky. Most SQL developers have an intuitive (as opposed to formal) understanding of how the language works, for two reasons: It is designed "intuitively", like a natural language. Maybe that keeps us from studying it more formally The formal language specification is not really freely … Continue reading Let’s revise the SQL FROM clause

The Java Fluent API Designer Crash Course

Ever since Martin Fowler's talks about fluent interfaces, people have started chaining methods all over the place, creating fluent API's (or DSLs) for every possible use case. In principle, almost every type of DSL can be mapped to Java. Let's have a look at how this can be done DSL rules DSLs (Domain Specific Languages) … Continue reading The Java Fluent API Designer Crash Course

Cut down 90% on RDBMS costs switching from Oracle to EnterpriseDB

Now that's an interesting story. Most Oracle users and customers will know that Oracle is not one of the most supportive suppliers when you don't have the money. And by "the money", I mean lots of money. It is a huge, and feature-rich database after all, but so is Postgres. There is a lot of … Continue reading Cut down 90% on RDBMS costs switching from Oracle to EnterpriseDB

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

A Brief, Incomplete, and Mostly Wrong History of Programming Languages

Found a fun read on the net, recently ;-) http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html

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

Java 8 virtual extension methods

I've been following the evolution of the Java 8 Lambda expressions project for a while now, and I'm really thrilled by its current state of progress. The latest "easy-to-understand" presentation I've found is this one: http://blogs.oracle.com/briangoetz/resource/devoxx-lang-lib-vm-co-evol.pdf Now, as an API designer, I'm particularly interested in the concept of virtual extension methods and I was wondering … Continue reading Java 8 virtual extension methods