[development] nodify.module idea: 'everything is a node'

Michelangelo Partipilo michelangelo_pm at cantv.net
Mon Jan 22 22:01:47 UTC 2007


You could use something like an Accumulator within a Visitor Pattern to 
allow altering forms/node objects/link lists/etc. But some more thinking 
would have to go into this, and I think it very much resembles the 
current approach.

fago wrote:
>> Using node-like API functions on other objects sounds like
>> polymorphism to me, which is a "solved problem" so to speak.  Any Java
>> or C++ programmers out there who might comment on this?  (I only know
>> enough Java and C++ to be dangerous.  :-)
> 
> the proposed concepts are somehow similar, but there are differents.
> E.g. hook_form_alter() allows modules to change the node forms. If two
> modules are changing the form it's still working fine as long as they
> change two different parts of the form.
> 
> With OO programming techniques this wouldn't be possible, as module2
> would need to subtype the form of module1, which is already subtyping
> the form.
> So the hook system seems to a bit more powerful (at least in this case).
> 
> I like the hook system of drupal, it's easy to understand and flexible.
> 
> -fago
> 
> 


More information about the development mailing list