[development] Way to have one content type "inherit" from another

Victor Kane victorkane at gmail.com
Fri Feb 6 16:21:17 UTC 2009


Hi all,

Looking for some feedback on using CCK fields as a way of emulating object
inheritance in Drupal.

Pseudo-inheritance via CCK field re-use.

I am developing Project Flow and Tracker, an agile-based project management
system built for and by Drupal, and will be presenting it (and making it
available) at DrupalCon DC.

Using Drupal 6.x, I have a "core" content type, "Card" (based on the Kanban
"visual card" display approach -
http://www.infoq.com/articles/hiranabe-lean-agile-kanban).

A Card is a User Story, but could also be a project, a release, an
iteration, a task... any kind of token that could be put on a 3x5 card and
stuck on the wall to reflect project status.

In an object oriented environment, I would create class Card, and then
extend it into the other classes.

I could do that in PHP, of course, but I want users of the PFT to be able to
create their own work tokens or easily modify existing ones via CCK.

So, is there any reason why making Card a superclass content type, with a
superset of defined CCK fields, and defining a subclass by creating a
content type and then adding in already defined fields, wouldn't work?

I know it would work, of course, but is there a performance, or other caveat
I should look out for?

Also, how will this tie in with the new Field API in Drupal 7?

Thanks in advance for your feedback,

Victor Kane
http://awebfactory.com.ar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20090206/dedea5c0/attachment.htm 


More information about the development mailing list