Slide 20
Slide 20 text
● バッチ処理の上位構造はいわゆるワークフローになっている
具体的なドメイン実装の紹介
20
pub struct CreationSetInitialized {
id: JournalCreationSetId,
}
pub struct CreationSetInventoryCreated {
id: JournalCreationSetId,
inventory_id: InventoryId,
}
pub struct CreationSetJournalCreated {
id: JournalCreationSetId,
inventory_id: InventoryId,
journal_id: JournalId,
}
pub struct CreationSetReportCreated {
id: JournalCreationSetId,
inventory_id: InventoryId,
journal_id: JournalId,
report_id: ReportId,
}
async fn create_journal (
&self,
creation_set: CreationSetInventoryCreated,
) -> anyhow:: Result {
// ...
}
● Workflow パターンを利用
○ 状態そのものを Entity にする
○ ある状態を受け取って次の状態を返す関数でシ
ステムを構築する
○ 関数型ドメインモデリング に
記述されているパターン