Forum OpenACS Development: more thoughts on [extends ...] and inheritance

Collapse
Posted by Jim Lynch on
Some time ago, before openacs, acs_object was created, and so we have an object system... might be useful to have some CASE tools to show class hierarchy, and show and maybe even edit methods and instance vars.

But then, xotcl came along (not in core atm, so not so relevent as acs_object) with the effect being, now there's two object systems, and the CASE tools from above could be factored such that they can work with both...

BUT

now we have a third object system implemented by [extends ...] and so things are starting to get tense with all these different systems. While all three systems offer your basic OOP functionality (give or take), the extends system probably offers the most potential wrt package-based app construction, and the idea of inheriting from subsite to get different-looking or different-acting subsites is a great first application of that idea.

I'd like to see a very simple system using extends that allows the construction of very simple composite apps, maybe have 5 packages max that can be used there.

The CMS in the original acs had a feature that I sortof understood but never saw used: the idea of storing a template for a content_type. I think this combined with [extends ...] offers a way to create packages that serve to define single acs_object_types and/or content_types and has all the UI and functionality to deal with their object inside.

One idea that comes to mind is to have package methods which add (1) form elements and (2) form actions to existing forms whose names are passed into the methods. The form actions would be the typical new_data and edit_data that a form would normally have.

So I'm realizing however that objects in the [extends ...] system are actually package instances, and so the combination would have them be acs_object factories and managers.

Anyway, I think the [extends ...] idea is cool, and I wanted to fire up some discussion around it.