Learn about building a simple micro-service application using Spring Boot and Kotlin. Dedicated support for Kotlin was introduced since Spring Framework 5.0

1. Overview

In this article, we’re going to build a REST API using Spring Boot 2.x and Kotlin. Meanwhile, dedicated support for Kotlin was introduced since Spring Framework 5.0. We can read about the supported features in the official Spring Framework documentation.

In particular, the application will expose data via a REST API and persist data in an embedded H2 database.

2. Use Case

We’ll build Restful APIs for an employee information application. A user can create, retrieve, update and delete an employee using this application. An employee has an id, username, first name, last name, email id, and date of birth. …


A guide about the different ways to create a Spring Boot project. Spring Boot is one of the most popular frameworks for creating web applications

Photo by Jo Szczepanska on Unsplash

1. Overview

In this tutorial, we’ll look into the different ways we can create a Spring Boot project.

2. Using Spring Initializer in spring.io

We can create a Spring Boot project by using the Spring Initializer in start.spring.io. This is the quickest way to create an application in Spring Boot which is one of the most popular frameworks for creating web applications.

The Spring Initializer offers different options for choosing the build tools, programming languages, Spring Boot versions, and the related dependencies.


The definitive guide to handling null references in Kotlin

Overview

In this article, we’ll look into the null safety in Kotlin.

Any programming language which has the concept of null reference throws a NullPointerException. It has been referred to as a billion-dollar mistake. (Wiki)

Nullable and Non-Nullable Type

Kotlin aims at eliminating the risk of NullPointerException. It distinguishes between nullable and non-nullable references as a part of its type system.

In Kotlin, all variables are non-nullable by default. We cannot assign a null value to a variable because it’ll throw a compilation error:

var country: String = "India"country = null //compilation error

To define a nullable variable, we must append a question mark(?)…


A practical example of Hexagonal Architecture in Java

1. Overview

In this tutorial, we’ll take a look into the hexagonal architecture in Java. To illustrate this further, we’ll create a Spring Boot application.

2. Hexagonal Architecture

The hexagonal architecture describes a pattern for designing software applications around the domain logic. The hexagon describes the core of the application consisting of the domain object and the use cases of the application.

The edges of the hexagon provide the inbound and outbound ports to the outside parts of the hexagon such as web interface, databases, etc. So, in this kind of software architecture, all the dependencies between the components point towards the domain object.

Therefore…

Anirban Chatterjee

Software Engineer | Blogger | Traveler | Football fan | Amateur Photographer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store