The purpose of Open Authorization 2.0 (OAuth 2.0) is to give an application (the "Client") limited access to your data at
another service (the "Resource Server"), without having to give your password to that application. When OIDC is added
Single Sign-On (SSO) is supported as well. The flow of these protocols can nicely be shown in a UML Sequence Diagram.
Continue reading →
Sometimes when you upgrade your application the new version does not work correctly, and you need to downgrade. When you are unlucky you did some changes in your
database that cannot be undone. In that case you need to restore the database from a backup, which is usually quite cumbersome and time-consuming.
How nice would it be if you could just run an undo script which is much more light weight. This blog describes how you can do that using Flyway.
Continue reading →
Did you know that you can include LaTeX snippets in Markdown and AsciiDoc documents?
For writing a scientific or technical document pure LaTeX is still the best choice.
But if you want to write a Markdown or AsciiDoc document that needs to contain some math snippets, you can.
Here is how.
Continue reading →
AsciiDoc and UML are two well known technologies for software design.
A very nice way of creating beautiful PDF documents is to combine both by embedding PlantUML in your AsciiDoc.
Generating the PDF can be a bit cumbersome, but with the following Maven setup it is quick and easy.
Continue reading →
Some people think GUIs have replaced the command-line. But they have not, they are complementary.
Some things can still be done better and easier in the command-line, for example scripting, and to servers one usually has access via an SSH terminal only.
But there is more!
This blog will describe a few very convenient commands for software developers.
All of it works in the Bash shell (common on Linux), but most of it works in the Z shell (zsh) as well (common on Mac).
Continue reading →
The ultimate way to get rid of versioning administration is to use CI/CD (Continuous Integration/Continuous Deployment).
However, in many cases CD is not possible. For example when creating libraries, or software requiring versions for compliance reasons.
Versioning is then still needed. This should be easy, but it turns out that without a proper procedure it can become very messy very fast.
This blog will describe a simple set up of such a procedure based on trunk-based development
and Semantic Versioning.
Continue reading →
Flyway is convenient tool to manage your database changes.
You can use it to create and populate your database from scratch, or to manage changes on a pre-existing database.
You can add it to your application so that when it starts up it invokes Flyway, or you can use the command-line version.
This blog describes a convenient way of using the Flyway command-line version.
Continue reading →
In production the log level should be INFO. However, in many cases it is set to DEBUG because otherwise critical message are missed.
This is unfortunate, because it usually leads to a lot of log file pollution.
And it should not have been needed, had the developers followed the following rules.
Continue reading →
Hibernate is a great Object Relational Mapping (ORM) library for accessing data in a relational database.
It is one of the leading implementations of Java Persistence (formerly known as JPA).
Using JPQL (based on HQL,
which is still a nice syntax guide) one can access and update the data in the database through your ORM objects in a simplified SQL way.
However, when implemented incorrectly one can run into serious performance problems.
They can all be avoided though.
Here are some important things to consider to make your queries performant.
Continue reading →
When developing software I find it very useful to stick to a number of rules.
They are all commonly known, but it can be very convenient to have list of them.
Sticking to these rules will enhance the quality of your code drastically.
Continue reading →
We all know mocking libraries like Mockito or Mockk to mock classes in our unit tests.
They can be convenient to mock I/O with external systems by replacing the boundary classes (aka. DAO = Data Access Objects) with mock objects.
That way we do not require a full-blown simulator of that external system.
However, mocking using these libraries also has some drawbacks. One way to avoid these drawbacks is to write your own mocks.
Continue reading →
Suppose you are testing a set of Quarkus based microservices.
They run as Docker images inside a Kubernetes cluster on your local machine, e.g. using MiniKube or Rancher Desktop.
At some point you find a bug in one of the services, or you find that you need an extra logging in code.
Now you would like to quickly modify the code and redeploy it in your Kubernetes cluster.
Typically your Docker image is build using a build pipeline on a build server, which may take several minutes.
Can this be done any faster and easier?
With Skaffold you can!
Continue reading →