dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


advertisement
 

How to Create Persistent Objects

In this 10-Minute Solution, Danny Kalev shows you how to implement persistence without resorting to third-party frameworks such as DCOM and CORBA.


advertisement

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


ames, distributed database systems, multimedia and graphic applications use persistent objects extensively. Yet presently, C++ doesn't support persistence directly (there are proposals for adding persistence and reflection to C++ in the future). Persistence support is not as trivial as it may seem at first. The size and memory layout of the same object may vary from one platform to another. Different byte ordering, or endian-ness, complicate matters even further.

In this article, I will show how to implement persistence without resorting to third-party frameworks such as DCOM and CORBA. For small and portable applications, this is an effective and satisfactory solution.

To make an object persistent, we have to reserve its state in a non-volatile storage device. Consider an application that records and plays MP3 files. Every clip is represented as an object that contains the title, album, performer, time, bit-rate, recording date and the matching MP3 file. The application displays recently played tracks on the track list.



We need to to implement object persistence without resorting to third-party frameworks such as DCOM and CORBA.



Write a persistent object to retain its state outside the scope of the program in which it was created.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date