专栏名称: go4it
目录
相关文章推荐
51好读  ›  专栏  ›  go4it

聊聊go.cqrs的DomainRepository

go4it  · 掘金  ·  · 2021-04-08 23:22

正文

阅读 2

聊聊go.cqrs的DomainRepository

本文主要研究一下go.cqrs的DomainRepository

DomainRepository

// DomainRepository is the interface that all domain repositories should implement.
type DomainRepository interface {
	//Loads an aggregate of the given type and ID
	Load(aggregateTypeName string, aggregateID string) (AggregateRoot, error)

	//Saves the aggregate.
	Save(aggregate AggregateRoot, expectedVersion *int) error
}
复制代码






请到「今天看啥」查看全文