No video

Hexagonal Architecture (All You Need to Know)

  Рет қаралды 6,125

Gui Ferreira

Gui Ferreira

Күн бұрын

Watch as I show you what you should know about Hexagonal Architecture.
💎 Be a Patreon: / gsferreira
🚨 KEY LINKS
🤝 Support me on Patreon (and get access to source code) here: / gsferreira
💌 Free Developer Insights: guiferreira.me...
📞 Book a 1:1 Call with me: calendly.com/g...
🔗 GET IN TOUCH
LinkedIn: / gferreira
Twitter: / gsferreira
GitHub: github.com/gsf...
Get my newsletters: guiferreira.me...
Visit my blog: gsferreira.com
👋 WHO AM I
Hey! If you're new to my Channel, I'm Guilherme. Call me Gui. I'm a Minimalist Software Craftsman. What do I do here? I share tips on how to simplify your life as a Developer.
🎵 MUSIC CREDITS
White Lie / StreamBeats / Lofi
#softwaredevelopment #softwarearchitecture

Пікірлер: 20
@simonegiuliani4913
@simonegiuliani4913 6 ай бұрын
Thanks for the video! The dependency issue coming from a n-layered architecture can be simply resolved by putting all interfaces on a separate project and enforce the use of interfaces. I have worked with both clean and hex architectures in both java and c# and my personal experience is that they are a nightmare to work with as they are not intuitive at all and it's very difficult to onboard people. Use them carefully and try them for some time before productionising!
@gui.ferreira
@gui.ferreira 6 ай бұрын
I believe that the nightmare starts when we don't keep it simple. That's why I like Hexagonal. It's easy to explain and to keep it in a simple way.
@rmcgraw7943
@rmcgraw7943 10 күн бұрын
I’ve used this long before it was ever given a name, and while most know it as Hex Arch, I call it XPlicit Arch, since architect is supposed to be about interfaces and contracts, not implementations. For you C guys out there, when he speaks of Ports, think Interface or abstract class, and adapters can be 2 things (either an interface implementing class or abstract class that implements that interface but serves as a translator). There is some cost to this architecture, as it’s not easy for junior or mid level coders to fathom at first, but it pays off for enterprise solutions. It’s Dependency Injection intensive, so it makes people code to interfaces, another plus. Also, it doesn’t have to be followed exactly, and you can use it as your enterprise core architecture, which it is ideal for, but it can also be applied in an complex application as well. For instance, a web portal might have it’s own entire hexagon that interacts with the “Core” enterprise hexagon. The main thing to realize is that nothing deals with concrete instances except the deepest regions in the Core of each hexagon. Everything is talking to each other via interfaces, allowing for future change and flexibility. Search “The Software Architecture Chronicles” by Herbert Graca for a thorough explanation on this architecture.
@gui.ferreira
@gui.ferreira 7 күн бұрын
Thanks for sharing. I agree with you that it can be harder for a Junior, but I think it's easier to get it than other styles. Those articles by Herberto are amazing.
@duramirez
@duramirez 3 ай бұрын
Hey don't bash on people who build their own ORM 😆 I still use the one I created back in 2007 (but ofc modernized it and keep it updated) and it works way way better than any ORM offered today in a fancy package. 😆
@gui.ferreira
@gui.ferreira 3 ай бұрын
More than 15 years of utilization, already justifies the investment 😅
@duramirez
@duramirez 3 ай бұрын
@@gui.ferreira tru tru 😀
@AboutCleanCode
@AboutCleanCode 6 ай бұрын
Great summary of the concepts of this architecture 👍How do you decide which third-party library you let into your hexagon? Or do you put "everything" behind a port? What about FluentValidations for example or the famous MediatR?
@gui.ferreira
@gui.ferreira 6 ай бұрын
Excellent question. If the library serves the connection of my hexagon to the external world, it goes into an Adapter. Example: npgsql will be in an adapter, while MediatR will be part of my hexagon. Do you follow another approach?
@AboutCleanCode
@AboutCleanCode 6 ай бұрын
@@gui.ferreira I try to be very strict and let as few libraries into my application logic directly as possible 😉
@C00l-Game-Dev
@C00l-Game-Dev 6 ай бұрын
I use a micro services architecture for my game dev, and this doesn’t really work for game dev, but I’ll keep it in the back of my mind!
@gui.ferreira
@gui.ferreira 6 ай бұрын
I agree. In most microservices (when they are in fact micro) it usually isn't needed.
@GiswaldCA
@GiswaldCA 6 ай бұрын
Hi thanks for your videos. Can you maybe make one for Kafka Streams with dotnet?
@gui.ferreira
@gui.ferreira 6 ай бұрын
Hi! Thanks 🙏 I'm not sure If I'm the best person to talk about Streams. But I will add it to my list and think about it. Thanks for the suggestion.
@BarbarosYurttagul
@BarbarosYurttagul 6 ай бұрын
This is a wonderful channel. I watched all your videos about hexagonal architecture. But I still have questions in my mind. I really can't see a difference between n-tier architecture and hexagonal when you applied dependency injection for every technology you used. For example, in data access layer, I can have an interface called IProductRepository which includes necessary methods. Then I can have a concrete class which name is like EFProductRepository implementing IProductRepository. If one day I would like to switch my ORM technology, then I can create another concrete class like DapperProductRepository implementing IProductRepository again. And it is still testable independent from technology. By using dependency injection, they are loose-coupled as well.
@gui.ferreira
@gui.ferreira 6 ай бұрын
What if I told you that what you described is not n-tier architecture anymore? 😉 It's how we naturally fight the problems of multitier architecture. I know that Wikipedia is not perfect, but if we look into the multitier architecture it says: "A layer is on top of another, because it depends on it. Every layer can exist without the layers above it, and requires the layers below it to function." en.wikipedia.org/wiki/Multitier_architecture According to your description, your "business" layer no longer depends on the data access layer. Am I correct?
@BarbarosYurttagul
@BarbarosYurttagul 6 ай бұрын
@@gui.ferreira You are right. My "business" layer doesn't depend on Data Access Layer. So, what is the name of this architecture then if it is not multi-tier or hexagonal?
@gui.ferreira
@gui.ferreira 6 ай бұрын
​@@BarbarosYurttagul From your description, you have a domain-centric architecture. On that family of architectures, you can find Hexagonal, Clean Arch or Onion. I would need to look into the complete blueprint to name it. However, the name is not the most important thing. If you apply the principles of Hexagonal, I bet you are in a good place.
@user-rv9kz9pk2c
@user-rv9kz9pk2c 4 ай бұрын
Is this aplicable to microservices? Is it needed then? Seems like over engineering for me. But also dont like thinking that this will be useful when working with monoliths only.
@gui.ferreira
@gui.ferreira 3 ай бұрын
It's a tradeoff. You will get testability and device independence. But, if it's a tiny service, such as a Service with a single responsibility to ingest a queue into a database, you might not get much out of it. Even then, designing applications as a 3-part system (input, core, output) is not such a big overhead and can be useful. By the way, each part doesn't need to be a different project or package.
Hexagonal Architecture for .NET Developers
16:54
Gui Ferreira
Рет қаралды 6 М.
Why I am using Hexagonal Architecture in my projects
11:11
Ivan Skodje
Рет қаралды 11 М.
Little brothers couldn't stay calm when they noticed a bin lorry #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 20 МЛН
Schoolboy Runaway в реальной жизни🤣@onLI_gAmeS
00:31
МишАня
Рет қаралды 3,7 МЛН
这三姐弟太会藏了!#小丑#天使#路飞#家庭#搞笑
00:24
家庭搞笑日记
Рет қаралды 48 МЛН
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 3,2 МЛН
flux+lora:用ComfyUI打造超逼真“同桌的你"!
12:19
Event Driven Architecture EXPLAINED in 15 Minutes
14:55
Continuous Delivery
Рет қаралды 29 М.
Do NOT Use Int IDs In Your API
8:01
Gui Ferreira
Рет қаралды 33 М.
Clean Architecture IS about Vertical Slicing, actually!
15:24
About Clean Code
Рет қаралды 35 М.
The missing Project that fixes everything in .NET
15:09
Gui Ferreira
Рет қаралды 10 М.
How do I Stay Organized as a Developer
15:21
Gui Ferreira
Рет қаралды 2,2 М.
This Book Changed how I Refactor Code
11:33
Gui Ferreira
Рет қаралды 6 М.
Hexagonal architecture: the what, why and when?
7:27
Yan Cui
Рет қаралды 10 М.
Everything Starts with a Note-taking System
21:23
Mischa van den Burg
Рет қаралды 242 М.
Little brothers couldn't stay calm when they noticed a bin lorry #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 20 МЛН