Changes between Version 39 and Version 40 of S3/S3Model/ComponentResources


Ignore:
Timestamp:
02/04/14 13:16:11 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Model/ComponentResources

    v39 v40  
    22[[TOC]]
    33
    4 Component resources are an S3 framework concept to simplify the implementation of and access to aggregation models, which is the most common type of data models used in Sahana-Eden.
     4'''Component Resources''' (more commonly referred to as simply "components") are an S3 framework concept to simplify the access to sub-entities related to a master entity.
    55
    6 Typically, such an aggregation model has a master entity and a number of associated (sub-)entities ("have"-relationships):
     6Typically, a master entity has a number of associated sub-entities ("have"-relationships), e.g.:
    77
    88  - organisations = have => offices, projects, teams
     
    1010  - groups = have => members, tasks
    1111
    12 Each of these relationships can be represented as a join between the respective tables.
     12These sub-entities are called ''components'' of the master entity.
    1313
    14 The "Component Resource" extension provides the functionality to pre-configure and re-use these joins as pseudo-attributes ("components") of the master entity, thereby replacing the joins by simple identifiers (aliases) which can be used to construct queries, e.g. in URLs:
     14A component relationship constitutes a join between the master entity and the sub-entity. The S3 framework provides functionality to pre-define such joins and then use them as pseudo-attributes of the master entity.
     15
     16In URLs, component relationships can be utilized to construct implicit queries (also called "projections"):
    1517
    1618{{{
    17     # Join "office": org_organisation <-- id/organisation_id --> org_office
     19    # Offices of organisation 5
     20    # "office" is a component of "org/organisation"
     21    # Join: org_organisation <-- id/organisation_id --> org_office
    1822
    1923    /org/organisation/5/office
    2024}}}
    2125
    22 or
     26...likewise in URL filter queries:
    2327
    2428{{{
    25     # Join "contact": pr_person <-- pe_id/pe_id --> pr_contact
     29    # Persons with the email address user@example.com
     30    # "contact" is a component of "pr/person"
     31    # Join: pr_person <-- pe_id/pe_id --> pr_contact
    2632
    2733    /pr/person?contact.contact_method=EMAIL&contact.value=user@example.com
    2834}}}
    2935
    30 The "Component Resource" extension is one of the fundamental RAD concepts of the S3 framework.
    31 
    32 Besides simplified construction of queries and views, it also facilitates keyless (=implicit) constraints e.g. in CRUD forms and XML imports:
     36Besides simplified construction of queries and views, it also facilitates implicit (=keyless) constraints e.g. in CRUD forms and XML imports:
    3337
    3438{{{#!xml