Drupal Melbourne Meetup October 12 2010

Events happening in the community are now at Drupal community events on www.drupal.org.
realityloop's picture
Start: 
2010-10-12 18:00 - 20:00 Australia/Melbourne
Organizers: 
Event type: 
User group meeting

Sign up to be notified of updates.

Follow drupalmelbourne on twitter or identi.ca for Drupal Melbourne news and announcements.

Many thanks to Publicity Works for the use of their office.
Google Maps: http://j.mp/bPxpZT

This month we will be talking about the following:

  • Drush Make by Dave Hall
  • Duplicity for automating backups by Miguel Jacq deferred
  • Drupalcon CPH by Dave Hall
  • OSI Days by Dave Hall
  • Show and tell
    -Demonstrate something cool you've been working on, or a module you like in 10 min or less, add a comment if you have something to present (let us know in comments if you have something you would like to show)

The doors should be open when you arrive, but call 0419 327 646 if they're locked.

Food and drinks will also be provided

Comments

I could probably show and

nicksanta's picture

I could probably show and tell a project we've just recently finished for a client. It's basically integrating Drupal with a legacy system, where Drupal acts as a portal to direct users around the old site. Mainly to overcome templating limitations in the legacy system, and because the client is trying to move their online services to Drupal.

classes module

mossy2100's picture

I might be able to demo a new module I'm working on for Peregrine called "classes". It's basically a code generator that generates PHP classes for nodes, users, taxonomy terms and content types. This provides a module developer with a nice OO API for working with nodes of different types, and a framework for adding their own methods. It's also much more efficient than Drupal at loading nodes, using lazy loading as much as possible, i.e. only loading requested data instead of entire nodes.

I haven't contribed it yet but that's the plan.

That sounds very interesting.

dazweeja's picture

That sounds very interesting. It would seem to me that the most efficient way of dealing with nodes (from a performance though not a memory perspective) would be that hook_load or hook_nodeapi:load actually altered/added to the node_load query before it ran instead of running a separate sql query to get extra information for each module that implemented the hook. That way each node needed for a page view would require only one SQL call (which loaded all information relevant to a node) and then the node was stored in the node cache. In PHP performance terms, a database call is very expensive so while lazy-loading seems much better than the current Drupal approach, it would still be less efficient than this approach. You can already sort of implement this approach using hook_query_alter/hook_db_rewrite_sql. I don't think this approach would be particularly efficient (especially from a memory perspective) in a more persistent environment like Java where the benefits of lazy-loading are obvious. However, in PHP where a (static) cache only exists for the life of a page call, it might have some merit. I'm not sure this has any bearing on your project - I just sort of mention it as a discussion point.

Wow

murrayw's picture

Sounds like a great module. I've grappled with both those issues during my dev with Drupal but not done anything about it. I've just done some serious module development for the first time and came to the realization that nodes are essentially (heavy) data access objects. In the Drupal world there doesn't seem to be an accepted natural way of wrapping them to provide a nice OO style. This leads to bad coding practices with node business logic scattered through the module rather than in a class. I applaud your efforts and look forward to the module being contributed.

Managing Director
Morpht

cheers

mossy2100's picture

Thanks all - it is a pretty interesting module and I'm enjoying writing it. However, I will only be able to demo it if Peregrine give the OK since they paid for it - hopefully they will.

At this stage I'm focusing on OO interfaces to nodes and users. Whenever you create a new Node object, it automatically detects the appropriate derived class, e.g. Country, Product, whatever, and instantiates that. The Factory pattern is used for object creation.

I've just added a really nice feature, which is implementing the __get() and __set() methods to provide virtual properties. So, instead of calling $node->getTitle(), you can just use $node->title. While that syntax seems pretty normal, the getTitle() method implements lazy loading. Another example, if you have a CCK field such as "field_first_name", you can simply get and set $node->first_name instead of the usual $node->field_first_name[0]['value'].

Node references are handled really nicely - for example, let's say you have a CCK node reference field such as a country node referencing a continent node, called "field_continent". If you access $country->continent, you get a Continent object containing the nid from the node reference. However, the node itself isn't actually loaded until you start accessing fields on that object.

Hehe. When you do contribute

nicksanta's picture

Hehe. When you do contribute it, it's tagline should be "Stay classy, Drupal". All the cool kids would get the joke. I like being on the inside of jokes :)

is that because...

mossy2100's picture

... you're frequently the subject of them? :p

Also interested in this

maedi's picture

Also interested in this module. Please keep us posted!

Nick and Mossy: I think we

realityloop's picture

Nick and Mossy: I think we may already have enough for this month, we'll see how we're going for time on the night, but if we don't it would be great to have them as presentations for next month!

@BrianGilbert_

Help make Drupal Melbourne meetups more awesome:
http://groups.drupal.org/node/204518

The best way to grow your local commununity is by participating in it!

Mig has had to pull out at

realityloop's picture

Mig has had to pull out at last minute due to non drupal related circumstances.. so nick or mossy you now have an opportunity to present!

Cheers,
Brian

@BrianGilbert_

Help make Drupal Melbourne meetups more awesome:
http://groups.drupal.org/node/204518

The best way to grow your local commununity is by participating in it!

classes module

mossy2100's picture

Sure, I would be happy to. I could probably give about a 15 minute demo pretty easily.

Shaun's will be much more

nicksanta's picture

Shaun's will be much more interesting than mine anyway :P

Australia

Group categories

Location

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: