Decoupling the model and input checking

爷,独闯天下 提交于 2019-12-08 06:41:30

It is a good practice to perform UI validation.

E.g. if Your domain object expects date time, it is correct if UI part of application ensures it will receive from user correct string, will parse it to date time and pass it to domain object.

Bad example: UI part validates if bank account has enough money for transfer.

However - can't give any tips how to implement properly this kind of validation in framework You are using (I'm not working with java).

Just don't keep it in controller. That is not controllers responsibility.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!