Monday 12 May 2008 3:28:00 am
The eZ content model serves as the framework for web publishing, media portals, intranets, e-commerce sites, extranets, and more. This article explains the structure of the eZ content model, as well as what makes it extensible and flexible enough to enable the creation of the most demanding and wide-ranging applications.
The management and processing of content is the key component of Content Management Systems. An Enterprise Content Management framework such as eZ Publish is required to offer an even broader approach, in order to be extensible and to meet users' needs.
When content is stored in a relational database in an object-oriented system, one might think of the well-known active record pattern, where each table in the relational database is mapped to a class in your application. This normally means that an object of this class represents a single row in the database table. The active record pattern is used in web-centric applications like Ruby On Rails and many PHP frameworks.
However, the active record pattern can have undesirable implications, as listed below, if you try to map complex content structures to a database.
eZ Publish uses an implementation of the active record pattern – more precisely a Table Data Gateway – but only as a database abstraction layer, not to directly map content into the database schema. To map content to the database, eZ Publish uses an object-oriented model, as shown in the illustration below.
Simplified eZ Publish database model
As the simplified illustration above shows, the structure is separated into three main parts: content classes, instances and metadata. The developer of an application can use pre-defined classes and create new content classes. Just like a PHP class, each content class has a number of attributes of different datatypes. The actual content is represented as instances of classes and is mapped to the database in a way that facilitates the easy maintenance of different versions, statuses and languages. Both the content class structure and the actual content can be modified at any time without having to change the database structure. A simple “Article” object might have a “Title” attribute of the “string” datatype, as well as a “Body” attribute of the “XML block” datatype. Objects for e-commerce have special “Price” attributes, so that a user can purchase, and pay through payment gateways, products that are assigned different taxes and discounts.