I have these properties for a patient represented by the Patient class. I wonder what is the best way to call them?
- is she in lactation: boolean
- Is She Pregnant: Boolean
- is she preparing for pregnancy: boolean
- Recently, low blood glucose: boolean
- Does he have complications: boolean
The first thought was to name them as:
boolean isInLactationPeriod; boolean isPregnant; boolean isPreparingPregnant; boolean hasSufferedLowBloodGlucoseRecently; boolean hasComplications;
However, I also came across suggestions that java properties should not be names with leading names, has / has, but to leave them to the getter / setter method, for example.
boolean pregnant; boolean isPregnant() { return pregnant; }
Which one is better?
source share