Sure think, I’m always up for a good discussion.

Another reason described in this article that you might consider when implementing validations, is that some validations require locks on the object, or they might have side effects (such as logging or audit).

I always prefer having properly defined access methods for common operations such as create and delete. For update, I usually never work directly on the object it self, only via a well defined access method implemented as classmethods. Why classmethods? it can handle validation, locking an side effect well.

Take this article for example, deposit and withdraw are updating the instance. You could have implemented the same logic using update.

Written by

Full Stack Developer, Team Leader, Independent. More from me at https://hakibenita.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store