4 ms·
Hehe, I implemented a scheme quite similar to your "matrix inheritance" in my (as of yet unreleased) web framework. I have a "page variant" system where each p
by Hexstream 17y ago
Hehe, I implemented a scheme quite similar to your "matrix inheritance" in my (as of yet unreleased) web framework.
I have a "page variant" system where each page has a "selection" among the "choices" of its "dimensions".
For example, if a page is available in English and French on the Language dimension and for Public, Member and Admin on the Privileges dimension, then that's 6 variants. These variants get compiled separately and are generated from 1 description of the page that includes conditionals that test what variant I'm generating/compiling.
I plan to make much heavier use of this feature in the future. For example, I'd want to have a new Proficiency dimension where I'd have a version for newbies with lots of inline help and hand-holding, a regular version for average users and maybe an expert version for people with advanced knowledge and needs.
And maybe another dimension which selects whether the page should be displayed with or without "teasers", for example if other features are available on that page with a premium account, the user might want to know what he's missing OR he might want to use the free version and not be bothered with upsells for the moment.
Since all these versions are generated from 1 template, drift is very minimal. I don't want to imagine what it would be like to maintain all these separate versions without this system, though I guess I just wouldn't bother with my more advanced ideas...
(Does this feature exist in other web-frameworks? I'm a bit "in my own bubble" ;P)