Is it poor practice to call methods through multiple objects?
I have code that looks like this:
tr.t.findIndexSmoothed(arg0.getX(), arg0.getY());
"tr" and "t" are objects. Is it bad practice to reach all the way down the
object hierarchy to call methods? The only reason I can think of is that
is breaks encapsulation, and if that's the case, can anybody tell me why
that poses a problem? Also, does this code structure inhibit performance
in any way?
No comments:
Post a Comment