Slide 34
Slide 34 text
© LayerX Inc. 34
repository層のリファクタ
● 集約ルート単位でデータのやり取りをする
● 基本的にはGet,GetMany,Saveのみ提供(例外はあるが)
repositoryの再定義
package domain
type InvoiceRepository interface {
Get(ctx Context, id string) (*Invoice, error)
GetMany(ctx Context, ids ...string) (*Invoice, error)
Save(ctx Context, id string) error
}