• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Persistant State

 
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Could you please explain what a Persistant State means.
Thank You .................
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The concept of persisting state is simply to somehow remember the state of something for later retrieval and use.
For example, the JavaServer Faces framework has as one of its features the ability to persist the state of a GUI beyond a single interaction with a user. In other words, if you're working with a GUI of some app that uses JavaServer Faces, this framework allows the developer to program the app such that it will remember changes you, the user, have created to the GUI.
Another contrived example might involve my bank account. When I use an ATM, it retrieves the state of my bank account (which is always some balance below what I want it to be) and allows me to change it in various ways. When I've finished with my account manipulations, the ATM and the banking system persist (remember) the new state of my account for later use.
If you're having trouble understanding how this concept applies to a particular situation, perhaps you could explain a bit about the context that you're trying to understanding these things in.
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For example you save input strings in your program into ArrayList.
After this you close the program, and run again.
Oopps - you check the ArrayList and see that now it's empty.
You can create some special version of List that save somehow
data into disk (file, database), and have code to restore the data
at time of creation instance of the List.
Now after restart the program - you can see saved in previous
session, strings.
Now the object is persistent.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic