摘要 |
A method and apparatus for choosing resources based on context and inheritance. In one embodiment of the method, a computer system receives a page request from a mobile device, wherein the page request comprises data that identifies a mobile device type. In response to receiving the page request, the computer system selecting a page definition, wherein the page definition comprises one or more resource identifiers. The computer system selects a first identifier from the one or more identifiers. The computer system creates a list of keys, wherein each key of the list is distinct from the other keys in the list, and each key of the list is created as a function of the first identifier and the data or a portion thereof. The computer system accesses a memory structure that directly or indirectly maps resources to respective keys. The computer system selects a first key from the list, and compares the first key with keys in the memory structure. The computer system selects a first resource that is mapped directly or indirectly to a key in the memory structure that matches the first key. The computer system generates a reply to the request, wherein the reply comprises the first resource. |