Reconstruction Phase

  1. A particular frame is requested. Frames are requested in response to user actions (filtering, sorting, scrolling through the displays, etc.), which means that this could be any frame at all, in any order.

  2. The record corresponding to that frame is loaded from the FRM file. At this point, the stack used in this frame is known, and all the data objects that are needed are known.

  3. The needed data objects are initialized, and loaded with the data that was saved in the FRM file. This is done with the GET_DATA_FROM_A_BYTE_ARRAY call, in which the data object gets data from a byte array.

  4. All frame processing is done, just like in the compilation phase, except that PROCESSING type methods are not called; however, the FORMAT and VERIFY methods are.

  5. The decoded data is now used. The data are the actual strings that appear on the display for a particular frame, along with some supporting information.

There is a pretty big difference in how the compiling and reconstruction phases use their data, and that makes a difference in what needs to be saved. The compiling phase can count on getting frames in order, and therefore knows that any data changed by the previous frame will be the same for the next frame. The reconstruction phase can only count on the fact that the frames will NOT be accessed in any order, and therefore you can only guarantee data that you set yourself each time a frame is accessed. This is the reason for the elaborate PUT DATA... OPTIMIZE DATA… GET DATA... functions. They straighten out the data object before the display instance gets control of it.

For example, if you have a command/response protocol where you need to know which command was sent in order to decode the response properly, the compiling instance can guarantee that the command will have been decoded before the corresponding response frame is encountered. In contrast, the reconstruction instance gets its data from the FRM file and so only has access to what was saved in the record for that frame.

Other considerations:

  • Do not save any variables that control what the next protocol is. They will not have any effect in the reconstruction phase.

  • Many times a data object will have data that is useful for one frame, but not another. You don't need to save data that is not actually accessed during that frame.

  • Sometimes, a lot of data is required to make a single decision. After you make the decision, perhaps you can just save the result instead of all the data used to make the decision.