Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The controller's layer simply maps all of the components of an HTTP request into a Java method call.  This includes the URL path, query parameters, request and response body marshaling, error handling and other response codes. Each controller also groups calls in the same category into a single file.  The javadocs of each controller also serves as the source for the REST API documentation auto-generation.  Each controller is a very thin layer that depends on the service layer.

All request and response bodies for the repository services is in have a JSON format.  The controller layer is also where all  Plain Old Java Objects (POJOs) are marshaled to/from JSON.  Every request and response objects is defined by a JSON schema, which is then used to auto-generate a POJO.  For more information on this process see the /wiki/spaces/JSTP/pages/7867487 and /wiki/spaces/JSTP/overview project.

Services/Manager

Ideally the services/managers layer encapsulates all repository services "business logic".  This business logic includes any object composition/decomposition.  For example, while a WikiPage is a single