帮我命名我的班级
好吧,首先,这是我相当糟糕的图表......
值得注意的是,“Name Me”类可能正在监听多个 RequestNotifier
可以安全地假设放入工作队列的所有工作项都被未显示的其他内容从工作队列中取出,并且处理方式完全相同。
工作项之间的唯一区别是所请求的 WorkItem 的名称(或 id,但该名称是我的 id)。
Name Me
侦听处理特定 WorkItem 的请求,然后请求(存储库或其他一些数据访问类)具有该名称的 WorkItem,如果存在,则将其提交到工作队列。如果没有找到,它会忽略它并且这样做是安全的。
有什么关于名字的想法吗?或者如果不是名字的话,有什么更好的设计可以让命名更容易吗?
Okay, first, here's my rather poor diagram...
It's worth noting the "Name Me" class may be listening to more than one RequestNotifier
It's safe to assume all Work Items that are put on the Work Queue are taken off the work queue by something else not shown and are processed exactly the same.
The only difference between the work items is the name (or id, but the name is my id in this) of the WorkItem that's being requested.
Name Me
listens to Requests to work on a specific WorkItem, it then asks (a repository or some other data access class) for a WorkItem with that name, if one exists, submits it to the Work Queue. If none is found it ignores it and it's safe to do so.
Any ideas for a name, or if not a name, a better design that would make naming easier?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
NotificationBroker
获得了我的投票。该类的主要职责似乎是监听通知程序并将这些通知代理到多个工作队列。
NotificationBroker
gets my vote.The primary responsibility of that class seems to be listening to notifiers and Brokering those Notifications to multiple Worker Queues.
接吻原理
KISS Principle
RequestListener
WorkRequester
WorkManager
RequestListener
WorkRequester
WorkManager
WorkItemSubmitter
到目前为止所做的大多数建议对我来说都是有意义的。
WorkItemSubmitter
Most of the suggestions done so far make sense to me.