Paradigm for handling references to parents (or functional global data) in Java - Example -


i have 3 classes instantiated unknown property values. each class serves property of 1 before it. i'm looking best way access top object method in bottom object.

public class top {   private list<middle> middle;    public int getmiddlesize() {     return this.middle.size();   } }  public class middle {   private list<bottom> bottom; }  public class bottom {   private string name;    //access top.getmiddlesize() here } 

should pass top object way down bottom, or there way make top object accessible globally?


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -