Almacenamiento y carga de objetos
Optimice el proceso de almacenamiento y carga de objetos
Personalice el proceso de almacenamiento y carga de objetos mediante la implementación de métodos específicos para la clase. Estos métodos pueden mejorar la compatibilidad de versiones, evitar las dependencias de inicialización y restablecer funciones para objetos cargados.
Temas
Funcionamiento del almacenamiento y la carga con objetos
- Save and Load Process for Objects
MATLAB® processes objects in the save and load operations so that loaded objects are in a known state. - Modify the Save and Load Process
Modify the save and load process to provide class version compatibility. - Basic saveobj and loadobj Pattern
Use these basic programming patterns to implement custom save and load processes.
Personalizar el proceso de almacenamiento y carga
- Reduce MAT-File Size for Saved Objects
Specifying default values for properties in the class definition can reduce MAT-file size when saving multiple objects of the same class. - Improve Version Compatibility with Default Values
Using default values when adding properties to a class definition ensures that objects defined with previous versions have appropriate values when loaded. - Save Object Data to Recreate Graphics Objects
It is more efficient to save data and recreated graphics than to save the whole graphics hierarchy in the MAT-file. - Avoid Property Initialization Order Dependency
Avoid initialization order dependency by defining set methods for dependent properties. - Maintain Class Compatibility
Use hidden dependent properties to maintain class compatibility. - Initialize Objects When Loading
EnablingConstructOnLoad
allows object modification in the constructor when you do not want to implement aloadobj
method. - Save and Load Objects from Class Hierarchies
Class can call theloadobj
andsaveobj
methods defined by superclasses in the class hierarchy from their ownloadobj
andsaveobj
methods. - Restore Listeners
You can restore property listeners from theloadobj
method.