After Beryl and Robert's challenge last week, I've been implementing some new layer types that are starting to look like more conventional CS. Monday devoted to creating a decision layer that either ignores or passes its source depending on comparison of two value parameters. Tuesday spent playing around with value substitution - at first interactive, then in response to a map treatment that maps a parameterised layer over a collection of alternative values.
All of these experiments have required more sophistication in the dynamic type processing. Until now, type equivalence (for example of value fragments and value layers) has been rather crude, with layer references and "promotion" of fragments simply hard-coded with "instanceof" to retain necessary types. A first attempt provided my own set of type identifiers, with all content elements being able to report their types. However, this is going to involve a lot of logic distributed around the place, detraining type equivalence, type conversion, and maintaining type/behaviour relations.
It's starting to look as though I should define value types as Java interfaces to the layers that support them, with type conversions and equivalence supported via multiple interfaces for some kinds of layer. In this case, Java reflection should provide all the dynamic type processing that I need, rather than constructing an independent type mechanism.