eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
CC#
Created by eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee on 7/11/2024 in #help
Looking for help with object init problem
i have a problem- An object has to initialize some nested objects on construction, but it also can be deserialized, and constructor is called before deserialization, and the nested objects depend on the initial data, so by the time object is deserailized nested has wrong data. One way to solve it is lazy initialization, which i dont want, another is some sort of a factory? Is there some third way i don't know about? I want some pattern to have the object seamlessly handle both ways internally.
6 replies