i'm using the Undo utility with PureMVC and it seems like i can use the Command stack in the CommandHistoryProxy to implement persistent application state.
i'm building a media viewing/editing application, it will be heavy on UI components. lots of windows and buttons and options. i would like to take a snapshot of the overall application state, store it, and use it to replicate that state at a later time. (stored to a database most likely).
what i'm thinking so far is that to take that snapshot, i can simply look at the Command stack, and serialize each individual command out to a database, and later read them in, in order, reconstruct them and execute them to rebuild the application state.
am i taking the right approach? it seems i would have to write a serialize/deserialize function for each Command, or perhaps use a CommandFactory that builds these Command instances.
i'm just wondering if i'm on the right track here, or if there's some other part of PureMVC that i should be looking at.
thanks for your time