Remove validations?
Closed this issue · 2 comments
I'm on the fence about whether including validations with persistence is a good idea, leaning more toward removing them. Since we're only serializing object state, if you keep invalid state out of the objects you don't need to worry about persisting invalid data.
Since Perpetuity validations are extremely minimal — we only validate presence and string length at the moment, IIRC — we could probably gut this with minimal ramifications.
Validating data is extremely important in production apps and it isn't a simple task, so if there isn't a nice Ruby gem that validates POROs, we may need to keep — and drastically improve — validation support.
There is the vanguard gem that eventually will support all the common validations in AR and DM: https://github.com/mbj/vanguard
I remembered one of you guys having a gem for validations, but at the time I began putting validations into Perpetuity it was still very young. I've already removed the validations in 6b5e542, but forgot to update this issue until this evening.
It's great to see people working on an entire ecosystem to make using the DM pattern in Ruby easier.