DDD.BoundedContext (vicander v0.1.1)

Copy Markdown View Source

Macro for declaring a Bounded Context.

Usage

defmodule MyApp.Ordering do
  use DDD.BoundedContext

  bounded_context name: "Ordering",
                  description: "Order lifecycle from placement to fulfillment"

  context_api do
    exposes MyApp.PlaceOrderUseCase
  end

  publishes_events [MyApp.Events.OrderPlaced, MyApp.Events.OrderConfirmed]

  subscribes_to [
    {MyApp.Inventory.Events.StockReserved, MyApp.Ordering.Handlers.StockHandler}
  ]
end

Summary

Functions

bounded_context(opts)

(macro)

context_api(list)

(macro)

exposes(module)

(macro)

publishes_events(list)

(macro)

subscribes_to(list)

(macro)