saving and loading objects
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
Dear all, This, I guess, would be a simple question to most of you but it is not obvious to me. I have been developing a class for a while and the most recent version of the code cannot load the objects constructed using earlier versions. What should I do in this case? How to implement a class that does not have problems of backward compatibility, especially in the presence of hidden, private and protected attributes? How to safeguard against attributes name changes, etc.? Is it a good or a bad thing to have an object whose properties could be instances of objects of a totally different class?
3 Kommentare
Walter Roberson
am 21 Aug. 2013
When you say "whose properties could be instances of objects of a totally different class", do you mean property in the sense of addprop() ?
Patrick Mboma
am 21 Aug. 2013
per isakson
am 22 Aug. 2013
Bearbeitet: per isakson
am 22 Aug. 2013
" Is it a good or a bad thing to have an object whose properties could be instances of objects of a totally different class?" It is good; it is the way to implement aggregation and composition. One cannot do without it.
"How to implement a class that does not have problems of backward compatibility" I wouldn't even try; I think that would impose too large restrictions on the design.
Antworten (0)
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!