Skip to content

Latest commit

History

History
89 lines (79 loc) 路 3.62 KB

architecture-overview.md

File metadata and controls

89 lines (79 loc) 路 3.62 KB

Ozone Architecture Overview

The projects that currently make up Ozone use the same architecture, using the best parts of DDD, CQRS and various Clean Architecture patterns.

Project Architecture

Module currently consist of the following projects:

Project Description Examples
Ozone.Project.Application The Application project is the main entry point or the application that is being run as an executable. It takes care of setting up all other modules and linking up interfaces to their implementation.
  • The application main method
  • Setup of Dependency Injection
  • Linking up all other modules that are part of this application
  • Ozone.Project.Api The Api project is the entrypoint for third party users of the application. This usually contains the API controllers that can handle interact with the outside world.
  • API Controllers
  • DTO definitions
  • Ozone.Project.Core When implementing CQRS, this is the project that contains all the logic for creating and handling commands and queries.
  • Command, Query and event handlers
  • Application logic that is used by the "Api" project to create, update or interact in any way with other projects.
  • Ozone.Project.Infrastructure In the Infrastructure project, we can find the implementation of the interfaces defined in the Core and Domain project. The Infrastructure project is the only project that references external concerns and contains an implementation for their abstraction that is used throughout the application.
  • Implementation for external services like an email provider
  • Implementation of third party libraries that are used in the application
  • Ozone.Project.Persistence Similar to the Infrastructure project, but contains the implementation for the persistence layer. Here the database access and other persistence related logic is implemented.
  • Database Connection
  • Domain Repositories
  • Domain Object => Database Object mapping
  • Ozone.Project.Domain The Domain project contains the domain model and the business logic of the application.
  • Entities that exist in the business logic
  • Validation for entity objects
  • Business logic
  • Module Dependency Graph

    flowchart TD
        Project.Application-->Project.Persistence
        Project.Persistence-->Database
        Project.Persistence-->Project.Domain
    
        Project.Application-->Project.Infrastructure
        Project.Infrastructure-->Project.Domain
        Project.Infrastructure-->Project.Persistence
        Project.Infrastructure-->T[Third Party Service]
    
        Project.Application-->Project.Api
        Project.Api-->Project.Core
        Client-->Project.Api
        Project.Core-->Project.Domain
    

    Base projects

    Additionally, there are some base projects that contain common functionality that can be used by all projects of their respective kind. The projects can be identified by the Ozone.Common namespace e.g. Ozone.Common.Domain. Every project of a specific type should import the corresponding base project. Moreover, the "Ozone.Common" module provides abstractions that can be used by all other modules and is by default included by all project base modules.