Java Renaissance – Closures and Multiple Inheritance in Java 8

Posted Leave a commentPosted in Concepts of programming languages

The rise of alternative JVM languages like Groovy, Ruby or Scala has been made possible by the growing conservatism, if not stagnation, in the java world. In particular, the Java language itself hasn’t evolved that much since September 2004, when Java 5 had been released.1 While the growth of the Java ecosystem is good, most professional Java developers benefit little of it because they have to stick to Java. This has been a constant source of frustration to me during the last years. If you share my frustration, you may be pleased to read the good news I picked up at this year’s JAX.

  1. Apart from minor improvements like try-with-resources, the diamond operator and project Coin.

Simulating HTML Include Files

Posted Leave a commentPosted in web design

Nowadays, HTML offers virtually everything. Everything but include files, that is. There’s simply no way to add the content of a file to an HTML file. You either have to use weird hacks or wait until HTML import becomes a features supported my most current browsers. Most likely this will take years, so let’s have a look at the weird hacks. This post shows you two different approaches to simulate include files with a few lines of javascript code.

How different languages pass parameters to functions (Part 1)

Posted 6 CommentsPosted in Concepts of programming languages

Sometimes things you are familiar with because you deal with them every day turn out to be surprisingly unfamiliar one you start to think thoroughly about them. Chances are that functions and their parameter belong to this category of things. I suspect you are a programmer or a software architect (who else should be attracted to a page like “Beyond Java”?), so I’m pretty sure you pass parameters to functions on a daily basis. This is routine to you, so you don’t think much about it. This article wants to show you the wealth of possible parameter passing mechanisms.

I split this article into two parts. The first part deals with the semantics, and the second part shows the syntactic sugar some programming languages offer (or fail to offer). Maybe I will add a third part dealing with the implementation of parameter passing mechanisms.

The Evolution of Programming Languages

Posted Leave a commentPosted in Concepts of programming languages

I’m fascinated by languages. This includes both programming languages and spoken languages. So I decided start a series of articles comparing computer languages. Sometimes different languages have remarkable and instructive differences. There are also interesting similarities – maybe I manage to show them, too.

Let’s start with some general thoughts on programming languages.

There is no accurate documentation of your code but your code itself

Posted Leave a commentPosted in quality assurance, refactoring

It’s a common misconception that every program needs documentation. Most people seem to be terribly scared by programs lacking documentation. Whenever I am asked where my documentation is, inevitably this question is followed by the next question: “What happens if you leave the company? Nobody´ll be able to figure out your code!”

That’s nonsense.

How to use Primeface’s poll component to do lazy loading

Posted Leave a commentPosted in JSF

This is a nice little trick a collegue of mine found out. Consider a JSF page that uses a major backing bean. Suppose it takes a long time to initialize this bean (e.g. because huge amount of data have to be loaded from the database). The JSF page is shown when the backing bean has been initialized completely.

You can also use Primefaces remoteCommand to implement a better and simpler possibility to do lazy loading.

Liferay Hooks

Posted Leave a commentPosted in Uncategorized

Liferay has a nice feature to influence the portals behaviour by deployable items. Among other things you can use theese “hooks” to call a java method if the user logs in or logs off again. My particular use case was to show different pages to different user groups.

Hooks are described nicely at Unfortunately this description is a little outdated. For the sake of convenience I jot down the basic steps to write a hook.

Simplify JSF

Posted Leave a commentPosted in simpliying JSF

This is the first part of a multipart series showing you how to make writing JSF page more fun. You will get better results writing less code.

Let’s have a look at a simple, yet typical form consisting of a single input field:

JSF source code

We have to write three lines of code to implement one input field. Looking carefully at the code, you will see the repetitions:

JSF source code with annotations showing the repetitions