Autocomplete, OOP and extending drupal.

Popular open source CMS
Site Admin
Posts: 178
Joined: Tue Sep 29, 2009 6:25 pm
Location: Moss Norway

Autocomplete, OOP and extending drupal.

Postby KBleivik » Mon Aug 29, 2011 1:59 pm

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 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: ... pment/book

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

We have not studied these articles, since the subject is discussed in chapter 9 of this ... 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: where you will find this ... 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:

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.

Return to “Drupal”

Who is online

Users browsing this forum: No registered users and 1 guest