128 | | |
| 128 | Locating a Resource is hard task, a Resource can be cached in a cache in the application or can be contained/persisted on a given URL (server/file system). The ResourceRef is smart immutable object that has all the information needed to find a Resource. |
| 129 | * ResourceRef |
| 130 | * It can be constructed in four ways : |
| 131 | * By an absolute path, that can be used for searching a Resource on a distant location. |
| 132 | * By entity id and location, can be used for searching an unknown resource on a distant location or to copy a Reference. |
| 133 | * By a Resource and Resource source of the Resource, so it can be used for smart finding of a Resource by other in a Resource tree. |
| 134 | * By generating child Reference from a parent Resource (something like ./name as location) |
| 135 | * Two ResourceRefs are equal if the entity id's and the locations they are pointing to are the equal. |
| 136 | * The ResourceRef is can determine whether the Resource it's pointing to is available. |
| 137 | * The ResourceRef can retrieve it's Resource in two ways : |
| 138 | * By it's class, if the Resource is top level. |
| 139 | * By it's locating Resource (i.e. where the ResourceRef is held) and the class of the Resource that is searched. |
| 140 | * The ResourceRef can determine if it points to a Resource. |