© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
N. LamouchiPro Java Microservices with Quarkus and Kuberneteshttps://doi.org/10.1007/978-1-4842-7170-4_9

9. Applying DDD to the Code

Nebrass Lamouchi1  
(1)
Paris, France
 

You learned, in the previous chapter, how to use domain-driven design (DDD) to split your domain into bounded contexts.

In this chapter, you learn how to split your code using the cut lines defined in the previous chapter.

Applying Bounded Contexts to Java Packages

Our classes are already classified by component type, such as repository, service, etc.

We will move every component in a new package that includes the bounded context name. The name of each component has this format:

After refactoring, ...

Get Pro Java Microservices with Quarkus and Kubernetes: A Hands-on Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.