I have kind of a general java question I'm looking for an answer to. Lets say I have an object with a property height and I have a method that uses height to make some calculation. Is it better to pass the property height to the method or is it any different to pass the full object and use a getter to retrieve the value of height. I hope this makes sense.
e.g.
public getHeightInMeters(Object object) {
return object.getHeight()*x;
}
is the same, worse, better than?
public getHeightInMeters(Height height) {
return height*x;
}