[pmwiki-users] Unifying variables, attributes, properties, part 2 (attributes)

Patrick R. Michaud pmichaud at pobox.com
Thu Dec 15 14:43:46 CST 2005


On Thu, Dec 15, 2005 at 01:08:19PM -0500, Waylan Limberg wrote:
> Although, it has occurred to me (both now and in the past when dealing
> with the include problems) that an object oriented approach could
> potentially address this issue. Each page, (whether called from
> (:include:) or <!--wiki: or otherwise) would create a new instance of
> the class and would make all variables in that instance independant of
> any other instance. Of course, this would require a complete rewrite
> of the core and would probably be better done when PHP5 becomes mature
> and common (a few years down the road?). Perhaps some goals for PmWiki
> version 3?? ;-)

Here are some generic thoughts on the use of object-oriented
approaches in PmWiki.  First, some background:  I've been doing
object-oriented programming since 1987 (C++ and Smalltalk), and
taught courses in object-oriented programming at the senior and
graduate levels for over ten years, so I'm pretty familiar
with them.

But ultimately I've rejected an OO approach for PmWiki's core
(except for page storage [*]) simply because I think OO raises the 
knowledge bar a little too high for people who might want to 
customize and extend PmWiki.  Yes, this choice may forego some 
elegance and code re-use, but I think having some accessibility 
to the novice programmer (and perhaps even non-programmer)
is important.  

As an interesting side note to this:  a couple of months ago I
presented PmWiki to the local PHP users group, and I was asked
if PmWiki was implemented using classes+objects or procedurally.
When I answered that it was primarily a procedural implementation,
the room broke out into applause and sighs of appreciation.  :-)

Beyond all that, OO is really more about how you perceive the
problem than how the solution is actually implemented.

So, I don't know what might be in the future for PmWiki 3 (or even
if there will be a PmWiki 3), but being object-oriented is to me
merely a possible strategy for reaching a goal, and not a 
goal in itself.  :-)

Pm

[*] Page storage in PmWiki is implemented using class+object because
I really really needed a polymorphic abstraction layer to simultaneously
support different page storage implementations.





More information about the pmwiki-users mailing list