Book Image

Building Applications with Spring 5 and Kotlin

By : Miloš Vasić
Book Image

Building Applications with Spring 5 and Kotlin

By: Miloš Vasić

Overview of this book

Kotlin is being used widely by developers because of its light weight, built-in null safety, and functional and reactive programming aspects. Kotlin shares the same pragmatic, innovative and opinionated mindset as Spring, so they work well together. Spring when combined with Kotlin helps you to reach a new level of productivity. This combination has helped developers to create Functional Applications using both the tools together. This book will teach you how to take advantage of these developments and build robust, scalable and reactive applications with ease. In this book, you will begin with an introduction to Spring and its setup with Kotlin. You will then dive into assessing the design considerations of your application. Then you will learn to use Spring (with Spring Boot) along with Kotlin to build a robust backend in a microservice architecture with a REST based collaboration, and leverage Project Reactor in your application. You’ll then learn how to integrate Spring Data and Spring Cloud to manage configurations for database interaction and cloud deployment. You’ll also learn to use Spring Security to beef up security of your application before testing it with the JUnit framework and then deploying it on a cloud platform like AWS.
Table of Contents (12 chapters)

Planning your development

For every project you do, for big and complex projects, and for small ones too, planning is crucial! We will plan our development according to the chapter structure of this book. So, some stuff will be done first and some later. As you have probably realized, user-related functionalities will be provided when we touch on Spring Security. Until then, we will be focused on the main data entities and their relationship with Spring Framework and API clients as well.

Before you get into the deep implementation, it would be wise to plan your work first. As we already did, you should identify all your entities and the relations between them. You must be aware of potential hard connections between them. The best scenario is that each entity is completely independent and not aware of others. In our case, the user entity does not have any awareness of our main data entities, Notes, and TODOs, and vice versa.

Then, if we put all this on paper, we can consider what environments we will have. A common practice is that we have development, staging, and production environments. For bigger projects, sometimes a preproduction environment is also used. In our case, we will have a local development environment, too. The local development environment will be the one we will use for all these exercises. We will use our local working machines running an instance of MySQL and our Spring Framework application.

You must plan how will you deploy the application. For example, an application can run on Apache Tomcat or Amazon AWS. These are not the only options available. Depending on your needs, you will choose a proper deployment platform and deployment scenario. We will discuss this in more detail in Chapter 10, Project Deployment.