Version 12 (modified by 14 years ago) ( diff ) | ,
---|
Table of Contents
S3XRC | S3 RESTful API | S3Resource
S3Resource Class
Introduction
Resources are dynamic, document-alike representations of data objects on the Eden server. As such, they can represent both single instances as well as structured sets of data objects.
Note: in the database context, a single instance of a data object is typically called a record (or row), with fields (or columns) as its atomic elements. However, even though S3Resources are typically bound to a relational database and therefore the record/field terminology is often used in this regard, they are not intended to provide any object-relational mapping (ORM).
S3Resources implement an extensible, multi-format RESTful API to retrieve and manipulate data on the Eden server by HTTP requests, where every resource can be addressed by an individual URL.
In the context of the Model-View-Controller (MVC) architecture, S3Resources are controller-generated objects. Typically, the controller generates a resource in response to an incoming HTTP request and returns a view of it (output) to the client:
Terminology
A S3Resource consists of elements which can be either resources themselves (container type) or data (atomic types).
Container type elements within a resource can be:
- primary resources (independent data objects)
- component resources (objects which are part of a primary object)
- referenced resources (objects which are referenced by primary or component resources)
RESTful API
This interface is used by the s3_rest_controller() function:
res, req = s3xrc.parse_request(module, resource) output = res.execute_request(req, **attr)
where res
is the S3Resource instance, and req
the S3Request instance.
Flow Diagram
Attachments (2)
- arch3.png (8.0 KB ) - added by 14 years ago.
- s3rest.png (43.4 KB ) - added by 13 years ago.
Download all attachments as: .zip