by Paweł Chudzik

Summary time


I left company for which I’ve been working for last 4 years and now it is time to summarize my experiences. It is not story of shady business nor confession of my sins (not all of it anyway), but rather my thoughts and experiences on working for long time in the same company from which most of the time remotely.

18 Jul 2017

Immutability in angular


Some time ago I’ve been struggling with mapping hierarchical data structure in angular. Labels hierarchy was complex (like 4 levels deep with multiple parents, multiple children, basically graph like structure with some logic behind it). In the end it was/is still working but that’s the best I can say about it.

11 Jul 2017

Learning from the legacy code

best practices

We all love to write new stuff and learn about things. But when we’ve got to do something in one of the older applications we’d rather avoid it and lag as long as possible hopping that someone else will handle it. You shouldn’t be afraid of legacy code (as long it is not ball of mud). You should take the opportunity to look into the past, and learn from it as much as possible.

27 Jun 2017

Problem with random test data


Some time ago I noticed new library in our code base - Random Beans which as the name suggest is tool developed to easily create random data and random objects for testing purposes. Unfortunately we used it in the wrong way. Here’s how we backed up from the the random test data to regain control over testing.

13 Jun 2017

Dynamic beans in spring


Some time ago I’ve been trying to dynamically create spring beans. After fast stackoverflow check I decided to drop it and go with something else. Lately I’ve been trying to implement more complicated bean registration mechanism in which skipping dynamic bean creation wasn’t an option. Here’s how you can create spring beans “from code”.

31 May 2017

Poor man's batch processing in JPA


Working with a lot of data using plain JPA or hibernate or spring-data is possible, it does work and usually it doesn’t require a lot of extra codding. Starting small is the fastest way of getting things done but you must be aware of few things that might shoot you in the foot.

16 May 2017

Optimistic locking pitfalls


Optimistic locking is concurrency control method that allows to execute multiple transactions simultaneously as long as they don’t interfere which each other. That’s definition from wikipedia. You probably already know that hibernate supports optimistic locking and all you have to do in order to implement optimistic locking in you app is to add @Version on number or timestamp field and you are good to go. Right?

27 Apr 2017

Immutable dto in jackson


Immutability and functional programming are hot right now. But how to achieve immutability with objects deserialized from json? Luckily there is pretty old feature introduced in jackson 2.7.0 which uses constructor based object creation and uses @ConstructorProperties (introduced in java7).

15 Apr 2017

Keep your stuff up to date

best practices java javascript

Every codebase depends on multiple external libraries. It is good idea to stay up to date with external dependencies. It is important to update all security related stuff and it might be helpful or fun to use latest features. I’m going to share my way of staying up to date with external dependencies in maven, gradle and npm.

30 Mar 2017