I read some article on Law of Demeter and it gets me confused.
It states that something like this:
var width = mapControl.get_mapState().getMapRange().getSize().get_width();
Should be replaced by this:
var mapState = mapControl.get_mapState();
var mapRange = mapState.get_mapRange();
var width = mapRange.get_width()
I am a little confused here cause the latter one is just the same as the first one but written differently. In both cases I am eventually accessing "width" which is not a direct friend of my current class.
So why is the second way really better?