Is Equality Comparison a Code Pollution?

added by DotNetKicks
7/14/2020 3:32:37 PM

535 Views

In the book, I wrote that when the test's assertion section grows too large, it could be a sign of a missing abstraction. And that's exactly the case for our sample code: the Address class is a Value Object, meaning that it doesn't have an identity and we should compare its instances not by reference (which is the default way in most OOP languages), but using structural equality.


0 comments