Тёмный

Why I am using Hexagonal Architecture in my projects 

Ivan Skodje
Подписаться 3,5 тыс.
Просмотров 12 тыс.
50% 1

My attempt of an explanation of why I use Hexagonal Architecture
(tldr: it makes coding easier and more flexible!)
Contact Information:
Web-Site ► ivanskodje.com
Stalk me on Discord ► / discord
GitHub ► github.com/iva...
Twitter ► / ivanskodje
Twitch ► / ivanskodje
Background music provided by Teknoaxe:
► • Royalty Free Backgroun...

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@youkaba97
@youkaba97 Год назад
Thanks for this awesome teaching. Do you have github repo for this? Can you share please. Thanks again 🙂
@Muchtar51
@Muchtar51 11 месяцев назад
Amazing short intro, would like to have more such kind of learning videos or an udemy course would be nice. Is the code published on github or at least the structure? Would be very nice to play around with it.
@JohnTriantafillakis
@JohnTriantafillakis 2 месяца назад
Really nice explanation, simple and useful example! I'm coming back with a question about how you can set clear boundaries between application, adapter, infrastructure, and domain layers. For example, how can we prevent developers from importing any code from the adapter layer to the domain layer, etc.? I have considered a multi-module project, but I'm not sure if it's enough due to the increased complexity. Thanks!
@sebastiankargl
@sebastiankargl Год назад
I appreciate you talking about this topic! I would love if your voice volume would be a bit louder :D
@IvanSkodje
@IvanSkodje Год назад
Thank you for your feedback, I will make an effort to work more with the volume to make it better next time
@TheSemenFarada
@TheSemenFarada 3 месяца назад
I got it - sounds good. The only issue I see in practice is an amount of mappings. From dto1, dto2... dton to domain (input), then from domain1, domain2.. to infra1, infra2 ... If i were a developer who does this i would got very bored in a week or less - but maybe ide automaton tools or AI assistance would solve the issue
@wxrld1
@wxrld1 3 месяца назад
mapstruct
@michaelovie5582
@michaelovie5582 Год назад
thanks @Ivan, I really enjoyed watching your video. The concepts were well laid out and it all makes better sense now, thanks to your video.
@davidtheprogrammer
@davidtheprogrammer 2 года назад
Really interesting pattern. I've been doing something similar, utilizing Interfaces and letting the DI framework figure out what is needed where. My biggest takeaway from this video is the adapters configuration, it separates the the input from the logic so well, allowing you to receive data from multiple sources and executing the same logic from the application later. That's perfect! I have my controllers separated from core business logic, but I built my it without allowing for extension of multiple ingress methods. Do you have output DTOs? Or is the domain layer already ready for transmission to the requestor? I'm guessing AccountJpa has the metadata (created date and all that) and the domain Account only has necessary data, does this eliminate the need for mappers like MapStruct?
@IvanSkodje
@IvanSkodje 2 года назад
Since I am moving away from the traditional restcontrollers, and is heading towards using GraphQL, DTOs are no longer an issue. This means we no longer have to spend time figuring out what this-or-that DTO should look like, and what data the frontend needs. We can instead focus on what data users have authorization to access, and which data we want to expose. :) I showed a quick sample of how to setup graphql in a spring boot project here, if it is of interest ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-cYb33gp0YOE.html
@davidtheprogrammer
@davidtheprogrammer 2 года назад
@@IvanSkodje I've never used GraphQL but after this, I think it's time I take a look at it. Thanks so much, learned a lot from this interaction. Let me check your other video and btw you've earned yourself a subscriber.
@thanhkien5905
@thanhkien5905 Год назад
Really enjoyed your video. It helped me a lot. Btw can you share the project? Many thanks
@IvanSkodje
@IvanSkodje Год назад
Happy you liked it, but I have not made the project public. If/when I get back to it I can see if I am able to create a template project similar to this. Is there anything in particular that peeked your interest?
@omegapirat8623
@omegapirat8623 Год назад
Why didn't you put the adapters folder into the infrastructure folder? Aren't adapters not part of the infrastructure?
@IvanSkodje
@IvanSkodje Год назад
A great question! You're spot on; there are specific reasons we distinguish between the database classes in the Adapters folder and those we’d typically place in the Infrastructure folder.. ! Adapters are all about converting data between different formats. Since we’re using Spring Boot in this project, much of the heavy lifting and details we’d usually find in the Infrastructure folder are hidden within the annotations we use, thus eliminating the need for explicit database code within the infrastructure folder. In this setup, our Adapters are dealing with the business layer logic, while the specifics of database interaction are managed by the annotations we’re using. This way, we maintain clarity and ensure every part of our architecture has its distinct role, while removing the need to write our own infrastructure logic for the database.
@azeemmohammed6284
@azeemmohammed6284 Год назад
Hey thanks for the video, is it possible to share the project in github
@benjaminrichard1979
@benjaminrichard1979 4 месяца назад
Man I wish this video was 2 hours long. I have so many questions! Also I would love to be able to go into this repo to try understanding things
@MarcoDuong-SoftwareEngineer
@MarcoDuong-SoftwareEngineer 7 месяцев назад
This is the best video I have seen on the hexagonal architecture implementation. But i have a question , i has logic like subscribe and handle event (use Spring event) but i don't know where will implement this logic. And can you share your project for me ?
@jedsada2575
@jedsada2575 3 месяца назад
You should implement it on Adapter layer. More specifically driving part.
@MrOcelot92
@MrOcelot92 Год назад
A tua lla, the fact that i have an api problem is a flaw in the pattern right? Business knows there is an api outside
@JohnnyDamenies
@JohnnyDamenies 11 месяцев назад
Hi Ivan, can you share link to the code?
@alexandrutanasescu7678
@alexandrutanasescu7678 Год назад
great video! @IvanSkodje curios what plugin you use for code highlight in different colours
@IvanSkodje
@IvanSkodje Год назад
Download and use the "Dracula Theme" plugin: plugins.jetbrains.com/plugin/12275-dracula-theme
@alexandrutanasescu7678
@alexandrutanasescu7678 Год назад
@@IvanSkodje awesome, thought you had some custom color schemes going on. think I just need to upgrade my IntelliJ IDEA a bit ^^
@jonathansilva3364
@jonathansilva3364 9 месяцев назад
Hey Ivan, great video showing how you use the hexagonal architecture. The way I feel watching and learning from it is that, as usual, it takes a little bit more effort to make things in a way that would help us easily work on it later. One could think it's a big deal of effort to set all this up until there's a problem that needs fixing/change and they don't have a clue where to change. I have seen a lot of times cases in which we fix 1 thing and have a lot of regression bugs, which can easily be solved by this strict rule of having separate use cases and dtos. Thanks for this content.
@blackobemamatters4418
@blackobemamatters4418 Год назад
Very interesting video, can you share this project on GH?
@alexdorand
@alexdorand Год назад
This is the best video I have seen on the hexagonal architecture implementation. Direct to the point, no eeemmm or huuummms. No superfluous stuff. Brilliant work.
@MaxKronus
@MaxKronus Год назад
What are the RegisterNewAccountJpaService and UpdateAccountJpaService?
@IvanSkodje
@IvanSkodje Год назад
Good catch. The naming may not be good enough, but it essentially implements the desired functionality that we expose via the AccountJpaRepositoryAdapter. The Services within the adapter.out.jpa are details we do not care about (in business). How you choose to implement "registerNewAccount(Account account) {}" is up to you, as long as it is coherent with the other methods, such as "findAccountByEmail", and so on (within reason).
@HandledToaster2
@HandledToaster2 5 месяцев назад
I don't get it.. why aren't all these CRUD methods in the same AccountJpaRepo class? Extending crudRepo means you have it all in one place anyways ​@@IvanSkodje
@AdrianKodja-m3f
@AdrianKodja-m3f Год назад
Really awesome video Ivan! Thank you! Btw what type of font are you using , looks neat!!
Далее
Being Competent With Coding Is More Fun
11:13
Просмотров 87 тыс.
Hexagonal Architecture (All You Need to Know)
9:51
Просмотров 7 тыс.
The Value of Source Code
17:46
Просмотров 49 тыс.
Spring Tips: Spring Modulith
37:39
Просмотров 26 тыс.
I Remade YouTube From Scratch Using Just Bash
17:51
Просмотров 13 тыс.
Hexagonal architecture in SpringBoot
1:31:02
Просмотров 8 тыс.
🚀 The Clean Architecture (Ian Cooper)
53:05
Просмотров 85 тыс.
This Is The BEST Way To Structure Your GO Projects
11:08