Changes between Version 5 and Version 6 of Session2
- Timestamp:
- Oct 1, 2015, 9:06:47 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Session2
v5 v6 97 97 === The Solution === 98 98 99 Circular dependencies are natural. So usetwo-phase initialization when deserializing a session.99 To allow the data to be serialized in session order instead of dependent order, allow for circular dependencies. That mandates using two-phase initialization when deserializing a session. 100 100 101 Really don't want to use two-phase initialization for C++ objects. So don't. As long as the C++ objects are restored all together (//i.e.//, atomic structures and pseudobonds), we can avoid two-phase initialization for them. If the C++ objects refer to Python objects, that part would need to follow a two-phase protocol. 101 We really, really don't want to use two-phase initialization for C++ objects. 102 So don't. 103 As long as the C++ objects are restored all together (//i.e.//, atomic structures and pseudobonds), we can avoid two-phase initialization for them. If the C++ objects refer to Python objects, that part would need to follow a two-phase protocol. 102 104 103 105 On the Python side, it is possible to provide an API that takes simple data and implements all of the individual save and restore steps. … … 109 111 * When registering a tool's commands, it needs the !ToolInfo instance, just like starting a tool's GUI to be able set the the 'tool_info' attribute if there is no GUI 110 112 * The tool's module needs a 'get_class' function to return the class associated with a name. 111 * Tool classes might have an alternate initializer if attributes are not simple 113 * Tool classes might have an alternate initializer if attributes are not simple (like pickle)