Programming with Passion

Make the best out of everything.

Friday, 8 April 2016

What do you mean by persistent and non persistent objects?

What do you mean by persistent and non persistent objects?
[This question may be asked in many ways during c++ interviews, like how to send an object to a remote computer or how to save the your program state across application restarts. All these are related to serialization.]
Persistent objects are the ones which we can be serialized and written to disk, or any other stream. So before stopping your application, you can serialize the object and on restart you can deserialize it. [ Drawing applications usually use serializations.]
Objects that can not be serialized are called non persistent objects. [ Usually database objects are not serialized because connection and session will not be existing when you restart the application. ]

No comments:

Post a Comment