lundi 7 octobre 2019

can you provide a best practice to set a value way on complex object

Lets say i have an object x with this nested properties:

x.y.z.y i mean x contains object y that contains z... etc...

and i want to set : x.y.z.y = 7.0 (in case y is an Double)

but z is null

can you suggest a patten for it?

both ways of:

maybe with reflection (may create predecessor nulls with default values or to ignore the set if one of the predecessors is null?

or better solution?

thanks.





Aucun commentaire:

Enregistrer un commentaire