Persistence | CodeGuru

Persistence

Bruce Eckel’s Thinking in Java Contents | Prev | Next When you create an object, it exists for as long as you need it, but under no circumstances does it exist when the program terminates. While this makes sense at first, there are situations in which it would be incredibly useful if an object could […]

Written By
CodeGuru Staff
CodeGuru Staff
Mar 1, 2001
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

When


you create an object, it exists for as long as you need it, but under no


circumstances does it exist when the program terminates. While this makes sense


at first, there are situations in which it would be incredibly useful if an


object could exist and hold its information even while the program


wasn’t

running. Then the next time you started the program, the object would be there


and it would have the same information it had the previous time the program was


running. Of course you can get a similar effect now by writing the information


to a file or to a database, but in the spirit of making everything an object it


would be quite convenient to be able to declare an object


persistent

and have all the details taken care of for you.

Java


1.1


provides support for “lightweight persistence,” which means that
you can easily store objects on disk and later retrieve them. The reason
it’s “lightweight” is that you’re still forced to make
explicit calls to do the storage and retrieval. In some future release more
complete support for persistence might appear.
Contents

|

Prev

|

Next
CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.