Bedilbek's Observations
24 subscribers
17 photos
1 file
58 links
Observations of a Tech who looks at different perspectives to better document every piece of work
Download Telegram
I recalled one moment from my life when I created a bug in the system unintentionally. This was related to Value object vs Entity problem in DDD (Domain Driven Design).

To give an example from life let me bring my past experience with Lebazar (Delivery service). When I ordered first time, I set the address to my home. Then for my second order, I had to order some groceries to my office, so I changed my previous address to "Улица Тамарахоним".
Magic happened and my first order's address was also changed to my office's address. (You can see the screenshot in the next post)

The address inside the order should be a Value object, not an Entity. Entity has an identifier quality which defines it as an identity so that it may have relationships. Whereas Value object has just a supplemental purpose and doesn't have an identity and can't have any relationships. It means Entities may be prone to change, whereas value objects are not, they always should be recreated even if it creates redundancy problem.

This was a huge bug in Lebazar in my point of view and it was creating a bias data which literally could turn into trash for their future big data analysis.

Of course, I warned them about it, maybe they fixed, maybe not, I don't know.

#bug #advice #ddd #valueobject #entity #subjective #opinion