Skip to content
No description, website, or topics provided.
Java
Branch: master
Clone or download

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spring-with-mybatis set mysql charset & collat in docker-compose file Dec 16, 2019
.gitignore update .gitignore Aug 8, 2019
LICENSE Create LICENSE Mar 24, 2019
README.md update readme May 4, 2019

README.md

DDD Architecture Samples

At first, you must remember, a simple blog system often does not need to use a DDD workshop (like Event Storming) to design and apply a complex architecture. However, when you are skilled, you will find DDD thinking is very usefully for your daily thought. Also, your modeling speed will be more and more fast. So you can quickly complete all the design process in your brain.

These examples aim to demonstrate a DDD architecture with different tech stacks, which can work in the real project and let you understand and reference quickly.

When designing these samples, I refer to the following architecture patterns:

And I designed them with these principles (you can call it CUPET):

  • Easy to Code
  • Easy to Understand
  • Easy to Protect
  • Easy to Extend
  • Easy to Test

Domain Model & Humble Object

Work in progress...

Specification Pattern

Test Strategy

Architecture Test

Work in progress...

API Test

Work in progress...

Repository Test

I don't write the test for the specific implementation of repositories, and the instead is inject the repository implementation to services, and write the integration tests for the services.

Because when we used the domain models and services to replace anemic models like POJO or POCO, it makes creating input data for repositories in the tests are very difficult. The more important is only focus on the implementation of repositories is make little sense; they must work correctly in the business context (services).

Service Test

The test doubles are handy when writing unit tests for services. This way can make the service's tests very easy because we want to focus on the business logic in service, not the implementation of domain models and repositories.

Domain Test

Work in progress...

You can’t perform that action at this time.