Changes between Version 1 and Version 2 of Session2
- Timestamp:
- Sep 30, 2015, 10:39:15 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Session2
v1 v2 7 7 From the developer side, we can distinguish a couple different types of data. Some data are the same for all sessions; for example, start-up preferences and the list of installed tools. Some data are different for different sessions; for example, the list of _active_ tools and the currently opened data files. Let's call the former "initial data" and the latter "session data". Chimera2's "state of the session" consists only of "session data". This means that if the user (a) saves a session, and then (b) changes his start-up preference (e.g., background color) and it was not explicitly overridden in a session (e.g., by changing the background color), then (c) on resumption, the session will use the new background color. Clearly, this may be unexpected for the user. We will need to define what data normally defined by "initial data" that should always be saved as "session data" so that these surprises are minimized. (The answer is not "all of them" because clearly the list of installed tools may change, and additions and deletions cannot be ignored.) 8 8 9 Chimear2 data can be categorized as raw data, GUI data, and organizational data. 10 11 All session state is accessible via a Session object. The session object has a registry of which of its attributes contain savable state and conform to the State API. Typically, nested data uses the same State API for its data. 9 (Chimera2 data can be categorized as raw data, GUI data, and organizational data. Expound.) 12 10 13 11 == The Problem == … … 15 13 Ideally, when restoring a session, all data that is referenced by some other data has already been restored. So the all of dependencies need to be known by the saving code and there can be no circular dependencies. This avoids two-phase initialization, which is especially important for C++ objects. 16 14 17 === Example===15 === Where is Session State? === 18 16 17 All session state is accessible via a Session object. The session object has a registry of which of its attributes contain savable state and conform to the State API. Attributes that may contain nested data, and that data can use the same State API. 19 18 19 === Examples of State === 20 20 21 == The Solution? == 21 Session attributes: 22 * open models 23 * open tools 24 * running tasks 25 * scenes 26 * user colors 27 * user colormaps 28 * view (camera, lighting, clipping, etc.) 29 * selections (TODO) 30 31 Nested data: 32 * Tool GUI state 33 * molecules: atoms/bonds/residues & graphical state 34 * pseudobonds 35 * surfaces 36 * generic 3D graphics (e.g. STL) 37 * atom/bond annotations 38 39 Note that "tool" state may be in a session attribute rather than in the GUI instance. 40 41 === Issues === 42 43 * How to give dependencies for ordering session data? 44 * What is the granularity? 45 * Can we guarantee non-circular references?