Yet another lightweight JDBC Wrapper

In this library I tried to find a minimal abstraction for the standard Java JDBC framework. Overwhelmed by the complexity of the existing OR-mapping frameworks, I was searching for a library, which doesn’t try to hide SQL from the developer. But still gives you enough support by handling the tedious parts of JDBC. With a background in the Scala/Play development, I’d enjoyed using the Scala Anorm library. Unfortunately I couldn’t find a similar library for Java. So, I decided to implement one myself.

This blog gives you an overview over the usage of the FacileJDBC library, mainly by example. A…


How to do dependency injection in Java with static injection methods.

In a previous post I described how the Jenetics library uses the static RandomRegistry for injecting Random engines into the library code. In this post I will describe the details of the injection implementation.

The RandomRegistry of the Jenetics library delegates the functionality to the Context class, which contains the actual implementation.

Simplified RandomRegistry implementation

The Context class is responsible for storing the object which is injected and the RandomRegistry defines the static scope for the injection of the Random object. It is not required to have only one…


Injecting Random engines into the Jenetics library.

When I was implementing the Genetic Algorithm (GA) and Genetic Programming (GP) library, Jenetics, it was clear that I needed a way to change the PRNG implementation the GA was using during the evolution process. Unfortunately, there are a lot of possible methods for injecting the Random engine into the objects which needed it. The most important criteria for me was:

No external dependencies — If possible, I did not want to introduce additional dependencies. The Jenetics library was quite small and didn’t rely on any external library. …


Random number generators should not be chosen at random. — Donald Knuth

While implementing the Jenetics library, I faced the problem of creating proper seed values for the Randomengines I used. The usual way for doing this, is to take the current time stamp.

To get a feeling about the quality for this kind of seed values, I treated it as special random engine and applied the dieharder test suite to it. As you might expect, the quality of this random engine was disastrous. It didn’t pass a single dieharder test. All of the 114 tests failed.

Since this…

Jenetics

Franz Wilhelmstötter

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store