Spring State Machine: what is it and do you need it?

State machine is a model of computation based on the finite states, as Wikipedia very obligingly says. Usually there are workflows to go with the states, meaning that you can’t just go from any state to any other state: there’re rules one should follow. The transitions between these states are limited by the rules.

The Spring framework has a whole library called Spring State Machine. It is an implementation of the concept, intended to simplify the development of the state machine logic for developers, already using Spring framework.

Let’s see how it works. Continue reading

Posted in java | Tagged , | Leave a comment

Book review – Clean Architecture by Robert Martin

Clean Architecture is a third book in Robert C. Martin’s Clean Code collection, first two being Clean Code and Clean Coder. I really like the whole series. To me, Robert Martin writes simply, clearly, with enough examples and without unnecessary complicated details. His books can be read through, as well as used for reference, but I would say that his are the books that are better to be read cover to cover, sequentially, and not just being referenced as parts. Indeed, they not at all huge and are logically constructed in such a way as to provide a completed story. Continue reading

Posted in Learning, Programming, Uncategorized | Tagged , | Leave a comment

Local type inference in Java 10, or If it quacks like a duck

Quite recently, Oracle adopted a new strategy of releasing a new language version every six months. The strategy assumes that only every 3rd version will have long-term support, or LTS. Quick notes about it:

  • Current version that has LTS is Java 8;
  • Java 9 is only supposed to have support until March 2018, so it is already OVER;
  • Java 10 is supported through September 2018;
  • Next version to have LTS is supposed to be Java 11, which is supposed to be released in September 2018 and will be supported at least through to September 2023.

Continue reading

Posted in IntelliJ, java, Uncategorized | Tagged , | Leave a comment

Lombok, AutoValue and Immutables, or How to write less and better code returns

In the previous post about Lombok library, I have described a library that helps to deal with boilerplate code in Java (and yes I know that these problems are already solved in Kotlin, but this is real life and we can’t just all sit and rewrite every existing project once a newer or a simpler language appears). But as many things in life, project Lombok has its alternatives. Let’s give them a chance as well.

Code samples for this article can be found here and here.

Continue reading

Posted in java, Programming | Tagged , , , | Leave a comment

Wait a minute mister Postman, or Postman environments

Postman is a tool that facilitates web application testing by sending requests and allowing you to inspect responses and whatever comes with them (response codes, headers, cookies etc). Yes I know that really (like, really) cool devs use curl or better yet, httpie (which is really cool, seriously, try it). But sometimes you just want to have a nice UI which you can actually show to a QA or a product manager and don’t pretend that you are that egg-headed guy doing some dark magic that’s spitting text into your console in response to you spitting out the commands that make no sense. Or you are just tired of trying to remember those commands and parameters yourself (but of course, a real dev would never acknowledge that, right?…).

This is how the cool kids do it (matrix gif)

This is how the cool kids supposedly do it.

Continue reading

Posted in Productivity, Programming | Tagged , | Leave a comment

How to write less and better code, or Project Lombok

I have long intended to write about Project Lombok, so much so that I am probably doing it when every self-respecting Java developer has already heard about it. Nevertheless, it is worth mentioning, if only to remind myself that one should not hesitate to try performance-enhancing tools and see if they fit, and Lombok is certainly enhancing performance of a Java-coder by allowing to simultaneously write less code and add to its quality, which is no small matter.

What is it that Java opponents usually say about its weaknesses?

Java is too verbose.
(c) Every Java opponent

Unfortunately, there’s a lot of truth in this statement.  Continue reading

Posted in IntelliJ, java, Libraries, Programming, Uncategorized | Tagged , , | 2 Comments

Out of sight, out of mind, or How to be productive when working remotely

We live in a world where technology seemingly lessens the need for actual office space. In IT industry especially, there seems to be less and less sense to actually come to work. At some point, telecommuting was all the rage, to the extent that a lot of big software companies offered unlimited remote work possibilities as one of the main perks. A few years back though this trend shifted a little bit. First Yahoo shut down its remote work back in 2013-2014, then this year, IBM did. Amazon planned to hire a lot of remote workers in 2017, but with the catch of those position being rather low-paid.


Image taken from Pixabay – https://pixabay.com/en/laptop-computer-pc-notebook-green-2055522/

Continue reading

Posted in Productivity, Remote work, Success, Uncategorized | Tagged , , | 1 Comment