by h8liu · 10y ago · 0 comments
Using centralized message passing/routing/registering is just being lazy on handling dependency, it is like abandoning structure programming and starts using "goto" for every branch, which makes the logic flow eventually untraceable. For a system of N modules, it ideally should have around O(N) dependency edges, but a centralized hub is essentially modeling a possibly O(N^2). It only makes sense to introduce a hub when everyone potentially wants to talk to everyone.
And worst of all, every module using the framework now depends on the "hub" now. While the actual logic-related dependencies are all converted to "dynamically" instantiated ones, this "static" dependency on the hub becomes extremely hard to remove in the long term. It's like a cancer. It is not a good "pattern".
No comments yet.