StudentJourney.org (InterVarsity in the North Central Region) has begun the process of using a new data model and new process. It began with a few other websites that I am doing that needed dynamic design and content while separating content and presentation. You can view the new flagship site at http://missions.studentjourney.org.
So, what makes it different?
We all have either seen/heard of replacing placesetters (i.e. %%SOMETHING%%) with content. I have added additional layers to this with the database (PostgreSQL) acting as the aggregator of placesetters needing to be replaced and the functions that are needed for each. I basically have the database do all the dirty work for me.
My new data model uses a main table called "community" having each section of the website as a community. This allows for common tables (eg. article, announcement, page, calendar, etc) to be related by community. When viewing a particular section, it simply finds the given data for that community. Nothing new here. However, I have added another table called "macro" which has a list of functions and placesetters for that community. What enhances this further is that communities can have children allowing for inherited placesetters and functions. By doing this, I can have multiple html templates and stored data using nested functions to produce a webpage with all the content and very little author confusion.
The other benifit of course is that based on an author's page, all macros (placesetters and functions available) with descriptions will be available for including on the page, with inherancy to its parent.
StudentJourney uses PHP and PostgreSQL for the backend. I have added a timer to the pages and noticed that the page process time is okay, but better than caching for the moment. The main reason this exists is because I had to use eval() on the returned functions stored in the macro table. It should also be said that these are included functions based on the community the content is in, not actual php code stored in the database. It's basically calling functions already declared.
Thoughts? Comments?
Posted by Zach on December 3, 2004 03:58 PMI think I understand it and it does sounds really cool. I have been thinking about storing PHP code in a database and then using eval()... but it wouldn't fit very well in our current system. I wouldn't mind seeing some of the code/datamodel/admin pages sometime. Perhaps we can hook up at staff conference.
Posted by: Nathan at December 9, 2004 05:05 PM