Entities vs Value Objects: Which one is BETTER?

preview_player
Показать описание
In this video, we explore in detail the differences between Entities and Value Objects (VOs) in the context of domain-driven design (DDD).

At the end of the video, we also see with concrete code example why we should prefer one over the other whenever possible.

📅 *Let's have a 1:1 Call to discuss anything you wish* 📅

🤓 *You find much more on my website! 🤓

🤝 Connect with me: 🤝

👌Get a CodeCrafter Discount 👌

🍕 *I've got an Italian accent* 😅
If you have trouble understanding me, activate the closed captions! They are manually corrected.

#ddd #softwaredevelopment #softwarearchitecture #softwaredesign
Рекомендации по теме
Комментарии
Автор

Do you use Value Objects enough in your models? Do you make the immutable? Let me know 🤓

MarcoLenzo
Автор

Gonna try yo use value objects more... As tou said, it's easier to maintain and the code is more readable ...

digitic
Автор

Hi Marco, great video thanks. Im a little bit confused on how manage order Items in order aggregate without expose the item set, how iterate over them, update item quantity (may be a easy method) and mapping to dto? And, what method explotion mean?
I appreciate your advice a lot.

jairo_manrique
Автор

Setters shouldn't be private for RGBColor VO as rule of thumb ??? Creating VO with "new" and "public" constructor? Setter would return a new instance everytime of RGBColor, something is not good....

YoQi-rmxn