thundermonkey.net : development

Developing

During the brief periods that I'm not working on other peoples' projects, I like to put new theories and technologies to the test in various experiments. Occasionally the results of these experiments are then used for client projects.

Tools

There's a tool for every job, and whilst my chosen toolset won't generate the next blockbuster PS3 title, they manage to help build solutions for the more modest problems posed by Internet-aware applications ...

  • PHP (the workhorse that brings everything together)
  • MySQL, SQLite (fast, free storage management)
  • Apache (the world's favourite web server)
  • Flash & ActionScript (for adding GUI "richness" and sparkle)
  • XHTML, CSS, JavaScript (the equivalent of a hammer in your toolbox - essential)
  • Subversion (brilliant version-control)
  • W3C (reference to ensure future-proofing)
  • Windows, Linux

All code is object-oriented, standards-compliant and well documented which all help to make projects extensible, easily maintained and team-friendly.

The majority of the projects I undertake require working within an in-house team or with fellow freelancers. Writing clean, consistent code has helped no end in such situations.

Projects & Experiments

Here are a few projects, all of which are available to download from the Subversion repository at:

http://svn.thundermonkey.net/jdg/ (anonymous read access)

A daily snapshot of certain projects may also be available for download.

These projects are all in various states of completeness, most being in a perpetual beta-stage.

TortoiseSVN (for Windows) is a nice graphical interface for accessing subversion repositories.

  • Buan

    Sept '06 - Present

    More details ...

    Buan ("Bee-yan") is a lightweight, loose-MVC (Model-View-Controller) framework written for PHP 5.

    Yep, it's the "F" word again. I'm sick of it too so as a friend of mine might say, let's call Buan a "Badger".

    Buan's greatest asset is it's comparatively lack-lustre feature set. It doesn't have a built-in "session authentication module", or a massive library of helper functions - these things just get in the way. Instead it simply provides an API to carry out the following tasks:

    • Read/write from/to a database backend - MySQL, SQLite, etc - using PHP's PDO classes wrapped up in our "Model" and "ModelManager" classes. There is no abstraction layer (ADOdb doesn't live here), but support for integrating your own choice of abstraction will eventually be implemented. Maybe.
    • Construct and render interfaces using the nestable "View" class which currently supports PHP template files. You can also dictate the order in which Views get rendered within a hierarchy of Views using the ::renderAfter() method.
    • Contain all your business logic within "Controller" classes. The methods in these classes map to URLs.

    And you may find Buan quite liberating when compared to other Badgers.

    The MVC structure is there to use, but only if you want to use it, and it's very lenient on where you can execute code within this structure - load a Model from within a View, Generate a View form within a Model class, etc. It leaves the structural integrity up to you the developer.

    Alternatively you can write PHP scripts that don't fit into this structure whatsoever - just include Buan's initialisation script, tell it where to find all the config settings and carry on coding in whatever style you wish, using Buan's API if and where you want.

    It's still young, and under a very ad-hoc development schedule (ie. when I get a spare 5 minutes), but here are the guiding principles for it's continuing development:

    • Retain a small footprint. All the bells and whistles such as "parameterized authentication sibling modules" can be developed, shared and linked into the individual application as and when required using the handy "Extension" class.
    • Provide a steep, but simple learning curve. Great documentation, code examples and fool-proof administrative GUIs would be the main drivers behind this goal.
    • Three steps to getting up and running - "Download", "Install" and "Run". Configuration steps should be minimal and handled via GUIs where possible.
    • Use recommended, but optional conventions. Having to name things in certain ways can be a ballache in some situations and whilst extremely useful in rapid development and debugging, it should be optional where required.
    • Minimal maintenance. Updating and extending Buan should be as painless as possible.
    • Truly international. You shouldn't feel restricted if you don't happen to be speak ASCII. PHP6's Unicode implementations would be most welcome here.

    And here are a few insights into the API to whet your appetite:

    <?php
    /* Initialise Buan */
    require_once('/path/to/buan-core/init.php');
    Core::configure('/path/to/config/files');
    
    /* Define Model relationships */
    /* (this would normally be done elsewhere) */
    ModelRelation::define("Person(1):Pet(M)");
    
    /* Create a new "Person" */
    $person = Model::create('Person');
    $person->name = "Bob Robertson";
    
    /* Create a new "Pet" */
    $pet = Model::create('Pet');
    $pet->name = "Bobby";
    $pet->species = "Dog";
    
    /* Associate and save Models */
    $person->addRelatedModel($pet);
    $pet->getModelManager()->save($pet); // (saves $person and $pet)
    
    /* Create and render a View */
    $view = new View();
    $view->setSource('/path/to/view/template/source.tpl');
    $view->person = $person;
    $output = $view->render();
    

    This site itself is built on Buan so have a nose around to see it in action!

    Find more info at http://buan.thundermonkey.net/.

  • Valhalla

    Oct '02 - Present

    More details ...

    Back in 2002 I was commissioned by Tricycle Media to design and develop a Content Management System for managing their websites.

    Since then Valhalla has exploded into an extremely powerful and extensible framework capable of delivering pretty much anything you want.

    The entire framework relies on a few core features, including:

    • A generic permissions architecture based on Access Control Lists (ACLs). These are highly flexible and provide the means to apply any number of permissions to any type of object throughout the system.
    • A templating system based on XML definition files which allow you to define child-parent hierarchies, "bolt-on" additional data sources at render-time and use any third-party rendering engine.
    • The "Single-Core" principle that allows hundreds of sites to run from the same source. This means that updates and repairs can be rolled out across each and every site very quickly.

    Tricycle Media has successfully launched over one hundred sites built on Valhalla. Take a look at their portfolio for examples of it in action.

  • UlMenu

    Feb '06

    More details ...

    View the demo here.

    This was an attempt to create a beautifully tidy method of rendering nested drop-down menus based on the <UL> element set.

    For the most part it actually works pretty well and the underlying HTML source code is, I'd say, very tidy. Unfortunately it doesn't work perfectly in all target browsers (IE5.5+, FF1+, Safari, Opera 8+), but if you can download the source, have a poke around and find the solution(s) then I'd be more than happy to post it back here giving you full credit!

Valid XHTML 1.1 Valid CSS! Firefox 2