The Artima Developer Community
Sponsored Link

PHP Buzz Forum
DBDO News

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Alan Knowles

Posts: 390
Nickname: alank
Registered: Sep, 2004

Alan Knowles is Freelance Developer, works on PHP extensions and PEAR.
DBDO News Posted: Apr 11, 2005 2:56 AM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Alan Knowles.
Original Post: DBDO News
Feed Title: Smoking toooo much PHP
Feed URL: http://www.akbkhome.com/blog.php/RSS.xml
Feed Description: More than just a blog :)
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Alan Knowles
Latest Posts From Smoking toooo much PHP

Advertisement
DBDO's slow migration from vapourware to bugware has been progressing this week. A month ago, I started useability testing on the PHP5 version of this site, and it helped find alot more issues than the unit tests that I had set up.

A few weeks ago though, I was working on another application that uses a threaded version of PHP embed, and DBDO, which was throwing up quite a few bugs around setting / fetching data using the overloaded internal setters and getters.

The original design of DBDO, was that when you fetch a value (eg.)
echo $do->name;
that the object would internally get the value from libgda at this point, rather than the way DB_DataObject currently does, by assigning all the PHP variables when you call $do->fetch().

The trouble was that this way of working began to get very confusing when mixed with all the potential ways that you may access the data.
  • Setting the column value (at this point you have to store a seperate hash for assigned values)
  • print_r and it's like need you to actually set values for all the properties.
I ended up with something like 3 hashes doing various tasks, and each needing memory managing. And as usual, complexity leads to numerous bugs.. So I made the decision last week to follow DataObjects logic of simply setting the properties on fetch().

This removed a large chunk of code, and in general simpified the whole query building process. Things like the update code could easily compare the fetched data against the current object properties and update only the changed data. The only thing that caught me out was that unless you add a zend_objects_store_add_ref() after changing the properties internally, the values get free'd too early and segfaults occur.

Anyway, the current plan is to get back to testing the code on the PHP5 version of this site next week, then actually make an alpha release...

Read: DBDO News

Topic: PHP-Magazine's security leak closed Previous Topic   Next Topic Topic: Microsoft Takes Python Scripting Language to .NET

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use