Command/Eventオブジェクトのプロパティ
Command/EventでValue Objectを使ってよいか?
Value Objectはドメイン層のものなので、使わない方が良いというコメントが多数派。
Domain modeling made functionalによると
code:domain.fs
module Domain =
type String50 = String50 of string
type Birthdate = Birthdate of DateTime
type Person = {
First: String50
Last: String50
Birthdate : Birthdate
}
code:dto.fs
module Dto =
type Person = {
First: string
Last: string
Birthdate : DateTime
}
DtoがCommandに相当するので、Value Objectは使われていない。