[Twisted-Python] a little pattern prototype ?
tim.stebbing at nunatak.com.au
Thu Sep 25 20:05:17 EDT 2003
Glyph Lefkowitz wrote:
> Timothy Stebbing wrote:
>> Facets are combined into single html pages (prisms), which will manage
>> placing facet content in divs. A single facet can appear on mny prisms.
> When I suggested "prism" as a metaphor, it was seriously the first word
> that came into my mind, and I intended it as a joke. However, the
> pattern you've described sounds both elegant and accurately described by
> this metaphor. I was laughing the whole time I read it :).
> I don't entirely understand what you've done, but I have two quick
> - Have you considered using Woven? Event-broadcasting and updating
> facets in real time could be achieved with LivePage. Also, since your
> output is HTML, woven could help with encapsulating the divs separately
> while guaranteeing that generation errors on one area of the page will
> not affect another.
The initial prototype I posted only took a few hours because I used
resources rather than woven (which is great but is more time-consuming
when I just wanted to get html on the screen to test an idea)
If people are interested in this pattern I would definitely write it
either on top of, or extending woven.
> - What are your use cases? e.g. what kind of a site benefits from
> using Crystals, and what doesn't?
It had no use-cases when I started, I just wanted to test an idea.
However, I could see the 'crystals' pattern being of major benefit in a
site that is highly modular, such as a groupware application/portal
where individual modules are often written totally separately and turned
on/off with user prefs.
The site could have an API of broadcasters/observers, its own internal
event system or whatever (a broadcasting reactor?). A module developer
would only need to write a few facets and perhaps a prism to access the
sites events and to get their info on the screen, in whatever way the
site wants modules to be displayed.
More information about the Twisted-Python