Object Oriented Programmation

A good start point about Object Oriented Programmation (OOP) and drupal is this document from the drupal API
http://api.drupal.org/api/HEAD/file/developer/topics/oop.html

This group aims to put together some useful references about Object Oriented programmation and modelization with drupal. Sometimes drupalers have great discussion about OOP , for example on their blog or during conferences, and we try to report them in this group.

So whereas you are a simple observator like the manager of this group, an OOP guru or a drupal guru or just a curious person you are encourage to join this group.

Are you interested in learning or using Flex?

ccharlton's picture
public
ccharlton - Mon, 2008-02-25 19:41
Yes
56% (73 votes)
Maybe
12% (16 votes)
No
18% (24 votes)
Not sure yet
14% (18 votes)
Total votes: 131

What if FAPI were OO?

Julien Marboutin's picture
public
Julien Marboutin - Sat, 2007-12-29 13:22

Earl wrote a great article about the form API and OOP in march 2007.
http://www.angrydonuts.com/what_if_fapi_were_oo


Using classes to implement modules and themes, any interest?

public
alexBronstein@d... - Fri, 2007-07-06 18:35

Hi folks,

I'm new to this group (and to groups.drupal.org in general), so let me give a quick introduction. I'm one of the owners and programmers at CraftySpace, a web development company creating Drupal-based solutions for our clients. We're a little over a year into our business, so we've been dealing with the hecticness that comes with a start-up business, and therefore, not getting as involved with the Drupal community as we'd like to be. But I'd like to start getting more involved, since that, of course, is the whole point of open-source software, so I appreciate the opportunity to be a part of this group.

Anyway, one of the things we're doing is trying to use more OOP syntax in the code that we write. To facilitate this, we created a module (that we're currently calling "ClassLibrary") that allows a module or a theme to be created as a class. The ClassLibrary module uses PHP 5's reflection API to create procedural wrapper functions around the public methods of the class in order to get the module or theme to integrate into Drupal the way modules and themes normally do. This approach allows us to write most of our code using OOP syntax, which we find more comfortable and intuitive than procedural syntax, it lets us have enforced encapsulation (i.e., private variables and methods), and it lets us take advantage of implementation inheritance in creating custom modules and themes in a way that I think is much more limited without using classes.

Should everything be node in drupal ?

Julien Marboutin's picture
public
Julien Marboutin - Wed, 2007-07-04 17:31

Do you think everything should be a node in drupal ?
I have read in the "Pro drupal development book" on the page 86 that there have been great debates about this question but can not find them.

By the way, what are the objects in drupal ?
-node
-block
-user
-comment
-view
-panel
-file
others?

If "everything is node", should a link between two nodes be a node itself ?

I used to think that node should be a kind of class constructer that build every objects in drupal and then can be plugged with any functionnality available. No I think it is a bad idea. And you ?


Use cases

Julien Marboutin's picture
public
Julien Marboutin - Wed, 2007-06-20 14:49

Do you think that what we have at ?q=admin/user/access is enough to reflect uses cases of a system ?

I found it very powerful and you ?


Object composition

Julien Marboutin's picture
public
Julien Marboutin - Thu, 2007-06-07 22:24

How do you deal with object composition within drupal ?

Do you use Taxonomy + Panel + View ?

Do you use node reference with CCK node ?

Other solutions ?

What are your ways to define a container of other objects ?

Which drupal modules are involved in "object composition" nowadays ?

Object composition is about building "large" objects from "smaller" ones.
Here is a definition of object composition on wikipedia : http://en.wikipedia.org/wiki/Record_(computer_science)


Inheritance : super class, subclass and overriding

Julien Marboutin's picture
public
Julien Marboutin - Wed, 2007-06-06 23:26

How do you translate your inheritance relations between classes with drupal ?

Suppose we have a super class "employee" with the three properties : name ; phone ; email and subclasses that are specific types of employees.

Then how will you implement this with drupal ?

The best way I see is to use CCK module and to share the fields of the super class between the node types of the subclasses.

The good points are that :

CCK can be seen as a class constructor in drupal. All the plugins we can find with CCK let us build our classes with more and more possibilities.


A good start point about Object Oriented Programmation (OOP) and drupal is this document from the drupal API
http://api.drupal.org/api/HEAD/file/developer/topics/oop.html

This group aims to put together some useful references about Object Oriented programmation and modelization with drupal. Sometimes drupalers have great discussion about OOP , for example on their blog or during conferences, and we try to report them in this group.

So whereas you are a simple observator like the manager of this group, an OOP guru or a drupal guru or just a curious person you are encourage to join this group.

Syndicate content