skip to Main Content

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…

2

Answers


  1. Hexagonal architecture helps you to decouple domain and infrastructure layer, so you can easly replace some parts of infrastructure and domain layer won’t even notice. In example you can change UI from WEB based to stand alone or switch persistence storage from MySQL to redis, and you won’t have to change anything in your domain layer.

    Hexagonal architecture is not protecting you from performances issues, you have to take care of it yourself.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search