Ios 存储库模式&x2B;结合

Ios 存储库模式&x2B;结合,ios,swift,Ios,Swift,正在寻找有关存储库模式的一些反馈。我想出了这个界面: protocol PersonRepository { var people: AnyPublisher<[Person], Never> { get } func update() } protocolpersonrepository{ var-people:AnyPublisher{get} func update() } 使用此存储库的对象向people发布者订阅更新。当需要更新时,调用update()将触发存储

正在寻找有关存储库模式的一些反馈。我想出了这个界面:

protocol PersonRepository {
  var people: AnyPublisher<[Person], Never> { get }
  func update()
}
protocolpersonrepository{
var-people:AnyPublisher{get}
func update()
}
使用此存储库的对象向
people
发布者订阅更新。当需要更新时,调用
update()
将触发存储库在某个地方提取人员数据,无论是作为长期网络操作还是I/O操作

这有意义吗?还有什么其他方法与此相同