Home » Author Archives: Bozhidar Bozhanov

Author Archives: Bozhidar Bozhanov

Bozhidar Bozhanov
Senior Java developer, one of the top stackoverflow users, fluent with Java and Java technology stacks - Spring, JPA, JavaEE, as well as Android, Scala and any framework you throw at him. creator of Computoser - an algorithmic music composer. Worked on telecom projects, e-government and large-scale online recruitment and navigation platforms.

Writing Laws Is Quite Like Programming

software-development-2-logo

In the past year I’ve taken the position of an adviser in the cabinet of a deputy prime minister and as a result of that I had the option to draft legislation. I’ve been doing that with a colleague, both with strong technical background, and it turned out we are not bad at it. Most of “our” laws passed, including ...

Read More »

Custom Audit Log With Spring And Hibernate

jboss-hibernate-logo

If you need to have automatic auditing of all database operations and you are using Hibernate…you should use Envers or spring data jpa auditing. But if for some reasons you can’t use Envers, you can achieve something similar with hibernate event listeners and spring transaction synchronization. First, start with the event listener. You should capture all insert, update and delete ...

Read More »

Spring-Managed Hibernate Event Listeners

jboss-hibernate-logo

Hibernate offers event listeners as part of its SPI. You can hook your listeners to a number of events, including pre-insert, post-insert, pre-delete, flush, etc. But sometimes in these listeners you want to use spring dependencies. I’ve written previously on how to do that, but hibernate has been upgraded and now there’s a better way (and the old way isn’t ...

Read More »

Installing Java Application As a Windows Service

java-logo

It sounds like something you’d never need, but sometimes, when you distribute end-user software, you may need to install a java program as a Windows service. I had to do it because I developed a tool for civil servants to automatically convert and push their Excel files to the opendata portal of my country. The tool has to run periodically, ...

Read More »

Why I Prefer Merge Over Rebase

git-logo

There are many ways to work with git. The workflows vary depending on the size of the team, organization, and on the way of working – is it distributed, is it sprint-based, is it a company, or an open-source project, where a maintainer approves pull requests. You can use vanilla-git, you can use GitHub, BitBucket, GitLab, Stash. And then on ...

Read More »

Dirty Hacks Are OK

software-development-2-logo

In practically every project you’ve used a “dirty hack”. setAccessbile(true), sun.misc.Unsafe, changing a final value with reflection, copy-pasting a class from a library to change just one line of wrong code. Even if you haven’t directly, a library that you are using most certainly contains some of these. Whenever we do something like that, we are reminded (by stackoverflow answers ...

Read More »

A Beginner’s Guide to Addressing Concurrency Issues

software-development-2-logo

Inserts, updates and deletes. Every framework tutorial starts with these and they are seen as the most basic functionality that just works. But what if two concurrent requests try to modify the same data? Or try to insert the same data that should be unique? Or the inserts and updates have side-effects that have to be stored in other tables ...

Read More »

How To Read Your Passport With Android

android-logo

As I’ve been researching machine readable travel documents, I decided to do a little proof-of-concept on reading ePassports using an NFC-enabled smartphone (Android). The result is on GitHub, and is based on the jMRTD library, which provides all the necessary low-level details. As I pointed out in my previous article, the standards for the ePassports have evolved a lot throughout ...

Read More »

Software Can’t Live On Its Own

software-development-2-logo

We’re building software in hope that some day we’ll leave it and it will live on its own. Or with minor supervision. But the other day when my father asked me to dig an old website, I did some thinking and realized auto-pilot software is almost never the case. Software is either being supported, or is abandonware, or is too ...

Read More »

Setting Up Distributed Infinispan Cache with Hibernate and Spring

jboss-hibernate-logo

A pretty typical setup – spring/hibernate application that requires a distributed cache. But it turns out not so trivial to setup. You obviously need cache. There are options to do that with EhCache, Hazelcast, Infinispan, memcached, Redis, AWS’s elasticache and some others. However, EhCache supports only replicated and not distributed cache, and Hazelcast does not yet work with the latest ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials