Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dehasi/ppp-of-ddd

Java sample code for PPP of DDD book
https://github.com/dehasi/ppp-of-ddd

ddd ddd-architecture

Last synced: about 2 months ago
JSON representation

Java sample code for PPP of DDD book

Awesome Lists containing this project

README

        

= Principles, Practices and Patterns of Domain-Driven Design
:toc: preamble
:toclevels: 2

This repository is Java adaptation of sample code for the book
https://www.goodreads.com/en/book/show/25531393[Principles, Practices and Patterns of Domain-Driven Design].
The https://github.com/elbandit/PPPDDD[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.

image::assets/book-cover.png[]

== Replacements

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

.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 | https://github.com/dehasi/zeliba#TheString[TheString] | Java doesn't support this feature, I used a https://github.com/dehasi/zeliba[ZeLiba].

| SQL Server Express | MySQL, https://www.h2database.com/html/main.html[H2], https://www.sqlite.org/[SQLite] | see README CH21
| StructureMap | I made DI manually a| see README CH21
| EntityFramework | https://www.jooq.org/[JOOQ] with SQLite | see README CH21
| Dapper Micro ORM | https://jdbi.org/[JDBI] with SQLite a| see README CH21
|===

Besides replacement of technologies, there is some language "sugar" to keep code more aligned to the book examples.

.replacements
|===
|Original |Equivalent | Comment

| GUID | UUID | As it's just an example, for this project, there is no difference
| decimal | BigDecimal with https://github.com/dehasi/zeliba#TheComparable[TheComparable] | https://github.com/dehasi/zeliba[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 link:ch12/README.adoc[] for details.

=== Chapter 13
It's a big chapter, and it requires a separate readme.
See link:ch13/README.adoc[] for details.

=== Chapter 15
This chapter required a bit of work with Hibernate.
See link:ch15/README.adoc[] for details.

=== Chapter 18
This chapter required a bit of work with "Static" `DomainEvents`.
See link:ch18/README.adoc[] for details.

=== Chapter 21
This chapter required a bit of work with ORMs and databases.
See link:ch21/README.adoc[] for details.

=== Chapter 22
This chapter required a bit of work with event sourcing.
See link:ch22/README.adoc[] for details.

=== Chapter 23
This chapter required a bit of work with ThymeLeaf.
See link:ch23/README.adoc[] for details.

=== Chapter 25
This chapter required a bit of work with ThymeLeaf and Commands Handlers.
See link:ch25/README.adoc[] for details.

=== Chapter 26
This chapter required a bit of work with EventStoreDB.
See link: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.