Persistence

Bean properties should remain the same until they are explicitly changed through a customization mechanism. For instance, once you change the OurButton bean's label property from press to Start Animation, you expect its value to remain as Start Animation unless you decide to change it again. This is known as persistence. JavaBeans make implementing persistent beans easy. It's mostly done for you. However, you'll need to be alert for those moments when you need to help out the JavaBeans automatic persistence mechanisms a little bit. Usually when this happens, you need to add some serialization code, which is code that saves or retrieves data from some permanent storage device.

Note

See Chapter 5, "Persistent Storage," to learn more ...

Get JavaBeans Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.