Hexagonal Architecture (also known as Ports and Adapters) is an architectural pattern that moves from a layered model to a "centered" model. The goal is to isolate the application's core logic (the Domain) from external concerns—UI, databases, and third-party APIs—by using explicit interfaces (Ports) and implementations (Adapters).
In a traditional layered architecture, the Business layer depends on the Data Access layer. Hexagonal Architecture flips this:
The core contains only business logic. It has zero dependencies on frameworks (like Spring) or drivers.
PageService.save()).PageRepository).Adapters bridge the gap between the Port and the external technology.
In Wikantik, the PageManager interface is a Driven Port. The engine doesn't care if pages are stored in a Git repo, a database, or a cloud bucket.
wikantik-api)public interface PageRepository {
void persist(WikiPage page);
Optional<WikiPage> fetch(String id);
}
wikantik-main)public class JdbcPageRepository implements PageRepository {
private final JdbcTemplate jdbc; // Implementation detail
@Override
public void persist(WikiPage page) {
jdbc.update("INSERT INTO pages...", page.getId(), page.getContent());
}
}
A common failure in "Hexagonal" systems is Framework Leakage. If your WikiPage entity in the core hexagon contains JPA annotations (@Entity, @Table), you have leaked infrastructure into the domain.
The Wikantik Standard:
wikantik-api are POJOs or Records with zero annotations.WikiPage to a PageDbo).save() or commit(). It returns events or updated state; the Application Service (the driving port implementation) handles the persistence orchestration.See Also: