Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Thanks for the reply. "If you're talking about "Communicating" inside of a single application, the usual route is to create an object or data structure that holds the data you want to communicate, and simply giving it to the class/method that will use it." That's true, but then you have to take into account how tightly you're coupling components within the system. In order for one object to invoke a method on another object, it has to be aware of its existence. In many cases it would be preferable for objects to be able to communicate with each other indirectly by passing around messages... Commented Jul 1, 2015 at 19:53
  • ...without knowing where those messages sent from. That makes it easier to substitute different components in the system - even ones that expose a different interface or that act as "mocks" within a test environment - so long as they're generating the same kind of messages. Even though you're right that MOM's are great for integrating applications that might "speak different languages", you also get a load of other benefits like low coupling, asynchronous processing, improved code testability, improved scalability, etc. So that still leaves me wondering why they aren't used even in cases... Commented Jul 1, 2015 at 19:57
  • ...where all the components are speaking "the same language". Apologies for the long run-on comments! Commented Jul 1, 2015 at 19:57
  • @Tagc I edited my response with an example of what I'm talking about. For scalability, I'd say this kind of approach is best when you're talking about a single program. Once you enter multi-process or multi-machine then a MOM would be more scalable. Testability I feel is fairly equivalent. Asynchronous processing is possible(and the example I gave is a type of asynchronous processing), and the coupling is about as minimal as you can possible get - it's the size of a pointer, essentially. Commented Jul 5, 2015 at 14:13