Let's build components, not layers by Tom Hombergs @ Spring I/O 2022

preview_player
Показать описание
Spring I/O 2022 - Barcelona, 26-27 May

Code is written once and read often. So we should focus on making it easily readable. We all know that.

The same is true for the architecture of an application. It’s usually created once and then read and re-read, understood and misunderstood, interpreted and misinterpreted a lot of times by a lot of people during its lifetime.

We try to get a grip on this problem by using architectural patterns like layers. While layers are a well-understood structure, they only help in understanding the big picture of the application’s architecture. They usually don’t do a good job of organizing the code into pieces that are easy to understand and reason about.

Usually, a better approach to structure the code is to build components. Like lego bricks, we can compose multiple (vertical and horizontal) components to a bigger component, until we have built a complete application. We can zoom in and out of the codebase along the seams of the components to understand what we need to understand at the level of abstraction that we are currently concerned with.

In this talk, we’ll explore a lightweight way of structuring the codebase of a Spring Boot application that will feel like building lego. This component-based structure is easy to understand and reason about. It’s also easy to maintain over time thanks to a single rule that can be enforced by tooling. Java, Spring Boot, and ArchUnit bring all the tools we need for a nice component-based codebase, we just need to use them.

================================================

Video Chapters
00:00:00 Introduction
00:04:50 About the speaker
00:05:50 Why organise code?
00:08:47 What's wrong with layers?
00:12:09 What's wrong with vertical slices?
00:14:36 Clean / Hexagonal architecture
00:21:38 Component-based architecture
00:30:58 Field Study - Building a check engine component
00:43:44 Why build components?
00:47:03 Thank you
Рекомендации по теме
Комментарии
Автор

Awesome! It's awkward like as we grow as a software engineer we dream to do complex things just to realise later that the secrets lie actually in the simplicity. Poetical!

yanjim
Автор

Interesting and good presentation points... As food for thought, while I do agree that clean architecture is an abstract book, if you look at Chapter 34 "The Missing Chapter" by Simon Brown, you will find a "project code organization" called "package by component" that is pretty similar to what you're proposing, with some C.A. concepts in itself.

Great work! Thanks.

VT
Автор

Modularizing software makes sense, but i am not sure of what have i leaned here?

joachimdietl
Автор

This is great.
I actually skipped over the best part (component-based architecture) while I try to ignore other architecture styles :). For someone in a hurry, it would be nice if it came first and other styles discussed last.

solalem
Автор

Would be nice to get the code to this project

jonas-tm
Автор

However you organize your code, it will become a mess no matter what..

tranceyy
Автор

I learn by looking at code and actual demos, hmmm. could be better

yachionchain
welcome to shbcf.ru