jeudi 16 juillet 2015

centralised message routing class, good or bad design?

I am trying to discover the pro's and con's of having a centralised message routing class vs direct messaging.

In centralised message all messages go to some centralised-message-class and it is responsible for then forwarding it on to its destination.

In direct routing, a class will simply send a message to wherever it needs to go.

I have often come across centralised messaging schemes and at first it seems a logical and sensible idea. But as it has been pointed out to me more recently, it also seems pointless and takes additional processing - why add a "middle-man", why not just send directly - you should know where you are sending the message... etc...

So I can't see any good reasons for a centralised message class "pattern". Can anyone give good reasons for it (or against)?

Edit To clarify: I am talking about IPC messaging / mailbox's - like a centralised mailbox that then distributes messages on to their end points.

Aucun commentaire:

Enregistrer un commentaire