Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 3.64 KB

code-organization.md

File metadata and controls

49 lines (37 loc) · 3.64 KB

Code Organization

Projects

The codebase is designed to support different data stores, identity providers, operating systems, and is not tied to any particular cloud or hosting environment. To achieve these goals, the project is broken down into layers:

Layer Example Comments
Hosting Layer Microsoft.Health.Dicom.Web Supports hosting in different environments with custom configuration of IoC container. For development purposes only.
REST API Layer Microsoft.Health.Dicom.Api Implements the RESTful DICOMweb™
Core Logic Layer Microsoft.Health.Dicom.Core Implements core logic to support DICOMweb™
Persistence Layer Microsoft.Health.Dicom.Sql Microsoft.Health.Dicom.Blob Pluggable persistence provider

Patterns

Dicom server code follows the below patterns to organize code in these layers.

Used to dispatch messages from the Controller methods. Used to transform requests and responses from the hosting layer to the service.

  • Responsibilities: authorization decisions, message deserialization
  • Naming Guidelines: ResourceHandler
  • Example: DeleteHandler

Used to implement business logic. Like input validation(inline or call), orchestration, or core response objects.

  • Responsibilities: implementing Service Class Provider responsibilities, including orchestrating persistence providers.
  • Keep the services scoped to the resource operations.
  • Naming Guidelines: ResourceService
  • Example: IQueryService

Data store specific implementation of storing/retrieving/deleting the data.

  • Responsibilities: provide an abstraction to a single persistence store.
  • The interface is defined in the core and implementation in the specific persistence layer.
  • They should not be accessed outside a service.
  • Naming Guidelines: ResourceStore
  • Example: SqlIndexDataStore

Standard/Common concerns like authentication, routing, logging, exception handling that needs to be done for each request, are separated into their own components.

Dicom code uses pre-action filters. Authorization filters for authentication and Custom filter for acceptable content-type validation.