Is it good to use java static factory method in Spring Model Class for validate field with some kind of equation
I would recommend to avoid this by the following reasons:
What you can probably do is adding custom validation annotation to the model. This validation will be executed by spring bean that implements some spec. This way you don't have above issues but still you can keep validation rule (without implementation details) on the model class.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.