Object oriented programming a system of limited program transformation

Pondering the state of my several dormant programming projects, I considered the python project where I attempted to create a basic game framework to cover some of the common code to all games. Something that was in a continuous state of flux as I discovered the need for new extension points or found others tedious and counter-intuitive.

It was then it occurred to me that object oriented programming was a form of program transformation, as objects get sub-classed and additional methods in those objects get overwritten. It is a very limited form of program transformation, however. Changes can occur only at the specific extension points provided by base code – no more (needed capabilities may not be available) and no less (you may have to duplicate code, which then does not benefit from changes in the base system)

Ah, but do I have a solution? For the project that brought on these thoughts, I would want a system that allowed me to easily transform any part of the base system at any level of granularity, foreseen or no. Furthermore, to effortlessly integrate proven transformations back into the base system without 1) duplicating all the transformations, 2) going back and modifying the client code to utilize the base system functionality.

But, in the larger view, would this be a good thing? Only in certain applications. The ability to create arbitrary extension points would essentially render any kind of library code un-maintainable – even a small change might cross extension boundaries in dozen’s of applications. The fully integrated system would appear to be practical only for single authors, or sufficiently coordinated teams.

Objects are no panacea of course. Fixed objects and extension points limit the interdependence sufficiently for many types of changes, but anything more significant (the types of changes I was specifically complaining about) would break the interface. Sure, there are work-arounds; I don’t think I need to go beyond noting the mixed reputation of work-arounds. ;^)

Posted Thursday, December 30th, 2004 under Essay.

Comments are closed.