DEV Community

Discussion on: Clean Validations with Custom Contexts

Collapse
 
playwright2poli profile image
playwrightpo

Thanks for the article!
I have not used on option with custom context, it is interesting approach. But I think it should be used very rarely, because of otherwise we are about to get bloated models with many responsibilities. In most cases such a things would be better to incapsulate out of models, e.g. by using form objects..

Collapse
 
spidergears profile image
Deepak Singh

Absolutely agree with you, should be used only when it fits the case.

Example is for demonstration and to hint at capabilities of the framework, form object are much more suitable for the scenario.

Thanks for going through, and putting out your thoughts. :)