Since I don't have any great skills in math, I ask you if there exists any algorithm that I should use for a class which probably will change in the future.
Consider following scenario:
Class "Roles" has following fields:
private boolean admin;
private boolean printer;
After some weeks I decide to add a role "guest":
private boolean admin;
private boolean printer;
private boolean guest;
After some weeks I decide to remove the role "printer";
private boolean admin;
private boolean guest;
Since I will persist the hashcode in a database, I must be 100% sure that all versions of this class generates unique hashcodes.
Maybe this is not a problem, I have always used the one provided in the Eclispe IDE source generator.
Can you please tell me if I am safe with the Eclipse IDE (Indigo) Java version >= 6 method or give me some other advices regarding this topic. I am sure this is a very common thing.
Thanks in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…