I would like to know if there are cons or pros of using static
fields or attributes in a model class.
For instance I have a model class called Book
public class Book{
private int id;
private static int id; //this one
private Category category;
//setters and getters
}
I understand that static variable values remain active while programming is running and remain unchanged if not set to a new value using setters.
What are the best practices and when should I use static
fields in a Model class?