|
|
|
|
|
by solnic
3822 days ago
|
|
It's not feasible to have validations centralized. You don't validate objects, you validate data that your system received from somewhere. How it's done depends on the type of this external system, the format and sometimes the context in which you validate, that is specific to your system. This is one of the reasons why AR validations don't scale so well. Having said that, there are many systems where AR and centralized validation works just fine. |
|
Yes, it is impossible. I should have said something like "locally centralized to the compilation unit"
As gandalf pointed out, "IsValid" really asks a bunch of questions at the same time, and talking about it in the abstract is always going to miss the full depth. As a for-instance, there's clean data in terms of my datastore and then there's clean data in terms of whatever app I'm looking at. In a system of any size, these are most likely not the same thing. (And yes, that drives us crazy, but such is the way of large datastores)