Skip to content

dehasi/ppp-of-ddd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Principles, Practices and Patterns of Domain-Driven Design

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.

book cover

Replacements

Most technologes are replaced with equivalents that are popular in the Java world.

Table 1. technologies
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 fluent-hibernate, see README in CH15, CH21

StringExtensions

TheString

Java doesn’t support this feature, I used a ZeLiba.

SQL Server Express

MySQL, H2, SQLite

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.

Table 2. replacements
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 > or < for BigDecimal.

NotImplementedException

own NotImplementedException

see java-replacements

ApplicationException

own ApplicationException

see java-replacements

ArgumentNullException

NullPointerException

usually inside Objects.requireNonNull

InvalidOperationException

own InvalidOperationException

see java-replacements

IEnumerable

Arrays or List<>

Chapters with Additional Readme

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.

Chapter 12

It’s a big chapter, and it requires a separate readme. See ch12/README.adoc for details.

Chapter 13

It’s a big chapter, and it requires a separate readme. See ch13/README.adoc for details.

Chapter 15

This chapter required a bit of work with Hibernate. See ch15/README.adoc for details.

Chapter 18

This chapter required a bit of work with "Static" DomainEvents. See ch18/README.adoc for details.

Chapter 21

This chapter required a bit of work with ORMs and databases. See ch21/README.adoc for details.

Chapter 22

This chapter required a bit of work with event sourcing. See ch22/README.adoc for details.

Chapter 23

This chapter required a bit of work with ThymeLeaf. See ch23/README.adoc for details.

Chapter 25

This chapter required a bit of work with ThymeLeaf and Commands Handlers. See ch25/README.adoc for details.

Chapter 26

This chapter required a bit of work with EventStoreDB. See ch26/README.adoc for details.

Contributing

Improvements are welcome! Feel free to create issues or pull requests. Fixing mistyping in readmes is also welcome!

Each readme has a ToDon’t list. It’s a list of potential improvements, but I won’t have time for them. Feel free to check them.

About

Java sample code for PPP of DDD book

Topics

Resources

Stars

Watchers

Forks

Languages