Changes between Version 22 and Version 23 of GROUP_CHANGES_R0
- Timestamp:
- 06/09/09 16:10:58 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GROUP_CHANGES_R0
v22 v23 61 61 * There will be Changes for creating and destroying a Resource respectively for the beginning and ending of their lifetime. (Will be implemented with serialization in some of the next revisions). 62 62 * There will be Changes for attaching a given ProObject to a given ResourceSpace and detaching a ProObject from a given ResourceSpace. 63 * All of the Resources need to have their own History, and that Gistory will include the Changes of all the objects in their own ResourceSpace => it will be part of the ResourceSpace.63 * All of the Resources need to have their own History, and that History will include the Changes of all the objects in their own ResourceSpace => it will be part of the ResourceSpace. 64 64 65 65 After all these ideas we can list all of the primitive Changes that will be serializable and thus a GroupChange will simply represent a list of such primitive Changes: … … 70 70 * Create a Resource : CreateResourceChange (will be designed in the next revision). 71 71 * Destroy a Resource : DestroyResourceChange (will be designed in the next revision). 72 * Attach a ProObject to ResourceSpace : CreateProObjectChange. (may 73 * Detach a ProObject from a ResourceSpace : DestroyProObjectChange. (may 72 * Attach a ProObject to ResourceSpace : CreateProObjectChange. (maybe a better name is AttachChange or AttachProObjectChange). 73 * Detach a ProObject from a ResourceSpace : DestroyProObjectChange. (maybe better name is DetachChange or DetachProObjectChange). 74 74 * Undo a change : UndoChange. 75 75 * Redo a change : RedoChange. … … 79 79 * ProObject related Changes: 80 80 * There are some Changes that are not in the UML diagram, they are connected with the ProObjects only and are already implemented. These Changes are all descendants of ProChange, and more accurately BaseProChange: 81 * BaseProListChange - there are three such changes: ADD, REMOVE and SET, and they are primitive changes for the BaseProLists.81 * BaseProListChange - there are three such changes: ADD, REMOVE and SET, and they are primitive Changes for the BaseProLists. 82 82 * CountChange - Used for testing of AutoTracker. 83 83 * StatusChange - changes that track the status of the properties: … … 88 88 * When creating a ProObject in a ResourceSpace two things are important: the id of the ProObject assigned by its container ResourceSpace and the type of the ProObject, so the constructor of this Change will take proObjectId:String and proObjectType:Class<T extends ProObject>. 89 89 * When destroying a ProObject, only its id will be important in order to know what we have destroyed. So the DestroyProObjectChange will be constructed only by id. 90 * When creating a Resource, we will need the id of the Resource and its type too but the Change must be different than this of the pro-objects because it is the beginning of a Resource's lifetime.90 * When creating a Resource, we will need the id of the Resource and its type too but the Change must be different than this of the ProObjects because it is the beginning of a Resource's lifetime. 91 91 * The destruction of a Resource is analogical. 92 92 * Special Changes: … … 97 97 All these comments clarify the model of the Changes. Now the logic that will be used for their management will be introduced. First this is the UML diagram:[[BR]] 98 98 [[Image(source:branches/private/meddle/sophie2-platform/modules/org.sophie2.base.model.resources/doc/ChangesLogic.jpg)]][[BR]] 99 * ChangeManager : The old Undo manager will be deprecated, and will be removed from everywhere it's used, but will be saved for now until the undo/redo implementation. A ChangeManager will replace it. All the Changes will be registered in a ChangeManager, which will be an interface with only one method, register(), which takes a Change to register as an argument. What will be done with the Change when it is registered depends of the implementation. For now there will be two implementations :99 * ChangeManager : The old UndoManager will be deprecated, and will be removed from everywhere it's used, but will be saved for now until the undo/redo implementation. A ChangeManager will replace it. All the Changes will be registered in a ChangeManager, which will be an interface with only one method, register(), which takes a Change to register as an argument. What will be done with the Change when it is registered depends of the implementation. For now there will be two implementations : 100 100 * DefaultChangeManager: All the ProObjects by default will register their Changes in it, and only one instance of it will be needed for all of the changes so it will be singleton. Other thing is that the Changes that are not in a ResourceSpace will be not stored, because only the state of the Resource will be important for the server and the persistence... So on registration, the Changes will be just executed. 101 101 * ResourceChangeManager: 102 102 * Every Resource will have its own ResourceChangeManager. It will be responsible for storing and grouping of the changes in its Resource's ResourceSpace. 103 103 * The old logic for grouping from the UndoManager will be used for closing and opening groups and Changes will be grouped on registration. 104 * The Changes : CreateProObjectChange and DestroyProObjectChange will be handled here. When a new ProObject and its owned ProObjects are attached to a ResourceSpace, the creation and destruction of all the values of the properties of the ProObjects will be registered as Changes in the History of the Resource.104 * The Changes : CreateProObjectChange and DestroyProObjectChange will be handled here. When a new ProObject and its tree of owned ProObjects are attached to a ResourceSpace, the creation and destruction of all the values of the properties of the ProObjects will be registered as Changes in the History of the Resource. 105 105 * The ResourceChangeManager will have a History, which for now will store all the Changes that the manager gives it as a list but in future it will be used for synchronization with the server, so it will have to visible methods : 106 * sync(newChanges : List<Change>) : List<Change> that for now adds the new changes to History of the Resource and returns the C nanges which were actually added to the History. In the future, the returned ones will be these from the server.106 * sync(newChanges : List<Change>) : List<Change> that for now adds the new changes to History of the Resource and returns the Changes which were actually added to the History. In the future, the returned ones will be these from the server. 107 107 * changeList : ProList<Change> : used to get the content of the History. 108 108 * The UndoChange and RedoChange for now will be part of the ResourceChangeManager, because they are connected with the manager the Changes they undo and respectively redo, and automatically will register themselves in it. Maybe in the future the SkipChange will be created in the same way. 109 * The manager will be constructed with a Resource as argument, because it's contained in ResourceSpace.109 * The manager will be constructed with a Resource as argument, because it's contained in a ResourceSpace. 110 110 * GlobalResourceChangeManager : It will be used for grouping of the user Changes from more than one ResourceSpaces. 111 111 * Important thing is that all the Changes will be packed into groups, to have global grouping, so the ResourceChangeManagers will group single Changes too. That is not bad, because when serializing we will ungroup all the groups anyway. … … 121 121 * For now it is only a skeleton that will be implemented in the next revisions, but it will be able to work with skipping. 122 122 * It will be able to: 123 * Retrieve the undo and redo Changes from a Change.124 * To check if is possible to undo or to redo .125 * To execute (register) Undo and Redo.123 * Create the undo and redo Changes from a Change. 124 * To check if is possible to undo or to redo a given Change. 125 * To execute (register) undo and redo acctions. 126 126 127 127 That's all for the logic... Now for the visible part: … … 129 129 * An AllChangesPalette will be added which will list all the Changes for the current Book, globally grouped. 130 130 * For now there will be no interactions. 131 * Most of the C anges won't be grouped nicely, because of bad AutoChanges and the lack of the Resource creation/destruction Changes.131 * Most of the Changes won't be grouped nicely, because of bad AutoChanges and the lack of the Resource creation/destruction Changes. 132 132 * The palette will use the GlobalResourceChangeManager.getAllChangesForResource(resource : Resource) method to get all of its changes, globally grouped. 133 133