Wed, 01 Sep 2004
The design of fuschia--1
What I think are good points about fuschia-0:
- The template system is small, clean and simple. Not sure about how arguments are represented (or whether there should be any), but we'll see.
- The arrangement of templates works well —
using a
documenttemplate, then within that astorytemplate, etc. Might be useful to supply a standard 'use a template' function for customisers. - Some of the utility (helpers) code is fairly reusable.
- Keeping everything in the environment dictionary is just
silly and makes the code messy. Most things can just be
letin configuration, with variables really the only things worth keeping in the environment dictionary. - Conceptually the storage/query abstration is in strife, probably from trying to be too generic. Better to assume more things and make things that are usable — 80/20, man. It's worth checking out gyre to see how queries are made there.
- It's too complicated even just to bootstrap. More assumptions, or better defaults. Relatedly, there could be far less code.
- I think I'm coming around to TonyG's view of the difference between caching and storage; caching is not a facade on storage, it's a facade on the model (or indeed, it is the model).
- Filters were just chaotic.
- Query parsing (and unparsing) is a bit ad-hoc and introduces problems with templates, though the code is probably reusable; needs to be thought through a bit more first.
I think the new way of going about things is:
- Base classes (the default for bootstrapping) can be 'in-memory'; subclasses of those might load from the filesystem, etc.
- Keep a caching model of the stories à la gyre; apply filters to stories when loading them (on demand according to the query).
- Bootstrap with some sensible settings but allow the user to override them immediately, as well as in per-query configuration.
- Make sure nothing upsets static rendering!
and open questions:
- Will I just end up with gyre with a few extra hacks (and should I therefore just branch from gyre)?
- How can I introduce some of the Zowian ideas about semantic-to-spatial relationships? Are they even in a state to be used?