Patent attributes
A system and method of managing immutable objects includes monitoring new object construction, detecting construction of an object, determining a key for the object, looking the key up in a persistent storage system, when the key is found in the persistent storage system, loading the object from the persistent storage system, and when the key is not found in the persistent storage system constructing the object, determining whether the object is immutable, and storing the object in the persistent storage system when the object is immutable. In some examples, determining whether the object is immutable includes examining each primitive type data member of the object, examining each reference type constructor parameter of the object to determine whether the reference type constructor parameter is defensively copied, examining all function calls used by the object to determine whether the function calls preserve immutability, and recursively examining each reference type data member of the object.