DEV Community

Bertil Muth
Bertil Muth

Posted on • Edited on

1

Hexagonal Architecture - Next Generation

Recently, I've written extensively about implementing a hexagonal architecture.

One issue that came up as feedback was that the app uses shared mutable state. It sets up a session bean, so that the driver adapter can contact the driven adapter to add the result data to Spring's MVC model. Shared mutable state and blocking operations can be an impediment in a production setting.

I just wanted to inform you that I created a new version of both the sample hexagon core, and the Spring Boot adapter. The application:

  • let's you configure if you want to return the poem data to the driver adapter (e.g. the Spring Controller), or pass it on to a driven adapter (e.g. the ConsoleWriter)
  • accesses the hexagon in an asynchronous way, but allows you to wait for the result
  • avoids shared mutable state

You find the hexagon core in this project:
https://github.com/bertilmuth/poem-hexagon-nextgen

You find the Spring Boot adapter in this project:
https://github.com/bertilmuth/poem-springboot-nextgen

I know that is just a short summary. If you have any questions or need for further information, just let me know.

Acknowledgements

Kudos to Willi Schönborn and JuanMGP for their patience and ideas.

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (1)

Collapse
 
bertilmuth profile image
Bertil Muth

Hey folks. I wanted to let you know that the projects mentioned here no longer exist.

The reason is that
a) I rewrote the original article to no longer use shared mutable state
b) the information how to build such an application is now mostly contained on the requirements as code website.

If you have a question, don't hesitate to ask!

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay