It's really a pipe-dream, considering how deeply ingrained the present architecture is in the very core of Drupal.

But looking a bit more closely, there already is a kind of pseudo-object-orientation in the architecture: Function names are prefixed with category names (module name, theme name, "drupal_"), similar to static member functions of a class. Nodes are handled as objects already, it seems.

So the only real disadvantages (apart from changing all the code) would be:

- Permanent deprecation of PHP 4 support
- A lot of changes to the API and required updates to all modules. But we've come to expect that with new major releases...

Whereas the object-orientation would make it a lot easier for modules to interact, less easy for modules to cause function name collisions by forgetting or misspelling a prefix, and easier to draft UML diagrams and that sort of thing.

---

So, still a pipe-dream. Probably not in Drupal 7 or 8... but maybe 9?

Comments

kbahey’s picture

You should be really excited about Drupal 6 then.

We are completely rewriting it in Java, so it will be OO inside out, with lots of OOHs and AAHs.

Check the new Subversion repository here.

We reserved the domain name droopal.org to better reflect that new direction.

We need volunteers ...
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

cburschka’s picture

My sarcasm detector has yet to finish its warm-up phase this morning. Is that...

*checks link*

Okay, it is. You had me worried for a while there. :P

kbahey’s picture

It was not sarcasm at all. It was humor.

There is a running joke in the community about Dries rewriting Drupal in Java.

There are regular debates on whether we should move from CVS to SVN too.

Hence the joke ...

P.S., someone did register droopal.com http://whois.domaintools.com/droopal.com and someone else registered droopal.org http://whois.domaintools.com/droopal.org
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

Chill35’s picture

That's a great joke. I am still laughing after 2 minutes now.

Thank you, I needed that.

Caroline

cmgui’s picture

Yes, Java sucks. It's slow. But it is silly to associate OOP with Java.
OOP has been around long before Java.
And Java also isn't the reason why OOP became popular.
C++ is the reason.
I hope to see Drupal go OOP.