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 onl开发者_开发问答y 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?
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
class Listener
RequestListener
WorkRequester
WorkManager
WorkItemSubmitter
Most of the suggestions done so far make sense to me.
精彩评论