필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

saving and loading objects

조회 수: 1 (최근 30일)
Patrick Mboma
Patrick Mboma 2013년 8월 20일
마감: MATLAB Answer Bot 2021년 8월 20일
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
Patrick Mboma
Patrick Mboma 2013년 8월 21일
I do not have any experience with addprop, but I have looked it up and it looks interesting. What I meant was much simpler: you have an object of class, say, class1 and then one of its properties is an object of, say, class2.
per isakson
per isakson 2013년 8월 22일
편집: per isakson 2013년 8월 22일
" 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.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by