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.
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. …
In this tutorial, we’ll look into the different ways we can create a Spring Boot project.
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.
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)
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(?)…
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.
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.
Software Engineer | Blogger | Traveler | Football fan | Amateur Photographer