Fukans
2025-07-07
来自北京
1、这种设计符合依赖倒置原则,高层模块不依赖低层模块的具体实现,只依赖接口,降低耦合。 2、type Service struct { /* ... */ notifier Notifier } type Notifier interface { Send(/* ... */) } // 通知接口