Persistence

A persistent object can be saved to a file or database. Otherwise we say that the object is transient.

Domain objects—objects that represent events, entities, roles, and descriptions in the application domain—often need to be persistent.

User interface objects—windows, controls, views, event handlers, etc.—are usually transient, as are architectural objects such as controllers, gateways, and dispatchers.

By default, objects are transient.

File I/O is done using streams. Saving a persistent object to a file is called serialization.

The other option is to save objects to databases.