29 Mar 2010 @ 4:27 AM 

A Fractional Key System for Memcache.

Fragmented or as I prefer to call them fractional keys provide a relatively trouble free way of managing the inter-dependencies of cached data.

At its heart fractional keys are simply tag based keys. Where they differ from the standard implementation of tag based keys is that each tag has an associated version number. This allows us to invalidate all keys dependent on a specific tag automatically by incrementing its associated version.

More »

Posted By: Keith Noizu
Last Edit: 02 Dec 2011 @ 04:28 PM

EmailPermalinkComments (3)
Tags
Tags:
Categories: Code, Php
 25 Dec 2009 @ 1:44 PM 

I think we’ve all gotten sick of keeping track of arguments lists for certain functions and suddenly felt the desire to resort to named params in order to avoid messes such as functions that look like

  foo(array $argot, ingot $begot,ingot $cargot, cat $dargot,$ergot,$farthing,$garging,$haring,$baonr,$tarish  = 4 ,$smar = "lare",$lar = null,$var = smare, $snare= gare);

The simplicity of

  foo($params);

is clear, especially if many or all of our named params have default values and do not need to be passed in explicitly.

More »

Posted By: Keith Noizu
Last Edit: 02 Dec 2011 @ 04:18 PM

EmailPermalinkComments (1)
Tags
Categories: Code, Php
 25 Dec 2009 @ 7:28 AM 

One of the beauties of our current generation of languages is the retirement of the dependency diamond and all of the other oddities that multiple inheritance can wreak on unwary developers. Multiple Implementation of Interfaces is much preferable to multiple inheritance for many reasons, but throwing all caution to the wind lets say we did desire some way to mimic multiple inheritance within php?

Building on my pseudo decorator class I have written a class that allows us to encapsulate multiple third party objects within our “decorator” class. Essentially with this Union class we can mimic multiple inheritance.

More »

Posted By: Keith Noizu
Last Edit: 02 Dec 2011 @ 04:28 PM

EmailPermalinkComments (3)
Tags
Categories: Code, Php
 25 Dec 2009 @ 7:06 AM 

The Decorator Pattern allows us to easily change the methods and attributes of an object at runtime. Here is my source code for a psuedo decorator class which silently passes attribute and method calls down to its encapsulated object.

This is not strictly an example of the decorator pattern as our encapsulating class is not inherited from our encapsulated class; however, this does provide a useful way to quickly wrap third party objects and shows some of the logic (the calling of the encapsulated methods & members) one may want to employ if actually deriving a decorator class from a base class.

More »

Posted By: Keith Noizu
Last Edit: 24 Aug 2010 @ 04:32 AM

EmailPermalinkComments (1)
Tags
Categories: Code, Php

 Last 50 Posts
 Back
Change Theme...
  • Users » 100
  • Posts/Pages » 14
  • Comments » 11
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.

About



    No Child Pages.

Resume



    No Child Pages.