I have one complex object just like this;
Object A
Object B
Object C
Object D
property A
property B
So If I need to show the property A in my view, I need to
A.getB().getC().getD().getPropertyA();
but what if my user doesn`t send the object C?
so I need to create one If for every object
if(A.getB() != null){
if(A.getB().getC() != null){
if(A.getB().getC().getD() != null){
//here I can show the propertyA
}
}
}
now I have to show this property in 3 views
There is a better way to does this? a framework or something like this to solve this problem?