This repository is Java adaptation of sample code for the book
Principles, Practices and Patterns of Domain-Driven Design.
The original code is written in C#
.
Samples use various frameworks and technologies. These frameworks were replaced with the most close Java equivalents.
Samples in some chapters are complete applications. For such chapters, I added additional readmes.
I described replacements, problems, and screenshots of running apps.
Most technologes are replaced with equivalents that are popular in the Java world.
Original | Equivalent | Comment |
---|---|---|
ASP.NET |
Spring Thymeleaf |
See README in CH12, CH23 |
NServiceBus |
RabbitMQ, ApplicationEventPublisher |
See README in CH12 and CH18 |
Mass Transit |
Kafka |
See README in CH12 |
Syndication |
rometools |
See README in CH13 |
NHibernate |
Hibernate |
I skipped |
StringExtensions |
Java doesn’t support this feature, I used a ZeLiba. |
|
SQL Server Express |
see README CH21 |
|
StructureMap |
I made DI manually |
see README CH21 |
EntityFramework |
JOOQ with SQLite |
see README CH21 |
Dapper Micro ORM |
JDBI with SQLite |
see README CH21 |
Besides replacement of technologies, there is some language "sugar" to keep code more aligned to the book examples.
Original | Equivalent | Comment |
---|---|---|
GUID |
UUID |
As it’s just an example, for this project, there is no difference |
decimal |
BigDecimal with TheComparable |
ZeLiba for fluent comparison, as Java doesn’t support |
NotImplementedException |
own NotImplementedException |
see |
ApplicationException |
own ApplicationException |
see |
ArgumentNullException |
NullPointerException |
usually inside |
InvalidOperationException |
own InvalidOperationException |
see |
IEnumerable |
Arrays or |
The chapters below contain a detailed description of what I did, which replacements I used and why, which problems I’d faced and how I solved or worked around them.
It’s a big chapter, and it requires a separate readme. See ch12/README.adoc for details.
It’s a big chapter, and it requires a separate readme. See ch13/README.adoc for details.
This chapter required a bit of work with Hibernate. See ch15/README.adoc for details.
This chapter required a bit of work with "Static" DomainEvents
.
See ch18/README.adoc for details.
This chapter required a bit of work with ORMs and databases. See ch21/README.adoc for details.
This chapter required a bit of work with event sourcing. See ch22/README.adoc for details.
This chapter required a bit of work with ThymeLeaf. See ch23/README.adoc for details.
This chapter required a bit of work with ThymeLeaf and Commands Handlers. See ch25/README.adoc for details.
This chapter required a bit of work with EventStoreDB. See ch26/README.adoc for details.