What is the Book About


Thanks Myfuture.com, https://www.flickr.com/photos/myfuturedotcom/6053042920

Typical Shopping Cart

Let’s imagine it


Thanks Qui Nguyen Khac, https://pixabay.com/users/nguyenkhacqui-2851627/

Don’t repeat yourself

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system

— Andy Hunt and Dave Thomas, The Pragmatic Programmer

Car in API

An example of such transferred car

{…


Thanks Lisa Johnson, https://pixabay.com/users/elljay-962436/

We use access modifiers to hide certain properties or methods — public, protected, private. Final is used to disallow children. But why would we hide something or disallow anything? Why to do such things?

We have to often implement new features or modify existing ones. This results in extending current…


How to apply

1. Hear the story


Let’s think for a while — where do we use class/interface name?

  • During creating object from the class (new Product(...))
  • In usage

Creating objects


Domain-driven design is about the domain. Domain services and domain factories do not exist in the domain. In general we shouldn’t use them.

They are artificial constructions and this causes a lot of problems with code understanding, maintainability and also divergence between the domain, the model and the code.

Domain Service


Product Name Story


The repository is a persistent collection that we know from repository article. We expect that we know the cart model from model and implementation articles. But it doesn’t make any harm if we repeat the cart model again.


Collections and Reality

Svaťa Šimara

Developer interested in Domain-Driven Design & Modeling

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store