Vaadin 24.4 integrates with React, unifies Flow and Hilla development, and more!

DDD Part 3: Domain-Driven Design and the Hexagonal Architecture

This is the third part of our in-depth series on Domain-Driven Design (DDD). Part one discussed strategic domain-driven design and part two discussed tactical domain-driven design. Updated for 2023.

In this article, we'll take a look at how to turn a domain model into working software - specifically, how to use the hexagonal architecture.The previous two articles were pretty generic, even though the code examples were written in Java. Although a lot of the theory in this article can also be applied in other environments and languages as well, I have explicitly written it with Java and Vaadin in mind.

Again, the content is based on the books Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans and Implementing Domain-Driven Design by Vaughn Vernon. I highly recommend you read both of them. However, even though I presented my thoughts, ideas, and experiences in the previous articles, this one is even more strongly colored by my thoughts and beliefs. That said, the books of Evans and Vernon got me started with DDD in the first place, and I’d like to think that what I’m writing here is not too far from what you will find in the books.

This is the second version of this article. In the first one, I got the concept of ports wrong. This was pointed out in a comment by a reader, which I am very grateful for. I have now corrected this error and updated the examples and diagrams accordingly. Comments about my interpretations of this architectural style and DDD are always welcome.

Subscribe to our newsletter

Be the first to learn about new Vaadin resources and tips

DDD Part 1: Strategic Domain-Driven Design

This is the first part of our in-depth series on Domain-Driven Design (DDD). Part two discusses tactical DDD, whereas, in part three, you'll learn how to apply DDD to working software using Java and Vaadin. Updated for 2023. Domain-Driven Design (DDD) has been around since Eric Evans published his ...

Deploying a Spring Boot app as a native GraalVM image with Docker

In this final part of the Building an AI chatbot in Java series, we will deploy the Spring Boot AI chatbot application we've built as a GraalVM native image. Requirements The instructions in the article assume you are working with the Hilla Spring Boot application we've built in the series, but the ...

Building a ChatGPT-based AI bot using Spring Boot, React, and Hilla

In this article, we'll build a custom AI chatbot application using Hilla, Spring Boot, React, OpenAI (ChatGPT), and Pinecone. The chatbot is designed to answer Vaadin Flow and Hilla development questions using up-to-date documentation as reference material. My earlier blog post details the concept. ...

Enhancing ChatGPT with Prompt Engineering and Token Counting in Java

This article is part three of the Building an AI chatbot in Java series, where we're building a custom AI chatbot application using Hilla, Spring Boot, React, OpenAI (ChatGPT), and Pinecone. The chatbot is designed to answer Vaadin Flow and Hilla development questions using up-to-date documentation ...

Integrating Pinecone Vector Database into a Spring Boot Application

Dive into the process of integrating the Pinecone Vector database with a Spring Boot application using Java in this second installment of the Building an AI chatbot in Java series. Prerequisites The article assumes you have a Spring Boot application. The example project is a Spring Boot application ...

Calling ChatGPT and OpenAI APIs in Spring Boot with Java

This article will guide you on integrating OpenAI APIs, such as ChatGPT, in your Spring Boot application. We will cover moderation, embedding, and chat completion requests. It is a part of our Building an AI chatbot in Java series. Prerequisites This tutorial assumes you already have a Spring Boot ...

Building and Deploying an AI Chatbot with Java: A Comprehensive Guide

A while back, I built the Vaadin Docs Assistant, a ChatGPT-based AI assistant that can answer technical questions about developing with Vaadin Flow or Hilla based on the latest available documentation. If you're curious about the concepts behind the assistant, I recommend my earlier blog post. In ...
Resolving blocking dialogs with Vaadin

Tackling blocking dialogs in web applications with Vaadin

A blocking dialog is a dialog that blocks the code execution until an answer is obtained from the user. They can be a major hindrance to a seamless user experience in web applications. Imagine being engrossed in a task, only to be interrupted by a modal dialog that demands attention and halts your ...

Push Notifications: A real-world example with electricity prices

Web Push Notifications, also known as the Web Push API, are a service provided by browser vendors that enable web apps to display operating system notifications to end users, even when the browser window or installed app is closed. While this feature has been available for desktop browsers and ...