Meta Data
Over at fishrod we're developing our new CMS based on the new Zend Framework 1.7 (biting our nails for 2.0 to be released so we can relax for at least 3 months). One of the issues that always arises when developing a Content Management System for our clients is the amount of flexibility we want to offer them, and how generic the CMS has to be whilst still being flexible.
It's fun coming up with a long list of fields to add to a database, but when clients suddenly want a header image for each page, testimonials, pod cast links (the list goes on) adding new fields to a database suddenly becomes very tedious. Enter, meta data!
For example, metadata would document data about data elements or attributes, (name, size, data type, etc) and data about records or data structures (length, fields, columns, etc) and data about data (where it is located, how it is associated, ownership, etc.). Metadata may include descriptive information about the context, quality and condition, or characteristics of the data.
Meta data in short is a nice way to describe data, meta data can contain absoloutly anything, and the cool thing about it is that we don't have to modify table structures if we want to add a new non-generic field to a page or post. What's even better is that you can index this meta data for searching with the help of the Zend Search Lucene component.
Meta data is however a double edged sword. If the tables aren't structured correctly you will make the simple mistake of having one extra table for every table you want meta data associated to. An example being.
By removing the urge to create relational tables and create referential integrity in your database (doing the right thing), you can create a generic meta data table for everything!
Now all you need to do is create a metadata model in your application. The table name is simply your model name, and the foreign_id is simply the id of the row in your foreign table. Now if only you could create a view to lookup the table rows and show all of it's metadata.
This entry was posted on Friday, December 19th, 2008 at 3:22 am and is filed under PHP. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



