With Ansible you can configure (aka provision) remote machines by using a simple text file. It uses so-called Playbooks to execute a set of commands on the remote machine. So instead of having a dedicated person executing a set of commands on each machine, with Ansible, this configuration can be collaboratively worked-on, reviewed, versioned and...
Vagrant in a Nutshell
Vagrant is a command-line tool to create virtual environments using a scripting language, i.e. with Vagrant you can create and configure virtual machines by using a text editor. The use of a text-file for configuration makes it easy to document the configuration, to work in collaboration and to store the configuration in a version...
Inversion of Control – Part III – Dependency Injection in Java Spring II (Example)
I will continue with using the AlertService from part 2 of the series, to show how to utilise Dependency Injection in Spring with a more common situation. Let us start with the MessageServices and bring them under control of the BeanFactory in Spring by annotating them as a Component. @Component public class EmailMessageService implements MessageService...
Inversion of Control – Part III – Dependency Injection in Java Spring I
As I explained in the blog post about Inversion of Control, your code can be controlled not only by implementing an IoC Design Pattern within your code, by a framework that controls (part of) your code, but also by an entity, that you don’t have direct control over, such as a Servlet Container that...
JVM Classloading
Java Byte-Code When you compile java-code (.java files and resources), the compiler will generate so-called byte-code (.class files, or packaged .jar files). This byte-code can’t be executed by the local operating system, but only by the Java Runtime Environment (JRE). The JRE is the environment where a Java Virtual Machine (JVM) runs. The benefits...
Inversion of Control – Part II – Dependency Injection
In the first part, I described what Inversion of Control (IoC) is and how it can be implemented using the classical GoF design patterns. In this post, I will explain another implementation of IoC: Dependency Injection. I assume that you are familiar with programming to an interface (or abstract class) rather than classes, as you...
Inversion of Control – Part I
Why am I talking about Inversion of Control? I will use Spring (Boot) later on to build services. Spring is based on Dependency Injection. Dependency Injection is one possible implementation of Inversion of Control. Hence, it is reasonable to understand the basics of Inversion of Control (IoC) and how it can be implemented. Before...
What is a Servlet?
Introduction Java uses so-called Servlets as the component that handles a request from a user (or other systems) and generates a response based on the request. Although with frameworks like Spring MVC you might not deal with Servlets directly. However, it is useful to understand the underlying principles of a Servlet, as you will come...
Maven Overview
Introduction Maven is a build tool. A build tool automates processes related to building software. This can include compilation of the source-code (triggering) auto-generating (parts of) the code, e.g.with css generation of documentation packaging of the compiled-code generation of containers (e.g. a docker-container) deploying packages or containers on a remote server Installing Maven is...
Git Branches – Working with Branches – Part III – Merging versus Rebasing
You have learned how to merge two branches and how to deal with merge-conflicts. When you develop new features it makes sense to develop them on a branch that is based on the latest version of your Master branch. If the feature branches are based on the non-current version of the Master branch than...