SoC - (general) object oriented coding
Hi, Should any piece of Drupal code (especially the newly written codes) contain objects? Should I design new modules/etc in object oriented way? I use fgrep to browse in Drupal cvs code, but I can't find any class. Is it a non-written coding standard to not use oo? (by the way in PHP4 the oo is not very mature) Thanks, Aron Novak
On Thu, 04 May 2006 22:20:02 +0200, Novák Áron <aaron@szentimre.hu> wrote:
Hi,
Should any piece of Drupal code (especially the newly written codes) contain objects? Should I design new modules/etc in object oriented way? I use fgrep to browse in Drupal cvs code, but I can't find any class. Is it a non-written coding standard to not use oo? (by the way in PHP4 the oo is not very mature)
I just Googled the words drupal OOP and got http://api.drupal.org/api/HEAD/file/developer/topics/oop.html as the first result which is exactly what you should read.
Should any piece of Drupal code (especially the newly written codes) contain objects? Should I design new modules/etc in object oriented way? I use fgrep to browse in Drupal cvs code, but I can't find any class. Is it a non-written coding standard to not use oo? (by the way in PHP4 the oo is not very mature)
Currently, Drupal core is all procedural, and for a reason. Please see: Drupal Programming from an Object-Oriented Perspective http://api.drupal.org/api/HEAD/file/developer/topics/oop.html Which isn't to say that you *can't* use OOP (the awesome views.module does so) if absolutely necessary, but I think it's fairly safe to say, contribution-or-not, procedural is preferred. -- Morbus Iff ( you see, doctor, but you do not observe! ) Technical: http://www.oreillynet.com/pub/au/779 Culture: http://www.disobey.com/ and http://www.gamegrene.com/ icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
participants (3)
-
Karoly Negyesi -
Morbus Iff -
Novák Áron