Having public member variables is bad practice almost always. If they are public it means that they can easily be changed by anyone.
In OOP there is a term called Encapsulation which, really short, means that the code should restrict access to its inner working and structure.
How to avoid such long calls as the ones you described? This is a rather tricky question because it varies from scenario to scenario. My first suggestion would be to read about design patterns. Even though just applying them won't solve the problems, it will give you new ideas on how to properly design your inner code and the structure so that there are well-defined responsibilities.
I would start with a few simple but widely used ones: Factory, Observer, Singleton, Visitor and Model-view-controller. One important thing to keep in mind is that design patterns are guidelines and they can/should be adapted and combined. Applications will use multiple patterns in different parts and for different functionalities.
I am sorry that I can't just give a more direct answer, but for such a question I think it is better to give guidance to the needed reading materials than code.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…