rjinxx / RJBadgeKit

Solution for red dot (badge reminder) display and its management / 小红点(消息推送提醒)完整解决方案

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

controller 的作用探讨

AbeiOS opened this issue · comments

commented

首先感谢作者给出这样一份红点处理系统,真的很好!
但是有一点小疑问:controller 是不是有点多余?

看了一下目录架构,了解到的大致是这样:
• controller 负责外部调用处理协作;
• info 用于携带 block 和 controller 等等需要回调的信息
• model 类负责 tree 的逻辑部分;
• manager 类是负责对接 info (去重)以及递归回调 block;

其实这里面 controller 和 controller 的分类的我认为有点多余,demo 中给出的解释是'为防止循环引用'。但是其实这个 controller 是已经通过 info 携带了。并不需要这层 controller 类。

如果我说的有问题请指教。

commented

没问题了,是我没想明白