My apologies if this has already been covered at length elsewhere, but given that PHP 5 will be the minimum required version for Drupal - what effect will that have on Drupal's code base from this point forward? Are current 'leading' discussions indicating that over time large parts of Drupal will be written/re-written in a totally OO way? I ask because I'm wondering if a fully OO contrib module for Drupal 6 would be considered as having been 'correctly' done in a 'Drupal-way', or not. (all other things being correct/equal, of course)
Are current 'leading' discussions indicating that over time large parts of Drupal will be written/re-written in a totally OO way?
Some want to. But they need to have VERY convincing arguments re. what we win for a bigger conversion than FAPI was. We do have a very working Drupal (jokingly, I refer to Drupal 6 as the Performing Polecat because it's so fast. And because metta's ferrets are cute.) So if you want to change a lot, there needs to be performance/feature wins, big time.
I ask because I'm wondering if a fully OO contrib module for Drupal 6 would be considered as having been 'correctly' done in a 'Drupal-way', or not. (all other things being correct/equal, of course)
I am not 100% that menu will support an array for a callback (ie method call). Care to test it?
Contribs have always been able to use OO if they felt like it. Views and the forthcoming Views 2 use classes internally, and it's one of the most widely used contrib modules. The "Drupal Way" relates mostly to how modules interact with each other, which is via hook functions rather than methods or inheritance or any of the other common OO modular design setups. Exposing classes to other modules is currently not recommended, but the internal architecture is largely unregulated. What will happen in Drupal 7 is still up in the air. I'm working on rebuilding the database system in an OO way, although it will have a procedural thin wrapper for simplicity so you'll still be using db_query() 99% of the time. There has been a fair amount of talk about possibly revising FAPI to use objects and the ArrayAccess Interface, but so far mostly just test code, not actual committable code. I've been pondering a Page singleton object, some people have mentioned actions or nodes as objects... so far it's mostly all talk, no decisions. :-) I expect a lot more constructive talk in Barcelona: http://barcelona2007.drupalcon.org/node/350 On Sunday 02 September 2007, Caleb Gilbert wrote:
My apologies if this has already been covered at length elsewhere, but given that PHP 5 will be the minimum required version for Drupal - what effect will that have on Drupal's code base from this point forward? Are current 'leading' discussions indicating that over time large parts of Drupal will be written/re-written in a totally OO way?
I ask because I'm wondering if a fully OO contrib module for Drupal 6 would be considered as having been 'correctly' done in a 'Drupal-way', or not. (all other things being correct/equal, of course)
-- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson
This document talks mainly about core, not contrib, and how it is OOD but not OOP. With PHP5, one would expect more true OOP to make its way into contrib, and perhaps to core (over time). Drupal Programming from an Object-Oriented Perspective<http://api.drupal.org/api/file/oop.html/6> http://api.drupal.org/api/file/developer/topics/oop.html/6
participants (4)
-
Caleb Gilbert -
Karoly Negyesi -
Khalid Baheyeldin -
Larry Garfield