Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawbacks of Hexagonal Architecture

I have read few blogs and stackoverflow where i found out Hexagonal (Port and Adapters) pattern is a kind of good Domain Driven Architecture. Is there any issue like SEO, performance and other stuffs...

like image 976
Mothirajha Avatar asked Feb 11 '23 11:02

Mothirajha


1 Answers

Since Hexagonal makes use of Adapter and Façade patterns, you could consider the drawbacks of those patterns:

  • Both patterns use indirection (decoupling), so performance could be affected because of intermediate classes. For sure, one extra call will be made between the start and end of a service. There are extra lines of code, extra classes, thus extra complexity and extra effort to understand the design.

  • Adapters are traditionally polymorphic (in OO), so polymorphic calls can be harder to understand and debug. There's also (technically) a performance issue (polymorphic calls are also a hidden indirection).

  • Façades have a risk of becoming bloated. If your system has a lot of functions, then several smaller façades are better than one "god" façade. However, as you refactor your Façades to make them more cohesive, the code that calls the façade will also need changing. If your application's functions don't evolve much, then this is probably not a big risk.

like image 106
Fuhrmanator Avatar answered Feb 20 '23 13:02

Fuhrmanator