Skip to content

Ideal responsibilities

Tenor Biel edited this page Jan 27, 2016 · 2 revisions

Resource Services

  • Knowing how to interact with the API server, including
    • Supplying authentication keys
    • Inferring the API server URL from config context
  • Delegating to models to validate data before sending it to a server/database; conditionally raising ValidationError (or just TypeError)
  • Delegating to models to parse JSON responses from the server/database

Resource Resolvers

  • Deriving targeting information (exa. current order ID from route information)
  • Using context information to fetch initial data from the API server (this may or may delegate to a service class)

Resource Models

  • Being basic structures to represent data from the API server
  • Parsing JSON responses from the API server

Resource Validators

  • Providing fine-tuned schemas for specific parts of the UI

Resource Stores

  • Binding UI actions to service methods
  • Handling transition states (loading, saving, error, ...)
  • Being the source-of-truth for instances of specific resources