On Thu, 7 May 2009 09:25:53 -0600 Greg Knaddison <[email protected]> wrote:
> On Thu, May 7, 2009 at 9:12 AM, Ivan Sergio Borgonovo > <[email protected]> wrote: > > On Thu, 7 May 2009 09:23:48 -0500 > > Jeff Eaton <[email protected]> wrote: > > > >> Crell's Law: If an API must be use-case-optimized, make it > >> swappable & tailor the default for cheap shared hosting. > >> High-end sites can swap. > > > >> Eaton's Corollary: If an API is swappable, write two > >> implementations. APIs with one test case are rarely flexible > >> enough for the second. > > > > If you want to make stuff swappable start at least with 3 > > implementations otherwise 2 will just be a special case of 1. > > We have to temper the ideal with reality. We have several That`s why I didn`t write "working implementations" ;) At least in my experience a "what if they were 3" makes a huge difference to avoid 2 just a special case of 1. But anyway how could you plan or even think an API could be useful knowing just 2 use-case? But then... when you cut and paste more than once... you need an API ;) 3 is the magic number! > And three cheers for Crell's Law and Eaton's Corollary. I would extend that cheers further than just for the Law and the Corollary. BTW Ernie that`s called delegation and everybody know that delegation is the solution to all CS problems. -- Ivan Sergio Borgonovo http://www.webthatworks.it
