Document toolboxDocument toolbox

Repository Services Architecture

The Synapse Repository Services are implemented using a four-tier architecture:

  1. Controller (org.sagebionetworks.repo.web.controller)
    Classes in the Controller level collect and parse incoming web requests. Controllers translate web requests into appropriate Java method calls to the Service layer.
  2. Service (org.sagebionetworks.repo.web.service)
    Classes in the Service level serve as the interface between controllers and managers. Services interact with one or more Manager to produce a result for an upstream Controller.
  3. Manager (org.sagebionetworks.repo.manager)
    Classes in the Manager level provide a layer of abstractoin to access and modify data objects (usually of a particular type) in the DAO.
  4. DAO (org.sagebionetworks.repo.model.jdo)
    Classes in the DAO level manipulate the low-level data objects which are stored in the Synapse repository.

Please note that controllers should not contain business logic to actually process requests. This allows for flexible design of lightweight Controllers to interact with one or more Services, and for reuse of Services within multiple Controllers.

Any extensions or modifications to the repository services should be designed and implemented in observance of this architecture. All public methods which modify database state, whether directly or indirectly, should have explicit @Transactional annotations. Any other methods should NOT have @Transactional annotations, to avoid initiating unnecessary transactions. See http://static.springsource.org/spring/docs/2.0.x/reference/transaction.html for details on Spring Transaction management.