Menu

1 / 2

Creating a modular Kotlin project using gradle.

DEV Community: kotlin·Joao Marcos Costa Salles·5 months ago
#SAPMT2Zf
#dev#module#gradle#build#photo
Reading 0:00
15s threshold

Introduction

The idea of building a system entirely composed of microservices is always tempting for a developer, whether for the challenge itself or to stay ahead of scaling needs. However, analyzing trade-offs and choosing what best fits our context is also part of our profession.

A very common decision today at the beginning of a project is to build modular projects as a way of anticipating a future need to split out a dedicated service. This approach adds less initial complexity than a microservices architecture, while keeping modules sufficiently independent for a potential future separation if needed.

In this article, I will show hot to set up Gradle to enable modules on a monolithic project.

my-inflation/src/main/kotlin/com/salles/scrapping ├── data # DTO declarations ├── db │ ├── tables # Persistence table declarations ├── domain # Business logic declarations ├── repositories ├── routes ├── services └── scrapper # Feature that could move to another project

Enter fullscreen mode

Exit fullscreen…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.