Changes between Version 13 and Version 14 of GROUP_RESOURCE_MODEL_REDESIGN_R0
- Timestamp:
- 07/28/09 17:03:22 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GROUP_RESOURCE_MODEL_REDESIGN_R0
v13 v14 69 69 == ModelChange == 70 70 71 This type of change will affect the model structure. Thought those changes developers should be able to add, remove and change values of different properties of the model. When developing an upper level logic it is more intuitive to use a direct get and set operations to the model so it would be better if developers should not create changes themselves. 72 71 This type of change will affect the model structure. Through these changes developers should be able to add, remove and change values of different properties of the model. 73 72 74 73 === AutoAction === … … 78 77 === ResourceChanger === 79 78 80 Every AutoAction class has access to a ResourceChanger which holds the model and can modify it internally without causing any effect on the actual resource model. When a developer wants to change the model he should just create the appropriate ResourceChanger with the model he wants to manipulate and pass it to the AutoAction by setModel() method.[[BR]] [[BR]]79 Every AutoAction class has access to a ResourceChanger which holds the model and can modify it internally without causing any effect on the actual resource model.[[BR]] [[BR]] 81 80 When managing the model in the performAuto() method developers should use the two methods getRaw(Key<T> key) and setRaw(Key<T> key, T value)of the ResourceChanger. This will transparently register reads and writes for the appropriate operations and thus the change`s effect could be extracted after the method is complete. [[BR]] [[BR]] 82 81 The ResourceChanger should also present several useful helper methods for resource manipulation - makeResource(ResourceRef ref), copyResource(ResourceRef source, ResourceRef destination), moveResource(ResourceRef source, ResourceRef destination), removeResource(ResourceRef ref), makeRedirect(ResourceRef source, ResourceRef destination) and getSub(ResourceRef subRef) which returns an inner Changer and delegates all its logic to its top ResourceChanger. [[BR]] [[BR]] 83 82 The ResourceChanger will be abstract class implementing the ResourceReader interface and providing definitions of the other needed for the perfomAuto() methods. It will be extended by two classes - ModelResourceChanger and SubResourceChanger. [[BR]] [[BR]] 84 The SubResourceChanger would implement simpler logic just delegating to the ResourceChanger they are made by. For They would need to know this parent to delegate to and also the ResourceRef by which they are made so that the delegation is made with the appropriate key. [[BR]] [[BR]]83 The SubResourceChanger would implement simpler logic just delegating to the ResourceChanger it is made by. For they would need to know this parent to delegate to and also the ResourceRef by which they are made so that the delegation is made with the appropriate key. [[BR]] [[BR]] 85 84 When a ModelChange is created it should be provided with everything needed to resurrect an AutoAction object so that it could get the resulting effect for any model anytime by resurrecting it and providing it with different ResourceChanger. So a ModelChange keeps the AutoAction class from which to take effect and all external fields it uses. 86 85