Development Changes - July 2011

July 10thPDO DB under construction

It's not in the works. lib/DB.php and also lib/DB/dsql.php contain half-finished implementation of PDO layer. If you need to implement it yourself and you can't wait, you can use this class to make your own. We expect PDO to arrive sometime in 4.1.1 or bit more later.

July 6thDynamic Methods

Agile Toolkit now supports dynamic methods. Avoid using them at any costs, since they are slower than regular methods and are quite confusing for developers. Dynamic method allows to register method for one or all objects

$this->api->addGlobalMethod('helloworld',array($this,'helloworld'));

This code will allow calling $anyobject->helloworld();. This is quite effective way to maintain backwards compatibility when methods are being cleaned up. There is also a function for registering method for single function. It is useful if controller wants to register function inside API namespace. Possibly PathFinder could have registered locate() and locateURL() functions through this approach, to keep API clean, however since it's very essential controller, it's been done in old-fashioned way for simplicity and speed.

July 6th$this->frame() is no more

$view->frame() used to be a handy method to add a frame with a header. This method is now obsolete in favour of the new form:

// $frame=$view->frame('My Frame Title');

$frame=$view->add('Frame')->setTitle('My Frame Title');

If you have been relying on this function, there is actually a compatibility controller. If you add it, then old format would still work.

$this->api->add('Controller_Compat');
$frame=$view->frame('My Frame Title');

This controller also adds removed support for ajax() function for all views.

July 6thAdded Unit Test suite

Unit tests basics is quite simple. Execute a function and compare results with expected. Agile Toolkit provides a simple implementation for Unit tests, however with few nifty features

class page_mytest extends Page_Tester {
    function 
prepare(){
        return 
$this->add('View');
    }
    function 
test_name($t){
        return 
$t->name;
    }
    function 
test_shortname($t){
        return 
$t->short_name;
    }
}

Firstly, there are no value to compare with. Testing framework aims at remembering correct value on it's own and comparing with new value. Secondly, each test is a function, which makes it possible for a testing script to execute each test multiple times. Additionally, function prepare() is called before each test, which is designed to prepare data to be used within test. This way you can always start test with a clean object to play with.

This testing framework will be further enhanced. We plan to add stress-test and storing results in mysql as well as automated re-testing of multiple pages like this without verbose output.

Another feature supported is "variations". It allows you to use different prepare functions for tests. For example if you implementing new version of your controller and you want to test it against old one - it will show you output side-by-side.

There is also a new project called atk4-tester, which is growing collection of tests for testing framework

Older Entries Newer Entries

Development History

All changes to the development version of Agile Toolkit are listed below.

Agile Toolkit Core
  • Release 4.2 NEW!
  • Release 4.1.2
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • Mart 2011
  • February 2011

    • To stay up to date, by following @atk4 on twitter. Use Git / master branch for most recent version.