My goal is to provide an easy way to ensure “clean...
# random
d
My goal is to provide an easy way to ensure “clean” data from outside sources. Imagine if the server sends you some JSON like
{“fooArray”:[“thing”, “thing”…] ...}
(but with more fields). And you have some class
DangerousBusinessObject
that you can call validate on that returns
BusinessObject?
, and validate does things like make sure the array isn’t null, has the expected number of params, the params are valid and so forth for each value. Then you can make sure internally everything uses
BusinessObject
and not
BusinessObject?
or
DangerousBusinessObject
, which would be helpful for sort of isolating bad data.