Changes between Version 8 and Version 9 of GROUP_RESOURCE_MODEL_REDESIGN_R0


Ignore:
Timestamp:
07/23/09 15:38:46 (16 years ago)
Author:
mira
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GROUP_RESOURCE_MODEL_REDESIGN_R0

    v8 v9  
    3939Children  keys -  Key used to access the children sub resources of a given resource. It can retrieve a list of the children ResourceRefs and get a key to a child provided a ResourceRef.  
    4040  
    41 Composite keys - Key used to access the sub keys of a given key. For example the BOREDER key is a composite key for its sub keys – COLOR, INSETS… It can retrieve a list of the kept sub keys.  
    42 Root keys – keeps a key to a resource. It has a sub(T extends Key<?>) method that takes as argument a sub key to get a new key of the same type as the passed one pointing to the same value starting from the root.  Example: If the root key is pointing to “PageA/frameA” and the passed key is BORDER the new key that is going to be created will be pointing the value of “PageA/frameA/Border”.  
    43 Simple keys – Keys providing the simpler logic for getting the values of the model – using directly the getRaw() method.  
    44 Templated keys – Keys that support templating. They know about the Simple key pointing to a ResourceRef  TEMPLATE and use it to get value for a template key when the getRaw returns null. The TEMPLATE`s value is got from the access and the access is used to open the pointed resource. Then the value is got by it recursively by the template key`s get method.  
    45 Meta keys – Keys getting values that are not kept only in the model. They implement different logic for every instance and are used for things like getting the revision id or some other value that depends on the state of the whole access.  
    46 Security keys – Keys used to get the access options for a certain access.  
    47 The resource model should be immutable so that it is preserved intact in the previous revisions. The only way to modify this model will be by applying change, resulting in new ResourceRevision with a new model.   
     41Composite keys - Key used to access the sub keys of a given key. For example the BOREDER key is a composite key for its sub keys – COLOR, INSETS… It can retrieve a list of the kept sub keys. [[BR]] 
     42Root keys – keeps a key to a resource. It has a sub(T extends Key<?>) method that takes as argument a sub key to get a new key of the same type as the passed one pointing to the same value starting from the root.  Example: If the root key is pointing to “PageA/frameA” and the passed key is BORDER the new key that is going to be created will be pointing the value of “PageA/frameA/Border”. [[BR]] 
     43Simple keys – Keys providing the simpler logic for getting the values of the model – using directly the getRaw() method. [[BR]] 
     44Templated keys – Keys that support templating. They know about the Simple key pointing to a ResourceRef  TEMPLATE and use it to get value for a template key when the getRaw returns null. The TEMPLATE`s value is got from the access and the access is used to open the pointed resource. Then the value is got by it recursively by the template key`s get method. [[BR]] 
     45Meta keys – Keys getting values that are not kept only in the model. They implement different logic for every instance and are used for things like getting the revision id or some other value that depends on the state of the whole access. [[BR]] 
     46Security keys – Keys used to get the access options for a certain access. [[BR]] 
     47The resource model should be immutable so that it is preserved intact in the previous revisions. The only way to modify this model will be by applying change, resulting in new ResourceRevision with a new model.  
    4848 
    4949== Change == 
     
    6868 
    6969=== ResourceChanger === 
    70 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. 
    71 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. 
    72 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. 
    73 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.  
    74 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.  
     70Every 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]] 
     71When 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]] 
     72The 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]] 
     73The 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]] 
     74The 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]]  
    7575When 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.  
    7676 
     
    7979 
    8080== Accesses == 
    81 The resource model is not accessible by the developers directly. For this are used special classes ResourceAccesses. They are responsible for location and manipulation of resources. 
    82  
     81The resource model is not accessible by the developers directly. For this are used special classes ResourceAccesses. They are responsible for location and manipulation of resources. [[BR]] 
     82[[Image(resourceAccessDiagram.jpg, 90%)]] 
    8383=== ResourceChannel === 
    8484ResourceChannel  provides fundamental methods for managing ResourceAccesses. It provides methods for opening, closing and getting AccessOptions and AccessInfo.  AccessOptions are all the options of the view that is using this access. They identify the view id, user and the write scope of the ResourceChanel.  AccessInfo is information about the location and security of a given ResourceChanel.