- Whenever you perform operations with the DB, don't forget about transaction and to close connection after you're done.
- Keep your code clean (don't push commented code, remember about empty lines in the end of the file).
- Don't add dependencies, that you don't currently use, it's a bad practice.
- Use
try-finally
when you work with transaction andtry-with-resources
with read operations. - Check if you've put correct access modifiers everywhere.
- What is better: setter, constructor, or field injection? Think why.
- You should write
@Autowired
annotation above the constructor everywhere or nowhere in all your classes. The code style over your project should be uniform. - Use informative variable names.