In order to start a conversation about how to code the proposed application, I've done up a UML diagram of some of the basic data classes in the application. Nobody should take it as anything other than a conversation-starter, though, since we don't really have firm requirements at this point. Anyway, here it is.

What's this?

Each of the rectangles is a PHP class, with a corresponding object in the database. By convention, the database table is the plural form of the class name - so the data for the Link class would be found in the "links" table in the database.

The major exception to this rule is worth noting: I assume we would use something called single table inheritance to cut down on the amount of database tables necessary to store model data. See the discussion of inheritance below.

If you're not familiar with UML, here are a few notes:

Inheritance

Class inheritance in the diagram shows up as an arrow with a closed triangular head, like this:

In this example, the Article class inherits from the Content class - that is, it has all the properties and methods of Content, and it also has an additional property called links. When it comes to the database tables, the data for all Article objects will be found in the table content rather than in an articles table.

Composition

In this example, relationships between objects are denoted by a line with a diamond-shaped tip pointing to the owning object. I've cheated a bit, though, just to make the relationships appear. In the example below, an Article has_many Link objects, so the links property of Article is actually an array of links, not a single Link. Umbrello, the UML modelling tool used to generate the diagram, has the advantage of being free and easy to use but it doesn't model certain things very well, so be aware that if there's a property that's in the plural, I probably mean to say that there's an array of objects involved:

Changing the UML

The UML diagram is currently attached to this page. If you want to update it or play with it, install yourself a copy of the Umbrello uml modeller (apt-get install umbrello), click on the "domain_model.xmi" file at the bottom of this page, scroll to the bottom, and right-click "save as" on the "original format" link. If you want to update the diagram above, you can do Diagram ==> Export As Picture, save the file as domain_model.jpg.jpeg (don't ask about the double extension, I don't know why it does that), and upload it here using the attach file feature of trac.

Attachments