Autocomplete, OOP and extending drupal.

Popular open source CMS
Post Reply
KBleivik
Site Admin
Posts: 184
Joined: Tue Sep 29, 2009 6:25 pm
Location: Moss Norway
Contact:

Autocomplete, OOP and extending drupal.

Post by KBleivik »

1. Autocomplete
Drupal is very flexible. You may integrate it in your existing projects. Some claim that nearly every site you want to develope may be developed by using Drupal as the preferred web platform. If you are sceptical, a fast scan of the titles of these http://www.packtpub.com/books/drupal books may help in convincing you. But much of what you may need is there ready for you to plugin in, modify or develope yourself:

http://www.packtpub.com/drupal-7-module ... pment/book

As an example let us take autocomplete. A fast search on Google for: drupal autocomplete gives these hits:

http://www.appnovation.com/how-implemen ... tocomplete The first hit.

http://drupal.org/node/42552

http://drupal.org/project/autocomplete_widgets

We have not studied these articles, since the subject is discussed in chapter 9 of this http://www.packtpub.com/drupal-6-javasc ... query/book book where performance (caching) is also an important issue. Matt Butcher wrote that book that was first published in February 2009. So follow his site: http://technosophos.com/ where you will find this

http://technosophos.com/content/why-obj ... bad-drupal interesting article
I have led or contributed to dozens of Open Source projects. And with one exception, all of my code has been Object Oriented. (That one exception is Drupal.) Java, Python, PHP, and even OO Perl... I'm a dyed-in-the-wool OO developer. So this may come as a shock to anyone who knows me, but I am about to make the argument that OO is bad for Drupal.

Trust me, this is not a high point in my development life. I feel like I'm telling my child that she should skip college; that such a level of sophistication is just not necessary in her life. And I guess in a way that is precisely what I am saying.
written 2010-10-13.

At the same time he writes this in the older book page 249
First, most Drupal PHP code is procedural, not object-oriented. Functions are defined in the global name space and are not ususally assigned to objects. This will change in Drupal 7, which will be object-oriented to a greater extent.
2. Object oriented programming in Drupal

When looking at the file systems of CMSs you get the impression that many of them are driven by procedures and file systems that in a sense adheres to the Dont Repeat Yourself (DRY) principle that lies at the heart of object oriented programming. Drupal is no exception:

Furhter reading of the old days:
  1. http://drupal.org/node/19964
  2. http://drupal.org/node/240269
Further down the above mentioned article by Matt Butcher we find this
To Drupal 8, we're adding again! Contexts, plugins.... These new OO subsystems will have (or already have) new conventions and new terminology and new programming practices.
So Drupal 7 may now be defined as a hybrid system, while version 8 and later may be more and more object oriented in nature lagging a little behind the main language, PHP.

3. Extending Drupal and integrating it in your own system

You can of course ask the Drupal search featuere, a search engine for this subject or read a book by people that know Drupal like Matt Butcher.

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests