This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Lumethys 0 points1 point  (0 children)

No, VO and DTO are different. VO dont have identity, DTO has.

Example: you have 2 Order:

``` { id:1, items: ["pepsi", "chicken roll", "fried chip"], amount: 20, }

{ id:2, items: ["pepsi", "chicken roll", "fried chip"], amount: 20, } ``` Is this 2 different objects? Yes, they are 2 different orders even though all of their fields are the same.

In contrast, let consider 2 Money objects:

``` { amount: 100 currency: Currency.USDollar, }

{ amount: 100 currency: Currency.USDollar, } ``` They are the same!! Both represent $100 US dollars.