Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the concept of Object-Persistence?

what does Object persistence mean in c++?
Can you explain it with an example or provide links to where i could find the answer? Thank you.

like image 387
Mr.Tu Avatar asked Mar 06 '12 05:03

Mr.Tu


People also ask

Does Java implement the concept of object persistence?

In a nutshell, object/relational mapping is the automated (and transparent) persistence of objects in a Java application to the tables in an SQL database, using metadata that describes the mapping between the classes of the application and the schema of the SQL database.

What are the different approaches of object persistent?

There are many ways of implementing Object-Persistence among which Gateway-based method, Object-Relational database method and Object-Oriented database method are the three major categories.

What do you mean by persistence of object in UML explain by giving examples?

example breafly. 0. A persistent object is an object that has been assigned a storage location in a federated database. When you commit the transaction in which you create a persistent object, that object's data is saved in the database; the object can then be accessed by other processes.


1 Answers

Most objects cease to exist when they go out of scope. This may be when the function in which they were created terminates. It may be when the container in which they reside is deleted. At any rate, they can be expected to disappear when the program exits. Persistent objects are those which survive between successive invocations of the program. A classic example of such an object is a database record.

check out the following links:

C++ object persistence library similar to eternity

http://sourceforge.net/projects/litesql/

http://www.codesynthesis.com/products/odb/doc/manual.xhtml

http://en.wikipedia.org/wiki/ODB_(C%2B%2B)

http://drdobbs.com/cpp/184408893

http://tools.devshed.com/c/a/Web-Development/C-Programming-Persistence/

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. To make an object persistent, we have to reserve its state in a non-volatile storage device. ie: Write a persistent object to retain its state outside the scope of the program in which it was created.

like image 96
Rohit Vipin Mathews Avatar answered Oct 04 '22 04:10

Rohit Vipin Mathews