pkg

package module
v0.0.0-...-3de5202 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 14 Imported by: 0

README

ddd-layout

ddd layout is a open-source project meant to be used to as a start point, or an inspiration, for those who want to build Domain Driven Design applications in Golang.

NOTE: This is NOT intended to be a definitive solution or a production ready project

Architecture overview

Layers

  • presentation: http controllers, grpc provider, schedule task, message subscriber, console command.
  • application: Orchestrates the jobs in the domain needed to be done to accomplish a certain "use case"
  • Domain: Where the business rules resides
  • infrastructure: Technologies concerns resides here (database access, sending emails, calling external APIs)

CQRS

CQRS splits your application (and even the database in some cases) into two different paths: Commands and Queries.

Command side

Every operation that can trigger an side effect on the server must pass through the CQRS "command side". I like to put the Handlers (commands handlers and events handlers) inside the application layer because their goals are almost the same: orchestrate domain operations (also usually using infrastructure services).

command side

Query side

Pretty straight forward, the controller receives the request, calls the related query repo and returns a DTO (defined on infrastructure layer itself).

query side

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL