java - Should validators in spring access the database? -


I'm not sure that it is a good design decision to validate assumptions based on the status of the database. For example, if I need to verify user Bean whether the email or username is empty, then I need to reject the prices if they are already used. Should this type of argument go in Vedicities or service items?

Your validators are just spring beans, well, so they serve the data object Can be injected with the object. Without compromising the design, you can get data from your wallet database.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -