ddd

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: 0BSD Imports: 1 Imported by: 0

Documentation

Overview

Package ddd provides types for tactical Domain-Driven Design (DDD).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateRoot

type AggregateRoot[ID comparable, SerializationType any] interface {
	// ID uniquely identifies the entity.
	ID() ID

	// Serialize returns a serialization for persistence implementations.
	Serialize() SerializationType
}

AggregateRoot is embedded into structs that represent DDD aggregate roots.

type Entity

type Entity struct {
	// contains filtered or unexported fields
}

Entity is embedded into structs that represent DDD entities.

type Serialization

type Serialization[AggregateRoot any] interface {
	Deserialize() AggregateRoot
}

Serialization is the serialized representation of an aggregate root.

A Serialization should contain all the data necessary to persist an aggregate. They are expected to only have exported fields and to contain no business logic. They are commonly used by persistence implementations to deserialize persisted data back into entities.

type Value

type Value struct{}

Value is embedded into structs that represent DDD value objects.

Jump to

Keyboard shortcuts

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