14.7. Event busses
When building complex and large web applications, it’s common that widgets share the same information. Objects that are dependent on the same data are affected whenever a change occurs to the data they depend on. This means that modules have to carry references to each other in order to react appropriately whenever changes happen. This could result in to tight coupling or even circular dependencies among the widgets or application subsystems. Two important rules when it comes to building code that doesn’t break easily are high cohesion (keep dependencies locally in the module) and low coupling (interdependency between modules). Tight coupling and circular dependencies contribute to spaghetti code; consider figure 14.10.
Get GWT in Action, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.