Hacker News

Subscribe to our RSS here.

Learning Spring with Kotlin - Sprint 0

Spring & Kotlin

Context & Goals

A few months ago I started working at FreeNow with focus on Backend Testing. Alongside great smart developers and testers, I deal with the challenge of a fast-paced environment of hundreds of services (micro-services, if you like the buzzword). During this time, I’ve learned many techniques and approaches - many of them I’ve described on my Automation Guild 2020 talk.

This environment has on its base the Spring Framework, for both Inversion of Control and application development.

Spring, 17 years after its initial release, is myriad of topics; from security to testing, passing through configuration, internationalization, etc etc etc. And my knowledge of Spring is as big as your knowledge of quantum mechanics. Therefore, nothing more natural than move my learning focus to Spring and its capabilities.

I will be posting here what I learned, my questions, tips, and any other note from my studying hours.

My goals will be the following:

1 - Create REST APIs, automatically built and checked;

2 - Understand Spring Configuration, in its different approaches to separate the application from its data;

3 - Create examples of SOLID, Clean Code, and Clean Architecture;

4 - Hardcore TDD at every checking level, from hand-written stubbing unit checking, to databases with TestContainer, service contract with Pact, advanced test doubles with Mockk, etc.

And EVERYTHING ON KOTLIN!

Plan

As an advocated of Project-Based Learning, I will reach these four goals (mostly) through the construction of things that at least reassembles real-world problems.

Short-term Path

Of course, the beginning is when we not only know the least, and it is in the beginning when we don’t know we don’t know things the most.

Knowledge Quadrants

Meaning that we:

1 - More easily get stuck at every problem: We don’t know how to speculate solutions.

2 - Have more difficult in breaking big problem into smaller, actionable problems.

So, in the first steps, the Project-Based Learning approach has be put on the side a bit on the side, and a more classical classroom learning system brings more results. And since Spring is such a big space, the basic concepts have to be incorporated first, even when some approaches are considered “outdated”.

For the first moments, my goal will be to learn concepts of Classical Spring, XML-based configuration, basic services without databases or extentable architecture-focus.

For that, my main resource will be Java Brains playlists, such as Spring Framework, Spring Boot Quick Start, and Spring Data Support.

Additionally, since these videos are quite old, I may go for some other online course for more recent syntax and semantics.

However, to add a bit a challenge and to create knowledge that will be useful in later stages, I will re-write some of the course code in Kotlin.

Medium-term Path

Finally the first project: A clone of Trello’s REST API.

Trello (which I already explored on this blog) has concepts of objects and relationships, well-defined CRUD operations.

I think it will serve as a good exercise of the concepts learned before, and also include more real-world challenges, such as databases, architecture, and automated checks.

Long-term Path

We can play with the basic Trello API clone service in many ways:

  • Spring Configurations: Separate different ways to setup main variables of the service, to deal with different enviorements for instance;
  • Advanced automated checks, as mentioned above;
  • Architectural refactorings;
  • Break the service into smaller ones, creating physical boundaries.
  • Containerization;
  • Logging and monitoring;

Seems interesting? :) Leave a comment and let’s go together on this journey.

Leave a comment