Decoupling Seaside Components
A problem that is frequently discussed on the Seaside mailing-list is how to navigate and communicate between different components without increasing the coupling. The most obvious solution, direct references, tightens the coupling and hampers reuse of these components in different contexts.
For quite some time I have been successfully using Announcements in the context of Web applications. Even-tough this framework has not been designed for the Web it turns out to be extremely versatile: Any part of the application (such as components) can register for a specific or a group of events to be notified about. The model, or other components can then trigger events that get propagated to the interested parties. To take it even one step further, announcements allow to pass data around easily, and even communicate between different sessions. Moreover they work well together with Seaside's server push technology.
Currently there are at least three different implementations of Announcements available in Squeak for you to try out:
- A minimal implementation as part of the OmniBrowser framework.
- An extended version of the initial OmniBrowser implementation slightly generalized and separately packaged.
- A complete port of the original announcement framework as found in VisualWorks.