Hexagonal Architecture: What You Need To Know - Simple Explanation

  Рет қаралды 85,748

Alex Hyett

Alex Hyett

Күн бұрын

Пікірлер: 134
@drondiwe
@drondiwe 4 ай бұрын
hate when I'm being asked like "have you heard of X architecture" and I never heard of it but it turns out that I was using it a lot and I just was asked about its fancy name
@eitan71
@eitan71 2 ай бұрын
i know exactly what you mean. i've been using it for at least 12 years now, and never cared or bothered to know how it's called. same was with "Agile". the hi-tech world is full farts who wants to stamp their name in the industry...
@rodrigoalencar2305
@rodrigoalencar2305 2 ай бұрын
I don know you but it seen to me that is only apply plugin pattern time and time again but with different names, onion, hexagonal etc...
@MichaelCampbell01
@MichaelCampbell01 23 күн бұрын
This was great. Of note though, hexagons can still exist in a monolith - the "independently deployed" thing is more a µservice worry than HexArch, although HexArch is common way to do µservices.
@tim_abell
@tim_abell Жыл бұрын
Thanks for including the downsides [00:06:17] - think you nailed it there, basically it's over-engineering unless you have a damn good reason to use it, and frankly I think the terminology introduces more confusion instead of reducing it. Great explanation of what it is and the alleged benefits are.
@alexhyettdev
@alexhyettdev Жыл бұрын
Thanks Tim!
@danjelhysenaj4859
@danjelhysenaj4859 7 ай бұрын
Hands down this is the simplest explanation that I have ever seen. Excellent Presentation Alex!
@alexhyettdev
@alexhyettdev 6 ай бұрын
Thank you!!
@PaulSebastianM
@PaulSebastianM Жыл бұрын
Great video. For me Clean Architecture and Hexagonal Architecture are just different ways to achieve the same thing: decoupling input and output and increasing feature cohesion. /subbed
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you! Yes they are both good options.
@sylvereleipertz955
@sylvereleipertz955 Жыл бұрын
That's 2 words for the same concept
@jorisw_
@jorisw_ Жыл бұрын
Simplest and clearest intro I've seen so far. And as with most of these patterns, in the end it's the labeling and metaphors that had obscured most of it or me, whilst the concept itself, once visualized, is simple and clear as day.
@alexhyettdev
@alexhyettdev Жыл бұрын
That is awesome to hear. Yes there is so much jargon that make these concepts a lot harder to understand than they need to be.
@jonathansilva3364
@jonathansilva3364 11 ай бұрын
Thank you for this simple explanation. I know there might be a lot more details to it, but you beautifully managed to remove the noise so the core concepts (ports and adapters) could shine. Thank you very much.
@alexhyettdev
@alexhyettdev 11 ай бұрын
You're very welcome! Thank you for commenting!
@storm14k
@storm14k 11 ай бұрын
Glad I found this! I'd run across the "no interfaces for repositories" crowd and we'd adopted it at my last gig but in all of my personal work I prefered them for this exact reason. And I especially try to make the interface only have read/write or store/retrieve methods as much as possible to avoid business context dripping down into the repo code. It starts with repo method names that reflect business terminology to me. And for the past 5 years or so I've been bouncing back and forth about the input side as well. Seeing it all in this one pattern has given me some things to consider. Thanks. You have a new subscriber.
@alexhyettdev
@alexhyettdev 11 ай бұрын
Thanks for commenting!
@roku_on_it
@roku_on_it Жыл бұрын
I was trying to understand this concept for over 1 week. Things became clear when you quoted the founder saying calling a database is no different than calling/using an external service. I guess we could call it "Adapter Pattern everywhere". I think this subject is being told way more complicated than it actually is, but you kept it fairly simple. Nice explanation!
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you! Yes Adapter Pattern everywhere sums it up nicely.
@prrs4809
@prrs4809 4 ай бұрын
Same here man, cheers for that quick expain!
@Trythrow
@Trythrow 2 ай бұрын
It does not necessarily mean that every hexagon is a separate service running in a separate container. It could be modules within the same application working together if your application is monolithic. Otherwise, it will be a form of hexagonal microservice architecture.
@saralightbourne
@saralightbourne Жыл бұрын
from the perspective of an active learner, your channel is a treasure. thank you a lot, please don't stop doing what you're doing
@alexhyettdev
@alexhyettdev Жыл бұрын
You’re welcome! I am glad you like my videos.
@jhonsen9842
@jhonsen9842 Ай бұрын
Simply brilliant. Clear and concise. 1 Comment and 1 Like from my End.
@justfair4181
@justfair4181 Жыл бұрын
the best explanation found over here, youtube
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you!!
@LongNguyen-t4c9o
@LongNguyen-t4c9o Жыл бұрын
Very clear for a newbie as me. Thank you so much
@alexhyettdev
@alexhyettdev Жыл бұрын
You're very welcome!
@Tolmachovtv
@Tolmachovtv 3 ай бұрын
Nice short and clear explanation. Thanks!
@maheshbeeravelli
@maheshbeeravelli Ай бұрын
All your contents are good. But for the concept diagrams and animations there is fast switch between the screens even before I try to understand what's in the animation and causing to loose focus, a little improvisation to keep the animations in a corner while you are in the background or keep them bit longer for user to consume before switching screen. Just a suggestion and Thank you.
@khalidelgazzar
@khalidelgazzar 9 ай бұрын
Great video. Watched it a while ago and I keep coming back for a refresher.
@alexhyettdev
@alexhyettdev 8 ай бұрын
Glad you enjoyed it!
@AniketJadhav-m2r
@AniketJadhav-m2r 10 ай бұрын
You are Nutshell explainer. I appreciate your skills. Kudos to your Technical Perspective!
@alexhyettdev
@alexhyettdev 10 ай бұрын
Thank you! I like that, maybe I should have nutshell explainer as my tagline!
@danclarkeuk
@danclarkeuk Жыл бұрын
Great video - one of the clearest explanations I've seen! Nice work! 👍
@alexhyettdev
@alexhyettdev Жыл бұрын
Thanks Dan! I am having fun creating the animations. I am enjoying your videos too!
@danclarkeuk
@danclarkeuk Жыл бұрын
Thanks too. I'm finding editing KZbin videos way more fun than podcasts! 😂 But perhaps that's just because video editing is so new at the moment, so a lot to learn!
@acupfb
@acupfb Жыл бұрын
Great explanations, thank you! I also have the same understanding, recursive hexagons
@alexhyettdev
@alexhyettdev Жыл бұрын
👍 thank you. I am gad you liked it.
@Computerix
@Computerix 2 ай бұрын
Amazingly explained, thanks !
@jhonjbautistab
@jhonjbautistab Жыл бұрын
Me encanto el video, mil garcias por la explicación
@alexhyettdev
@alexhyettdev Жыл бұрын
De nada, me alegro de que lo hayas disfrutado.
@marceloleoncaceres6826
@marceloleoncaceres6826 13 күн бұрын
Thanks for the video,
@browski999
@browski999 6 ай бұрын
Great explanation, but it'll be good to have sample code examples to reinforce this concept😊
@gabrielnzete8913
@gabrielnzete8913 4 ай бұрын
This is simply fantastic, many thanks sir
@SpringframeworkGuru
@SpringframeworkGuru 11 ай бұрын
Hey Alex - Just found your channel and subscribed. Great content and really nice job on your production! Kudos from the founder of Spring Framework Guru!
@alexhyettdev
@alexhyettdev 11 ай бұрын
Awesome, thank you!
@desouzafelipe
@desouzafelipe Жыл бұрын
High quality explanation, thank you and good job!
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you, I am glad you enjoyed it!
@sreescorner
@sreescorner Жыл бұрын
Thank you for the very clear explanation and intuitive presentation
@alexhyettdev
@alexhyettdev Жыл бұрын
You’re welcome! I am glad it was easy to understand.
@olliDeg
@olliDeg Жыл бұрын
Great video! I hope you keep going and get the recognition you deserve!
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you! 🤞
@maryamrosetvgermany9259
@maryamrosetvgermany9259 3 ай бұрын
the name is changed to adapters and ports pattern
@soheil_a
@soheil_a Жыл бұрын
Great, simple and clear explanation, keep it up!👍
@alexhyettdev
@alexhyettdev Жыл бұрын
Thanks, will do!
@GiPa98
@GiPa98 4 ай бұрын
Thank you for the video!
@andreacfromtheapp
@andreacfromtheapp 7 күн бұрын
Simple. Direct. To the Point. Inforhative. Very well-done!!! Thanks :) EDIT: *checks cannel*. --> *subscribed*
@farooqmss
@farooqmss 11 ай бұрын
simply beautiful.
@alexhyettdev
@alexhyettdev 11 ай бұрын
Thank you!
@AzamMahdipour-j6b
@AzamMahdipour-j6b Жыл бұрын
Super! Thank you, was really helpful.
@alexhyettdev
@alexhyettdev Жыл бұрын
You're welcome!
@josephgreene630
@josephgreene630 Жыл бұрын
Can you do some basic data structure to real world usage examples?
@alexhyettdev
@alexhyettdev Жыл бұрын
Sure I will add that to my content list. Thanks for the suggestion.
@СлавныйЛехаОбломов
@СлавныйЛехаОбломов 7 ай бұрын
Since when trivial interfaces start to be called as "hexagonal architecture"?
@abellix
@abellix 7 ай бұрын
Thanks God someone else is saying that as well
@adriankearns1005
@adriankearns1005 3 күн бұрын
Since 2004, although the originator of this architectural style (Alistair Cockburn) renamed it to "Ports and Adaptors" in 2005.
@chastor1961
@chastor1961 Жыл бұрын
super
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you!
@mehtubbhai9709
@mehtubbhai9709 8 ай бұрын
Hi Alex. Absolutely love the content you're putting out. Could you or anyone else point me to some sample code that is a good example of the ports and adapters pattern. Thanks in advance.
@hexchad765
@hexchad765 5 ай бұрын
Ports and adapters, all day
@gosnooky
@gosnooky Жыл бұрын
He actually pronounced "hexagonal" properly. Also, it's a hexagon because hexagons are the bestagons
@alexhyettdev
@alexhyettdev Жыл бұрын
Lol, how do other people pronounce "hexagonal"?!
@PaulSebastianM
@PaulSebastianM Жыл бұрын
I just did a revisit of this video. 5 months later, lol. I would want to add something though. You talk about whether someone should use HA, especially when they have a complex or large application, but don't list any alternatives for when they don't. For example, for a simple microservice, a simple MVC or 3 Layer + VSA approach could suffice.
@alexhyettdev
@alexhyettdev Жыл бұрын
Yes good point. I assumed if someone was looking into hexagonal architecture they would know about the alternatives. Always good not to assume anything though!
@achillesnakmuay
@achillesnakmuay 10 ай бұрын
Hey Alex, Fantastic content, you explain these concepts in a clear and concise manner which is great. What is your opinion on using these patterns on the frontend? I have a large Vue app and I'm trying to decide between Hex or DDD architecture. Do you have any suggestions?
@MrGenbu
@MrGenbu Жыл бұрын
That brilliant 👏👏
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you 🙏
@findingnewname2644
@findingnewname2644 Ай бұрын
How is the hexagonal arch help on testing? i mean even not use hex arch you can still using mock lib to mock the concret class so what's the point on testing here?
@fadygamilmahrousmasoud5863
@fadygamilmahrousmasoud5863 Жыл бұрын
very informative
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you, I am glad it helped.
@nb-th7kr
@nb-th7kr Жыл бұрын
thanks for this :)
@alexhyettdev
@alexhyettdev Жыл бұрын
You’re welcome, I hope it was helpful!
@Enigma758
@Enigma758 Жыл бұрын
How is this any different from separating interface from implementation? Is there anything new here that hasn't been already been preached for decades?
@alexhyettdev
@alexhyettdev Жыл бұрын
That is essentially what it is but explicitly making sure that your core code only relies on interfaces it owns and external components interact with a different interface. The idea is to completely decouple your inputs and outputs.
@adriankearns1005
@adriankearns1005 3 күн бұрын
It's not different, but in fairness Alistair Cockburn originated the name "Hexagonal Architecture" in 2004, and then renamed it to "Ports and Adaptors" in 2005, so this isn't "new" by any stretch. Poor Alistair, renames the architecture for good reason but the old name seems to have stuck.
@hexchad765
@hexchad765 5 ай бұрын
Seems obvious but that there is a word for it
@ernesttan8090
@ernesttan8090 Ай бұрын
Is it the same as microservices?
@adriankearns1005
@adriankearns1005 3 күн бұрын
This architectural style (Hexagonal) focuses on how to logically arrange code and separate concerns, not how to deploy and run the code. Microservices looks at how to logically arrange code and separate concerns, but with the added ideas of the services being separately deployable and developed/maintained by different teams.
@dimitrisimeros3634
@dimitrisimeros3634 Жыл бұрын
So is it prerequisite the domain driven design in order to have an hexagonal architecture? If I am in a monolithic application, is this correct to split it as presentation-logic-database model and then think of domain driven logic? How to think in old legacy monolithic applications?
@alexhyettdev
@alexhyettdev Жыл бұрын
DDD isn't a prerequisite, it is just helpful when it comes to splitting a system into different microservices. You want each hexagon to be self-contained, and be able to work in isolation. That is just easier to do if it contains a whole domain and doesn't have to rely on other systems too much. I would personally start with domains first rather than presentation-logic-database modal. For example, I have seen teams take things like auditing out of their monolithic application and create an auditing domain. This then gets reused by all other applications that need auditing capabilities. The team will often then expand this to provide UI and other capabilities. The domains usually come first.
@acupfb
@acupfb Жыл бұрын
I think, inside the monolith, you can create little hexagons, encapsulating smaller domain concepts So, the answer is yes
@joshblf
@joshblf Жыл бұрын
Adapters sound like Facades. Am I missing something here? 🤔
@alexhyettdev
@alexhyettdev Жыл бұрын
That’s essentially what they are. The Ports are facades as well but are written by the application. It is facades talking to facades for maximum abstraction.
@sylvereleipertz955
@sylvereleipertz955 Жыл бұрын
I don't get the second con. Clean architecture or not, it make not difference to run it locally. You can have monolithic application with clean architecture, you would start it exactly the same
@alexhyettdev
@alexhyettdev Жыл бұрын
It is more for when you have multiple components running as separate microservices as mentioned in the video. Yes for 1 component using clean architecture there is no difference.
@FlaviusAspra
@FlaviusAspra Жыл бұрын
I was so happy to see people want to talk about hexagonal architecture. But while you made some absolutely true statements about it, so did you also make a lot of wrong ones, who would drive people away from it for the wrong reasons.
@alexhyettdev
@alexhyettdev Жыл бұрын
It’s important to show both sides, it isn’t always the right architecture for everyone. There are always ways to mitigate some of the negatives it just depends how you design it.
@FlaviusAspra
@FlaviusAspra 4 ай бұрын
​@alexhyettdev the "other side" should be the correct "other side", so that people make informed decisions, not uninformed ones.
@peterbyun441
@peterbyun441 Жыл бұрын
Thank you for your high-quality content. I love how you explain complex concepts with minimum jargon.
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you Peter!
@rvrunkillyow716
@rvrunkillyow716 22 күн бұрын
How does this architecture differ from CQRS? Thanks in advance.😊
@geforex28
@geforex28 Ай бұрын
Thank you for the video! But it’s hard for me to understand the difference with three tier architecture. In my head when I’m doing three tier architecture, with controller, service and repo, it’s like the service is the « port » with the business logic et the repo is the « adapter » with the logic to manipulate the database for instance. So why are they really different ?
@pedrocarmezim6905
@pedrocarmezim6905 3 ай бұрын
This is a good explanation, but.. Isn’t this a micro-services architecture, where the applications all talk json( for example) and the adapter only transform json to mysql( for example) for the databases, or strings/bits etc for filesystem buffers? The adapter will always change when tou pick another service to work with the app. Cool name though. Thanks
@BRNAMO
@BRNAMO 7 ай бұрын
Thanks for the explanation! This video really helps me!
@___gg421
@___gg421 Жыл бұрын
Wow just want to leave a comment show I was here early once you blow up
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you! 🤞🏻
@AmexL
@AmexL Жыл бұрын
Same, I’m in the sub-3k group.
@estevaoyt
@estevaoyt 7 ай бұрын
Best explanation of hexagonal architecture! Thank you very much! Keep it up!
@nnutkin
@nnutkin Жыл бұрын
This is indeed simple explanation. Thank you !
@alexhyettdev
@alexhyettdev Жыл бұрын
You’re welcome! I am glad it helped.
@armandoleon9901
@armandoleon9901 9 ай бұрын
I have a question. Say if you’re hitting an external api service to do some action, like create a deploy and I have followed the port adapter pattern. Now, say in the future that we switch to another api service with a completely different schema for creating the deployment. Do we leave the interface intact as it is, since the adapter pattern lets us transformer the data? What if the transformation is too awkward, i.e the new api requires more information than the previous api?
@fuadadio
@fuadadio 4 ай бұрын
Thanks for the video. Your explanation is so clear and your animations are so helpful. The video is so clean. I can imagine the amount of work that goes into these videos. Thank you, Alex.
@Rope257
@Rope257 Жыл бұрын
I program mostly in OOP-languages and sometimes I feel like patterns like this just provide wrappers around I/O that functional languages use types for. Good explanation though much appreciated.
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you. Yes I should probably do a video on functional vs OOP languages.
@ZuHoLee
@ZuHoLee Жыл бұрын
Awesome content! Keep going bro!
@alexhyettdev
@alexhyettdev Жыл бұрын
Thanks Hoang!
@SaminYasir-f3m
@SaminYasir-f3m 9 ай бұрын
Very Good explanation. Thank you
@alexhyettdev
@alexhyettdev 9 ай бұрын
Thank you!
@vamankamath6329
@vamankamath6329 4 ай бұрын
Outstanding clarity.
@lucasdebritoarruda7831
@lucasdebritoarruda7831 Жыл бұрын
Great video! Won a new subscriber!
@alexhyettdev
@alexhyettdev Жыл бұрын
Awesome! Thank you!
@Mister_tea_
@Mister_tea_ Жыл бұрын
Great content. Thank you. And nice plant behind you )
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you! A little secret 🤫, it's not real 🤣. I am terrible with plants. I have always wanted a bonsai tree, but I knew if I had a real one, it wouldn't last very long!
@Mister_tea_
@Mister_tea_ Жыл бұрын
@@alexhyettdev I see, it is a mock plant )
@sebon11
@sebon11 Жыл бұрын
Great explanation dude, as always
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you!
@danyald4880
@danyald4880 Жыл бұрын
Wonderful explanation !
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you!
@FiruzzZ-777
@FiruzzZ-777 14 күн бұрын
I know why is called Hexa.. because you need to write 6 times more code
@嘉然今天吃战斧牛-u1h
@嘉然今天吃战斧牛-u1h Жыл бұрын
Legenardy explanation, I think a lot of people do not really explain this software architecture clearly, but your explain is super clear and helpful.
@alexhyettdev
@alexhyettdev Жыл бұрын
Thank you, I try my best. I am glad it was clear for you. I should do some more of these 🙂
Monolithic vs Microservice Architecture: Which To Use and When?
10:43
Domain Driven Design: What You Need To Know
8:42
Alex Hyett
Рет қаралды 125 М.
POV: Your kids ask to play the claw machine
00:20
Hungry FAM
Рет қаралды 22 МЛН
Clean Architecture IS about Vertical Slicing, actually!
15:24
About Clean Code
Рет қаралды 36 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 277 М.
Hexagonal, Onion & Clean Architecture
4:30
Drawing Boxes
Рет қаралды 57 М.
why are switch statements so HECKIN fast?
11:03
Low Level
Рет қаралды 410 М.
*Next-door 10x Software Engineer* [FULL]
4:50
Programmers are also human
Рет қаралды 640 М.
SOLID Principles: Do You Really Understand Them?
7:04
Alex Hyett
Рет қаралды 178 М.
Event-Driven Architecture: Explained in 7 Minutes!
7:18
Alex Hyett
Рет қаралды 110 М.
Hexagonal Architecture (All You Need to Know)
9:51
Gui Ferreira
Рет қаралды 7 М.
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 79 М.