Forum OpenACS Q&A: Response to Object Types as Objects?

Collapse
Posted by Titi Ala'ilima on
What do we get by making them objects?
  • permissions
  • relations
  • use of general-* (we could rate our favorite object_types! 😊
  • integer primary key

It's not clear to me that any of these are huge wins, but if we can get them real cheap, I guess it can't hurt. I don't see any big pitfalls to doing it. It'll take a little consideration to do it right, but the amount of work is pretty small.

  • change acs_object_types table (new key, unique constraint on object_type)
  • add new and delete functions to acs_object_type package
  • make sure all foreign keys referencing acs_object_types use the right column (easier than making them all use the integer key)
  • arrange the appropriate order for data model installation (table acs_object_types, table acs_objects, package acs_object, package acs_object_type)
  • write upgrade scripts that drop constraints, alter tables, insert objects for existing object types, and add new constraints to replace the old ones (tricky, but not impossible)

However, to answer Dean's original question, I'd still go with a mapping table. It's hard to imagine using acs_rels would be of any great benefit.