Tracking Software Architecture Decisions

Maybe this sounds familiar to you: joining a new software engineering company or moving from your current team to a different team and being asked to keep evolving an existing product. You realized that this solution is using an uncommon architectural pattern in your organization. Let’s say it is applying event sourcing for persisting the state of the domain aggregates. If you like event sourcing; but do not like it for the specific nature of the product, most likely, it wouldn’t have been your first choice. As a software architect, you start to find the rationale behind that solution, find documentation with no success, and ask the software engineers that do not have the answer you were looking for.

This situation might have a relevant negative impact. Software architectural decisions are key and drive the overall design of the solution, impacting maintainability, performance, security, and many other “-alities.” There is no perfect software architecture decision designing architectures is all about trade-offs, understanding their implications, sharing their impacts with the stakeholders, and having mitigations to live with them.

Testing Repository Adapters With Hexagonal Architecture

When applying hexagonal architecture (ports and adapters) with access to infrastructure elements like databases is done by the mean of adapters, which are just implementations of interfaces (ports) defined by the domain. In this article, we are going to provide two implementations of the same repository port, one in-memory and another based on JPA, focusing on how to test both implementations with the same set of tests.

Context

Many software solutions usually developed in the enterprise context have some state that needs to be persisted in a durable store for later access. Depending on the specific functional and non-functional requirements, selecting the correct persistence solution can be hard to make and most likely require an Architecture Decision Record (ADR) where the rationale of the selection, including alternatives and tradeoffs, is detailed. For persisting your application state, most likely, you will look at the CAP Theorem to make the most adequate decision.