Blogs

Dein erster Container in Kubernetes

We will start with a rather short introduction in kubernetes, create a namespace using the MayopeCloudConsole. Using this namespace we will deploy a docker container and make it accessible from the internet. What can I do with kubernetes? Kubernetes is a tool to orchestrate containers. It enables you to run, configure, scale and connect them against each other. How does kubernetes archive this? Kubernetes can be understood as a tool to connect multiple (physical or virtual) machines and enable them to share workloads.

Weiterlesen

Documentation as Code

Documentation as Code makes it first class citizen while developing Documentation as code states that you store the documentation of your project/service at the same location where you store you code. This has some clear advantages: You don’t need to search for you documentation, everybody is aware where it is and how to extend it You can update the documentation for an issue in the same pull/merge-request where you make the respective technical changes.

Weiterlesen

Gradle as a Tool for monorepositories

Why do we need monorepositories in the first place? This article does a great job in explaining what a monorepo is and why you may need it: What is a monorepo? To summarize it you have a couple of advantages: Single source of truth Pull-Requests accross services are possible and reviewable in one pull request Simplified code sharing accross services Common build logic for all services There are also some downsides for using a monorepository for example vsc scalability, cross team ownership or the temptation to introduce tight coupling between services.

Weiterlesen

Adding parameters to a Gradle plugin

Introduction Last time I wrote about the basic setup of a Gradle plugin in Kotlin(Writing a Gradle plugin with Kotlin ). This time we want to add some parameters to this plugin to make it more generic. Basics Gradle is a build automation tool from the java ecosystem. It has a lot of plugins for various use cases. Buildfiles are describedin Groovy as default but Gradle recently added the possibility to also write build scripts in a Kotlin DSL.

Weiterlesen

Dependency Injection with Koin

What is dependency injection Dependency injection is a technique to organize dependencies of services at runtime. If you have a really large application you may have encountered the problem of passing some objects down the whole stack and maybe using singletons and static method to overcome this. But these are hard to substitute in Tests. Though to avoid this we let a framework organize these dependency issues for us. See Wikipedia .

Weiterlesen

Functional Kotlin starting from Java

This post is about the transition from Kotlin sourcecode that looks like java code to code that uses the functional Kotlin constructs. Starting up I will write about a completely made up class here but I experienced that you can do that with almost any class in the entire codebase. Inspiration from the daily programmer: word funnel Starting with Java We start with the java implementation of the word funnel puzzle mentioned above

Weiterlesen

Migrate Keycloak like SQL

What is Keycloak? Keycloak is an authorization provider that supports various authentication protocols. You can use it with OAuth, LDAP, Kerberos, etc. It is based on the free WildFly application server. Why is migration a Problem? You can manage Keycloak through an admin ui, or with the provided REST-Api. Keycloak also supports realm export and import. So we could just track keycloak changes through the export file. The difficulty of this approach is, that the realm export has to be done before starting the Keycloak server.

Weiterlesen

Null pointer in Kotlin

The Null Pointer Problem Java devs have struggled withe the Problem of the NullPointerException for years and more years to come. It has been named the ‘Billion Dollar Mistake’ and it probably did cost something ranging in this number. Kotlin is coming up with a pretty neat solutions to this old Problem. It does not prevent NullPonterExceptions completely but it warns you every time you are about to introduce code that could lend to this technical debt.

Weiterlesen

Operator Overloading in Kotlin

What is operator overloading? Operator overloading has its root in the language C++. It means, that you can define the behavior if an operator (e.g. +, -, *, …) is applied to your type. (Wikipedia ) In C++ this looks like the following. Given we have a class Vector containing a x and a y field as coordinates. We can define the operator plus + as follows: Vector operator + (Vector const &obj) { Vector res; res.

Weiterlesen

SQL DSL JOOQ

In this post I want to introduce the JOOQ sql domain specific language (DSL) for Kotlin and Java. It is free for open source databases and we will use postgresql in this tutorial. We will write a small app to manage todolists in Kotlin. I will not explain how to setup a postgresql database but there are a lot of tutorials available for several operating systems. Create the database At first we need to connect to our postgres database, add a user and create a database.

Weiterlesen