I think creating getter and setter for each field is better than public fields in Java because some libraries such as DI containers have utilities to handle JavaBeans conveniently.