On 20 Jul 2013, at 12:06, Ash Moran <[email protected]> wrote:
> bus.register(:turn_on_kettle, kitchen_handler) > … > bus.send(:turn_on_kettle) What responsibilities does a KitchenHandler have? There's no such thing in real life; could its existence be a side effect of the implementation? Could you keep the bus, but rework things so that you deal with a Kitchen object instead? Could you send it a message via your bus just by calling kitchen.turn_on_kettle ? I realise that you're dealing with a message bus, which implies that there might be all sorts of bits of gumph inbetween your user of the message bus and the kettle, but might you be able to re-jig your objects this way anyway? Just throwing it out there... I appreciate it might not be an actionable or useful thought. I'm still only a fifth of the way through his book, but I suspect it might be what David West might ask. http://www.amazon.co.uk/Object-Thinking-DV-Microsoft-Professional-David/dp/0735619654/ref=pd_sim_b_3 Another unrelated thought; could you use "publish" instead of "send"? -- You received this message because you are subscribed to the Google Groups "NWRUG" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nwrug-members. For more options, visit https://groups.google.com/groups/opt_out.
