8000 GitHub - alleknalle/poc-doctrine-ddd
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

alleknalle/poc-doctrine-ddd

Repository files navigation

Main goal

Split domain entities and data store entities to work strictly hexagonal/DDD

What do we want

  • use value objects in domain and primitives in data store -> from the beginning!
  • use separate identifier in domain (something unique like username/slug) and data store (id) -> nope, we need matching ID's and it needs to be something that can never change. Username/slug CAN possibly change later, so probably always use separate ID's
  • a DDD way of database transactions -> no flush in repository (keep in mind that you can have different data stores)
  • asymmetric relations: use objects when making a relation, use identifiers when getting a relation ->setUserGroup($group) and ->getUserGroupId() -> how does this work with retrieving an entity since the whole object is needed in the constructor?
  • use nullable composed value objects
    • improve this by using separate classes in doctrine entities to make it DRY -> traits?

How to test

  • create method in test
  • update method in test
  • read method in test
    • custom query with relations in test
  • delete method in test
  • have a root aggregate with children for all of the above

Questions

  • Do we need to have separate CRUD methods in repository?
  • Do we need reflection for repo/mapper?

Reads

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages 0

No packages published
0