We need to separate our architecture components:
- The architecture is REST
- It can be accessed using different Services
Service
Protocol
- getRequest(): returns the client [Request]
- sendReply([Reply]): send a [Reply] to the client
API
Request
extends: [Message]
- operation: What to do [CRUD operation]
Reply
extends: [Message]
- status: operation status [Status]
Status
- code: Status code [int]
- message: Status message [string]
Message
extends: [Entity]
- type: current format of the representation [Media Type]
Entity
Metadata
- description: information about the resource [map of string]
- relations: related resources [list of EntityRef]
- self: the resource itself
- index: top level resource
- collection: container of the resource (if self != index)
- up: go up in the hierarchy (if self != index, may be the same as collection)
- etag: an identifier used for versioning the resource (last modification) [ETag]
- actions: available actions [list of Action]
Action
- operation: the type of action [CRUD operation]
- types: accepted formats for the operation [list of Media Type]
- fields: fields for the operation [list of Field]
Field
- ref: the reference to the Property [IDRef]
- required: if the field is required for the operation [boolean]
Property
- name: id of the property [ID]
String
extends: [Property]
Boolean
extends: [Property]
Number
extends: [Property]
- value: value [int or float]
EntityRef
extends: [Link]
- target: the linked entity [Entity]
- description: target->metadata->description [map of [string]]
- etag: target->metadata->etag [ETag]
- types: available formats for the entity [list of Media Type]
Link
extends: [Property]
- href: where to obtain the linked resource [URI]
- rel: relation to the current resource [Link Relation]
We need to separate our architecture components:
Service
Protocol
API
Request
Reply
Status
Message
Entity
Metadata
Action
Field
Property
String
Boolean
Number
EntityRef
Link