<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Front and Back</title>
	
	<link>http://relivethefuture.com/choronzon</link>
	<description>Music. Software. Reality</description>
	<pubDate>Thu, 09 Oct 2008 22:55:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<media:copyright>MDK</media:copyright><media:keywords>MDK,Cristian,Vogel,electronic,techno,experimental,no,future,spandex,hand,on,the,plow,beckett,and,taylor,idm,music,house,drum,and,bass,jungle</media:keywords><media:category scheme="http://www.itunes.com/dtds/podcast-1.0.dtd">Music</media:category><itunes:author>MDK</itunes:author><itunes:explicit>no</itunes:explicit><itunes:keywords>MDK,Cristian,Vogel,electronic,techno,experimental,no,future,spandex,hand,on,the,plow,beckett,and,taylor,idm,music,house,drum,and,bass,jungle</itunes:keywords><itunes:subtitle>Fresh music from MDK and other cutting edge music producers.</itunes:subtitle><itunes:summary>Fresh music from MDK and other cutting edge music producers.</itunes:summary><itunes:category text="Music" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/FrontAndBack" type="application/rss+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item>
		<title>OSC - Open Sound Control</title>
		<link>http://relivethefuture.com/choronzon/2008/10/08/osc-open-sound-control/</link>
		<comments>http://relivethefuture.com/choronzon/2008/10/08/osc-open-sound-control/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 11:11:08 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[OSC]]></category>

		<category><![CDATA[open source]]></category>

		<category><![CDATA[actionscript 3]]></category>

		<category><![CDATA[AS3]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[flex]]></category>

		<category><![CDATA[Kontrol49]]></category>

		<category><![CDATA[Max/MSP]]></category>

		<category><![CDATA[MIDI]]></category>

		<category><![CDATA[Open Sound Control]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/?p=55</guid>
		<description><![CDATA[For some reason, MIDI isnt dead yet, although it is indeed &#8216;ubiquitous and lightweight&#8217; that doesn&#8217;t mean it should stick around. For some tasks its fine, but its definitely starting to show its age. One of the alternatives for communication between audio / video software and devices is Open Sound Control - OSC.
Im not going [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason, MIDI isnt dead yet, although it is indeed <a href="http://gilesbowkett.blogspot.com/2008/10/archaeopteryx-rubyfringe-presentation.html">&#8216;ubiquitous and lightweight&#8217;</a> that doesn&#8217;t mean it should stick around. For some tasks its fine, but its definitely starting to show its age. One of the alternatives for communication between audio / video software and devices is <a href="http://opensoundcontrol.org">Open Sound Control</a> - OSC.</p>
<p>Im not going to go into a deep discussion of MIDI vs. OSC at this point, there are of course some benefits to MIDI which OSC should deal with in some way (e.g. a standardised namespace for representing MIDI semantics, or a discovery mechanism for that namespace..)..anyway, I just want to let you know that I&#8217;ve been working on some OSC related stuff to make using it easier from both Actionscript 3 and Max/MSP.</p>
<p>First up is <a href="http://www.assembla.com/wiki/show/osclib">OSCLib</a>, this is intended as a low level set of OSC libraries which you can use in other applications. Actionscript 3 doesnt have UDP, only HTTP sockets whereas most OSC implementations (e.g. Reaktor, Bidule) are UDP based although one notable exception is <a href="http://supercollider.sourceforge.net/">SuperCollider</a> which supports both. So to help bridge the gap there are java implementations for both HTTP and UDP clients and servers (well, the UDP server is currently missing but should be done in a day or two..)</p>
<p>For Max/MSP there is an MXJ object which wraps the HTTP server so you can send messages from a Flash / Flex client directly to Max/MSP.</p>
<p>There is some documentation on the project wiki pages for getting your dev environment setup and also a Flash / Max demo you can try out.</p>
<p>As a side note if anyone has a Korg Kontrol49 then i&#8217;ve also got a project based on OSCLib for working with the Kontrol49 in native mode : <a href="http://www.assembla.com/wiki/show/kontroltools">KontrolTools</a>. This allows you to have full control of the lights and text displays via OSC as well as generate OSC message from all the knobs, sliders and buttons.</p>

<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=RV6MC0"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=RV6MC0" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919281" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2008/10/08/osc-open-sound-control/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2008%2F10%2F08%2Fosc-open-sound-control%2F</feedburner:awareness></item>
		<item>
		<title>Reaktor Sample Map Generator</title>
		<link>http://relivethefuture.com/choronzon/2008/01/15/reaktor-sample-map-generator/</link>
		<comments>http://relivethefuture.com/choronzon/2008/01/15/reaktor-sample-map-generator/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 17:10:35 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Other Places]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[reaktor]]></category>

		<category><![CDATA[sample map]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/2008/01/15/reaktor-sample-map-generator/</guid>
		<description><![CDATA[Reaktor is great, but one thing that i dont like about it is the built in sample management, you have to create these &#8217;sample maps&#8217; to use your own samples but the UI for it is a bit rubbish, like an awful version of kontakt. so i built a tool to generate map files automatically. [...]]]></description>
			<content:encoded><![CDATA[<p>Reaktor is great, but one thing that i dont like about it is the built in sample management, you have to create these &#8217;sample maps&#8217; to use your own samples but the UI for it is a bit rubbish, like an awful version of kontakt. so i built a tool to generate map files automatically. </p>
<p><strong>UPDATED</strong><br />
I&#8217;ve built a new version in Java which is tested and working on both Windows and OSX. You can download the app <a href="http://relivethefuture.com/code/MapFileBuilder.jar">here</a>.</p>
<p>I&#8217;ll put the source up soon when I get a spare minute.</p>
<p>comments, suggestions, modifications are all welcome.</p>
<p><strong>UPDATE 2</strong><br />
If you are wondering how to run a .jar file then you will need to first <a href="http://java.com/en/">download and install java</a> then you should then be able to just double-click the .jar file. If for some reason that doesnt work you can &#8216;Open With&#8230;&#8217; and then find where java is installed, somewhere like : C:/Program Files/Java/jre1.6.0_07/bin and choose the &#8216;javaw.exe&#8217; program.</p>

<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=gE5CNB"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=gE5CNB" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919282" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2008/01/15/reaktor-sample-map-generator/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2008%2F01%2F15%2Freaktor-sample-map-generator%2F</feedburner:awareness></item>
		<item>
		<title>MDK Recorded Live on that there internet radio</title>
		<link>http://relivethefuture.com/choronzon/2007/08/17/mdk-recorded-live-on-that-there-internet-radio/</link>
		<comments>http://relivethefuture.com/choronzon/2007/08/17/mdk-recorded-live-on-that-there-internet-radio/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 14:25:50 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Other Places]]></category>

		<category><![CDATA[mp3 download]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/2007/08/17/mdk-recorded-live-on-that-there-internet-radio/</guid>
		<description><![CDATA[Bit late I know, but you can download a recording of me playing live on the Silent Block show right here, right now
Its about 85 mb.
NOTE. I just updated the link because it was broken (15th Jan 2008)
]]></description>
			<content:encoded><![CDATA[<p>Bit late I know, but you can download a recording of me playing live on the Silent Block show <a href="http://relivethefuture.com/music/mdk/MDK-Live_Silent_Block_Show-17-06-2007.mp3">right here, right now</a></p>
<p>Its about 85 mb.</p>
<p>NOTE. I just updated the link because it was broken (15th Jan 2008)</p>

<p><map name="google_ad_map_0zp0oV2paxXJLtPWIClx703a-Ks_"><area shape="rect" href="http://imageads.googleadservices.com/pagead/imgclick/0zp0oV2paxXJLtPWIClx703a-Ks_?pos=0" coords="1,2,367,28"/><area shape="rect" href="http://services.google.com/feedback/abg" coords="384,10,453,23"/></map><img usemap="#google_ad_map_0zp0oV2paxXJLtPWIClx703a-Ks_" border="0" src="http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&client=ca-pub-4137879097083182&output=png&cuid=0zp0oV2paxXJLtPWIClx703a-Ks_&url=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2007%2F08%2F17%2Fmdk-recorded-live-on-that-there-internet-radio%2F"/></p>
<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=JOIUg5"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=JOIUg5" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919283" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2007/08/17/mdk-recorded-live-on-that-there-internet-radio/feed/</wfw:commentRss>
<enclosure url="http://relivethefuture.com/music/mdk/MDK-Live_Silent_Block_Show-17-06-2007.mp3" length="87245325" type="audio/mpeg" />
		<media:content url="http://relivethefuture.com/music/mdk/MDK-Live_Silent_Block_Show-17-06-2007.mp3" fileSize="87245325" type="audio/mpeg" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Bit late I know, but you can download a recording of me playing live on the Silent Block show right here, right now Its about 85 mb. NOTE. I just updated the link because it was broken (15th Jan 2008) </itunes:subtitle><itunes:author>MDK</itunes:author><itunes:summary>Bit late I know, but you can download a recording of me playing live on the Silent Block show right here, right now Its about 85 mb. NOTE. I just updated the link because it was broken (15th Jan 2008) </itunes:summary><itunes:keywords>MDK,Cristian,Vogel,electronic,techno,experimental,no,future,spandex,hand,on,the,plow,beckett,and,taylor,idm,music,house,drum,and,bass,jungle</itunes:keywords><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2007%2F08%2F17%2Fmdk-recorded-live-on-that-there-internet-radio%2F</feedburner:awareness></item>
		<item>
		<title>MDK Live on your internet radio.</title>
		<link>http://relivethefuture.com/choronzon/2007/06/14/mdk-live-on-your-internet-radio/</link>
		<comments>http://relivethefuture.com/choronzon/2007/06/14/mdk-live-on-your-internet-radio/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 07:16:53 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Other Places]]></category>

		<category><![CDATA[Reality]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/2007/06/14/mdk-live-on-your-internet-radio/</guid>
		<description><![CDATA[100% new and unreleased MDK. Make sure you tune in.

]]></description>
			<content:encoded><![CDATA[<p>100% new and unreleased MDK. Make sure you tune in.</p>
<p><img src="http://silent-block.org/frequency/2007-06-17-frequencyflyers.jpg"/></p>

<p><map name="google_ad_map_4N7rdQtSuavnaTiaArdmUldjRGU_"><area shape="rect" href="http://imageads.googleadservices.com/pagead/imgclick/4N7rdQtSuavnaTiaArdmUldjRGU_?pos=0" coords="1,2,367,28"/><area shape="rect" href="http://services.google.com/feedback/abg" coords="384,10,453,23"/></map><img usemap="#google_ad_map_4N7rdQtSuavnaTiaArdmUldjRGU_" border="0" src="http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&client=ca-pub-4137879097083182&output=png&cuid=4N7rdQtSuavnaTiaArdmUldjRGU_&url=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2007%2F06%2F14%2Fmdk-live-on-your-internet-radio%2F"/></p>
<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=bM1dff"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=bM1dff" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919284" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2007/06/14/mdk-live-on-your-internet-radio/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2007%2F06%2F14%2Fmdk-live-on-your-internet-radio%2F</feedburner:awareness></item>
		<item>
		<title>MDK - A Theme 12″ : OUT NOW!</title>
		<link>http://relivethefuture.com/choronzon/2007/01/28/mdk-a-theme-12-out-now/</link>
		<comments>http://relivethefuture.com/choronzon/2007/01/28/mdk-a-theme-12-out-now/#comments</comments>
		<pubDate>Sun, 28 Jan 2007 16:40:27 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Other Places]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/2007/01/28/mdk-a-theme-12-out-now/</guid>
		<description><![CDATA[You heard me. The brand new MDK 12&#8243; is ready and waiting for your love and attention courtesy of WeMe records.
Just click the record to grab your copy now.

Better hurry, theres only 300 copies.
You can check out a couple of the tracks by visiting the MDK MySpace page and the WeMe Myspace page
]]></description>
			<content:encoded><![CDATA[<p>You heard me. The brand new MDK 12&#8243; is ready and waiting for your love and attention courtesy of WeMe records.</p>
<p>Just click the record to grab your copy now.</p>
<p><a href="http://www.mewelesite.be/weme08.htm"><img src="http://www.mewelesite.be/images/weme08.jpg" alt="WeMe 08" /></a></p>
<p>Better hurry, theres only 300 copies.</p>
<p>You can check out a couple of the tracks by visiting the <a href="http://myspace.com/relivethefuture">MDK MySpace page</a> and the <a href="http://www.myspace.com/wemerecords">WeMe Myspace page</a></p>

<p><map name="google_ad_map_RlWnTdXItub-oTuj10oE8Sj7cgo_"><area shape="rect" href="http://imageads.googleadservices.com/pagead/imgclick/RlWnTdXItub-oTuj10oE8Sj7cgo_?pos=0" coords="1,2,367,28"/><area shape="rect" href="http://services.google.com/feedback/abg" coords="384,10,453,23"/></map><img usemap="#google_ad_map_RlWnTdXItub-oTuj10oE8Sj7cgo_" border="0" src="http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&client=ca-pub-4137879097083182&output=png&cuid=RlWnTdXItub-oTuj10oE8Sj7cgo_&url=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2007%2F01%2F28%2Fmdk-a-theme-12-out-now%2F"/></p>
<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=fvQlbN"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=fvQlbN" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919285" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2007/01/28/mdk-a-theme-12-out-now/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2007%2F01%2F28%2Fmdk-a-theme-12-out-now%2F</feedburner:awareness></item>
		<item>
		<title>Flash, file uploads, a 403 and mod_security</title>
		<link>http://relivethefuture.com/choronzon/2006/12/25/flash-file-uploads-a-403-and-mod_security/</link>
		<comments>http://relivethefuture.com/choronzon/2006/12/25/flash-file-uploads-a-403-and-mod_security/#comments</comments>
		<pubDate>Mon, 25 Dec 2006 22:03:35 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[403]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[mod_security]]></category>

		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/2006/12/25/flash-file-uploads-a-403-and-mod_security/</guid>
		<description><![CDATA[If, like me, you have just spent a good while pulling your hair wondering why your file upload from flash mysteriously return a 403 : access forbidden even though the url is accessible from the browser and you might have even gone to the trouble of building an html form to prove that the damn [...]]]></description>
			<content:encoded><![CDATA[<p>If, like me, you have just spent a good while pulling your hair wondering why your file upload from flash mysteriously return a 403 : access forbidden even though the url is accessible from the browser and you might have even gone to the trouble of building an html form to prove that the damn thing works. then, you might be running into a problem with mod_security.</p>
<p>The solution :</p>
<p>add this to a .htaccess file :</p>
<p>SecFilterEngine Off<br />
SecFilterScanPOST Off</p>

<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=QbQHyT"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=QbQHyT" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919286" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2006/12/25/flash-file-uploads-a-403-and-mod_security/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2006%2F12%2F25%2Fflash-file-uploads-a-403-and-mod_security%2F</feedburner:awareness></item>
		<item>
		<title>Yuletide Logs!</title>
		<link>http://relivethefuture.com/choronzon/2006/12/21/yuletide-logs/</link>
		<comments>http://relivethefuture.com/choronzon/2006/12/21/yuletide-logs/#comments</comments>
		<pubDate>Thu, 21 Dec 2006 12:06:03 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Other Places]]></category>

		<category><![CDATA[mp3 download]]></category>

		<category><![CDATA[christmas]]></category>

		<category><![CDATA[download]]></category>

		<category><![CDATA[logs]]></category>

		<category><![CDATA[mp3]]></category>

		<category><![CDATA[yuletide]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/2006/12/21/yuletide-logs/</guid>
		<description><![CDATA[Its jingly, its frosty, it rips off Tchaikovsky
The best christmas single ever, available to download FOR FREE from your favourites and mine. 
Pleated Lemon
]]></description>
			<content:encoded><![CDATA[<p>Its jingly, its frosty, it rips off Tchaikovsky</p>
<p>The best christmas single ever, available to download FOR FREE from your favourites and mine. </p>
<p><a href="http://www.pleatedlemon.com/2006/12/21/merry-christmarse/">Pleated Lemon</a></p>

<p><map name="google_ad_map_4kh6KDh89DLQHGhfoZbUTAcGYmY_"><area shape="rect" href="http://imageads.googleadservices.com/pagead/imgclick/4kh6KDh89DLQHGhfoZbUTAcGYmY_?pos=0" coords="1,2,367,28"/><area shape="rect" href="http://services.google.com/feedback/abg" coords="384,10,453,23"/></map><img usemap="#google_ad_map_4kh6KDh89DLQHGhfoZbUTAcGYmY_" border="0" src="http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&client=ca-pub-4137879097083182&output=png&cuid=4kh6KDh89DLQHGhfoZbUTAcGYmY_&url=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2006%2F12%2F21%2Fyuletide-logs%2F"/></p>
<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=gLwOuX"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=gLwOuX" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919287" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2006/12/21/yuletide-logs/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2006%2F12%2F21%2Fyuletide-logs%2F</feedburner:awareness></item>
		<item>
		<title>PixLib part 3. Abstract Factory</title>
		<link>http://relivethefuture.com/choronzon/2006/11/17/pixlib-part-3-abstract-factory/</link>
		<comments>http://relivethefuture.com/choronzon/2006/11/17/pixlib-part-3-abstract-factory/#comments</comments>
		<pubDate>Fri, 17 Nov 2006 20:19:58 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[PixLib]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[abstract factory]]></category>

		<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/2006/11/17/pixlib-part-3-abstract-factory/</guid>
		<description><![CDATA[Today I found yet another good reason to test PixLib (and I still have some others in mind that are to come, like removing all my dependencies on the mx.* packages)
To give a bit of background, the application im building is a drag-and-drop based story creator for schoolkids. Theres a stage onto which they can [...]]]></description>
			<content:encoded><![CDATA[<p>Today I found yet another good reason to test PixLib (and I still have some others in mind that are to come, like removing all my dependencies on the mx.* packages)</p>
<p>To give a bit of background, the application im building is a drag-and-drop based story creator for schoolkids. Theres a stage onto which they can add different types of things (aka artifacts) and move them around, scale, rotate etc.. Now most artifacts behave the same way, but some need special abilities, for example speech bubbles have text which can be edited &#8216;live&#8217; (i.e. inside the bubble not in a seperate text field) and there are other types of artifact with their own peculiarities. Each of these types of artifact inherits from one base class and its this base class which most of the application deals with. It doesnt need to know about the difference between a normal artifact and a speech bubble it just wants to keep a list of them, save and restore their state etc..</p>
<p>To attain this goal i have decided to use a factory to create the artifacts. A factory is just a class (or often a single method) that is used to create objects. If you havent heard of these then Wikipedia has some more information: <a href="http://en.wikipedia.org/wiki/Factory_method_pattern">Factory Method Pattern</a> and <a href="http://en.wikipedia.org/wiki/Abstract_factory_pattern">Abstract Factory</a></p>
<p>At creation time I know the type of the artifact I want (its a string property of an Artifact model object) and I need to create the corresponding UI object. I could code my own factory method or factory class and use a big if / else (or switch / case) construct to decide what to build depending on the artifact type but there has to be a better way. Enter PixLib&#8217;s AbstractFactory.</p>
<p>If you look at the <a href="http://www.get-url.net/pixlib/com_bourre_data_collections_AbstractFactory.html">API for AbstractFactory</a> its very minimal, the only public method is push (sKey:String, classConstructor:Function). This is used to register the types of objects I want to build.<br />
Now if you look at the source you will notice the more interesting method _buildInstance (much like the buildInstance from the HashCodeFactory from the previous post).<br />
Because its an AbstractFactory that means I have to make my own concrete subclass which will implement my factory method. I also need to register the types I want to create by their string identifiers.</p>
<p><em>(Its worth noting at this point that the PixLib AbstractFactory class doesnt play the exact role of the AbstractFactory class in the canonical AbstractFactory Pattern. It is &#8216;Abstract&#8217; because you create concrete subclasses and dont use it directly but unlike the usual AbstractFactory in the pattern it doesnt have the same interface as those subclasses, instead it provides a facility for dynamically linking identifiers to class constructors which the concrete subclasses can use to create objects.</p>
<p>If thats just made things even more confusing dont worry about it..)<br />
</em></p>
<p>First, I need to extend the Abstract Factory and register my types :</p>
<pre>
<code>class EditableObjectFactory extends AbstractFactory
{
    // private constructor for Singleton
    private function EditableObjectFactory()
    {
        super();
        // register artifact types
        push(Character.TYPE_ID,Character);
        push(SpeechBubble.TYPE_ID,SpeechBubble);
    }

...

}</code>
</pre>
<p>Then I can implement my factory method which looks a bit like this :</p>
<pre>
<code>public function createEditableObject(artifact:ArtifactModel,mc:MovieClip):EditableObject
{
    // Create instance according to artifact type (i.e. Character.TYPE_ID, SpeechBubble.TYPE_ID etc..)
    return _buildInstance(artifact.getType(),mc);
}</code>
</pre>
<p>Then the application code can just ask the EditableObjectFactory to create the appropriate item when a user requests a new artifact to be added to the stage. </p>
<p>Another benefit of this is that each of the 3 versions of the application can easily add their own custom artifact types. They each just register the type with EditableObjectFactory at startup and the rest happens like magic. <img src='http://relivethefuture.com/choronzon/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Another examples is available within PixLib. If  you look at the TweenFactory class in the com.bourre.transitions package you will see that it subclasses AbstractFactory to be able to create instances of Tween objects.</p>
<p>If you find yourself in the situation where you are dealing with a set of if / else or switch / case statements when you are creating objects then its definitely worth considering using a factory and encapsulating the creational process into its own class.</p>

<p><map name="google_ad_map_9JbwlqDXyeqo4f8JCVP5wHF2XDM_"><area shape="rect" href="http://imageads.googleadservices.com/pagead/imgclick/9JbwlqDXyeqo4f8JCVP5wHF2XDM_?pos=0" coords="1,2,367,28"/><area shape="rect" href="http://services.google.com/feedback/abg" coords="384,10,453,23"/></map><img usemap="#google_ad_map_9JbwlqDXyeqo4f8JCVP5wHF2XDM_" border="0" src="http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&client=ca-pub-4137879097083182&output=png&cuid=9JbwlqDXyeqo4f8JCVP5wHF2XDM_&url=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2006%2F11%2F17%2Fpixlib-part-3-abstract-factory%2F"/></p>
<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=spsWA8"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=spsWA8" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919288" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2006/11/17/pixlib-part-3-abstract-factory/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2006%2F11%2F17%2Fpixlib-part-3-abstract-factory%2F</feedburner:awareness></item>
		<item>
		<title>PixLib part 2. More configuration features and a ‘hidden’ gem.</title>
		<link>http://relivethefuture.com/choronzon/2006/11/15/pixlib-part-2-more-configuration-features-and-a-hidden-gem/</link>
		<comments>http://relivethefuture.com/choronzon/2006/11/15/pixlib-part-2-more-configuration-features-and-a-hidden-gem/#comments</comments>
		<pubDate>Wed, 15 Nov 2006 21:11:28 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[PixLib]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[open source]]></category>

		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[class factory]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/2006/11/15/pixlib-part-2-more-configuration-features-and-a-hidden-gem/</guid>
		<description><![CDATA[After the previous success of PixLib dealing with my configuration needs, today brought a new challenge, creating instances at runtime from string identifiers (aka Class Factories).
To complete part of the project im working on in a nice way I want to be able to create instances of UI classes at runtime, using their fully qualified [...]]]></description>
			<content:encoded><![CDATA[<p>After the previous success of PixLib dealing with my configuration needs, today brought a new challenge, creating instances at runtime from string identifiers (aka Class Factories).</p>
<p>To complete part of the project im working on in a nice way I want to be able to create instances of UI classes at runtime, using their fully qualified package names as identifiers. e.g. com.relivethefuture.ui.Stage.</p>
<p>The package names will be specified in the config file, but the class constructors need to be passed parameters which can&#8217;t be declared in the config as well.</p>
<p>IF the instances could be created without parameters then I could have used the config type called &#8216;class&#8217;. This would have meant that the framework would have done the hard work for me and created me an instance of the class specified.</p>
<p>When you are able to use this feature you can setup your config like this (note the quotes around the package name and any string arguments)</p>
<pre>
<code>&lt;config&gt;
    &lt;instance type="class"&gt;'com.mydomain.MyClass',23,12,'hi Mum'&lt;/instance&gt;
&lt;/config&gt;</code>
</pre>
<p>The interesting thing is whilst investigating the source code to see how PixLib creates the class instance I found a handy little utility function tucked away in the HashCodeFactory class (com.bourre.core.HashCodeFactory).</p>
<p>This class has a static method just for building instances, it looks like this : </p>
<p><code>public static function buildInstance(sPackage:String, aArgs:Array)</code></p>
<p>Exactly what I need.</p>
<p>I can just specify the class name in my config file </p>
<pre>
<code>&lt;config&gt;
  &lt;stage&gt;
    &lt;classname type="string"&gt;com.relivethefuture.ui.Stage&lt;/classname&gt;
  &lt;/stage&gt;
&lt;/config&gt;</code>
</pre>
<p>and when the time comes I just call the buildInstance method (note the parameters are supplied as an array)</p>
<p><code>stage = HashCodeFactory.buildInstance(Config.getInstance().stage.classname,[mc.mainStage]);</code></p>
<p>Magic.</p>
<p>Now, for those of you who are going to be creating classes from package names remember one vital thing. You *MUST* reference the class at some point in your code for the compiler to include it into the swf, otherwise you wont be able to create an instance. This is slightly unfortunate, but its easy enough to deal with, just add </p>
<p><code>static var myClass:com.mydomain.MyClass</code></p>
<p>to your main class (or in a seperate class that is just used as a placeholder to ensure the classes are imported) and you&#8217;re good to go.</p>

<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=0RSI08"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=0RSI08" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919289" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2006/11/15/pixlib-part-2-more-configuration-features-and-a-hidden-gem/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2006%2F11%2F15%2Fpixlib-part-2-more-configuration-features-and-a-hidden-gem%2F</feedburner:awareness></item>
		<item>
		<title>Getting to know PixLib</title>
		<link>http://relivethefuture.com/choronzon/2006/11/14/getting-to-know-pixlib/</link>
		<comments>http://relivethefuture.com/choronzon/2006/11/14/getting-to-know-pixlib/#comments</comments>
		<pubDate>Tue, 14 Nov 2006 14:57:59 +0000</pubDate>
		<dc:creator>MDK</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[PixLib]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[config loading]]></category>

		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://relivethefuture.com/choronzon/2006/11/14/getting-to-know-pixlib/</guid>
		<description><![CDATA[Theres more and more frameworks available for flash developers these days and choosing between them isnt easy, mainly because they all share one feature. No documentation. At least no documentation that you could read to understand what the framework is about unless you like reading API docs.
So, in an effort to get to know more [...]]]></description>
			<content:encoded><![CDATA[<p>Theres more and more frameworks available for flash developers these days and choosing between them isnt easy, mainly because they all share one feature. No documentation. At least no documentation that you could read to understand what the framework is about unless you like reading API docs.</p>
<p>So, in an effort to get to know more about them the only choice is to try and use them and write about what i find. Im going to start with PixLib as it does have API docs which gives a rough idea of the area it covers and its in active development.</p>
<p>I&#8217;ve got real world projects im working on which need some functionality which is available in PixLib. The choice is then, either code it myself or learn the PixLib way. Im going to try it with PixLib and see if it saves me time over the code-it-myself approach (which is what I normally do&#8230;I tried ARP before but didnt like the way it was structured so i coded my own micro-architecture which im happy with at the moment)</p>
<p>My first task for PixLib : Loading configuration files.</p>
<p>I need to load in a configuration file at the start of my application and have access to the configuration data throughout my app. I already have my own config file reader which I built it when i just needed a simple key => value mapping but its not good enough anymore.</p>
<p>A quick scan of the <a href="http://www.get-url.net/pixlib/">API docs</a> reveals a few interesting Classes : Config, ConfigLoader and ConfigLoaderEvent.</p>
<p>Looks like the ConfigLoader is a good place to start and theres a method there which unsurprisingly is called &#8216;load&#8217;.</p>
<p>I&#8217;ve already downloaded the PixLib source and unzipped it into my classpath, so now its time to investigate the source <img src='http://relivethefuture.com/choronzon/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The constructor of the ConfigLoader takes 2 arguments, an object called config which looks like it will be used to store the config and a deserializer to convert the xml to an object representation. But, before we jump in and start to create the loader one important thing you&#8217;ll notice about PixLib is that if you dont supply arguments then it uses sensible defaults. This is great as it saves a lot of wasted time which would be spent looking into other Classes to see how to build them and pass them in etc.</p>
<p>The next vital part of the puzzle is how do we know when the config has been parsed?</p>
<p>Back to the API docs and we can see the ConfigLoader has an onLoadInitEVENT which sounds just like what I need.</p>
<p>So the code i think i&#8217;ll need to load the config and get notification will look like this :</p>
<p><code>configLoader = new ConfigLoader();<br />
configLoader.addEventListener(ConfigLoader.onLoadInitEVENT,this,configLoaded);<br />
configLoader.load();</code></p>
<p><em>N.B. I have updated the above code because Francis (the creator of PixLib) kindly pointed out that PixLib automatically creates delegates when you register event listeners. So no need to use an external delegate factory. More bonus points for PixLib.</em></p>
<p>The ConfigLoader uses a url of &#8216;config.xml&#8217; by default (im always happy to favour convention) so no need to supply any arguments to the load method.</p>
<p>I&#8217;ve added my handler (configLoaded) so now I need to find out how to access my configuration data.</p>
<p>Back to the API, this time to the Config class. Looks like this is a Singleton so I can access it from anywhere and know its the same instance. So just a quick call Config.getInstance() and i&#8217;ve got access to my configuration data, converted from xml to a nice round object. Great.</p>
<p>As I said earlier I need a bit more structure in my config than just name - value pairs. Some items need to have properties, some just need to exist.</p>
<p>From looking at the source earlier I saw that the ConfigLoader uses an XMLToObjectDeserializer so im going to go and investigate what happens inside the deserializer.</p>
<p>Right at the top theres some calls to &#8216;addType&#8217; which seems to be used for mapping types to deserialization routines, but how do I specify those types in my config? (number, string, array among others)</p>
<p>A quick scan of the deserialize function shows</p>
<p><code>var dataType:String = node.attributes.type;</code></p>
<p>ah, so I use an attribute called &#8216;type&#8217; to declare the type of the node, and im guessing that the node value represents the node value (seems reasonable)</p>
<p>Time to edit my config.xml and see if the data comes through how I want it. Here&#8217;s what I have so far :</p>
<pre><code>&lt;config&gt;
  &lt;artifacts&gt;
    &lt;backgrounds&gt;
      &lt;size&gt;
        &lt;width type="number"&gt;477&lt;/width&gt;
        &lt;height type="number"&gt;277&lt;/height&gt;
      &lt;/size&gt;
    &lt;/backgrounds&gt;
  &lt;/artifacts&gt;
&lt;/config&gt;</code></pre>
<p>Then its just a quick check with some trace statements in the config load event handler and we&#8217;re done. </p>
<p><code>trace(Config.getInstance().artifacts.backgrounds.size.width);</p>
<p>Output : 477</code></p>
<p>Perfect.</p>
<p>How do I think PixLib stood up to the task overall?</p>
<p>It required a bit of investigation and API / source code reading to find out what I needed but it probably took a little less time than building my own AND is a lot more flexible than what I would have built in the time.<br />
Also the PixLib source code is clear and relatively easy to understand. The use of defaults is very well done and makes using the library pretty much painless.</p>
<p>Definitely a thumbs up.</p>
<p>A quick summary for those of you who cant be bothered to read everything.</p>
<p>1. Create a ConfigLoader and load your data</p>
<p><code>configLoader = new ConfigLoader();<br />
configLoader.addEventListener(ConfigLoader.onLoadInitEVENT,Delegate.create(this,configLoaded));<br />
configLoader.load();</code></p>
<p>2. Get the Config instance and use your data</p>
<p><code>mc._width = Config.getInstance().artifacts.backgrounds.size.width</code></p>

<p><a href="http://feeds.feedburner.com/~a/FrontAndBack?a=YUmtGJ"><img src="http://feeds.feedburner.com/~a/FrontAndBack?i=YUmtGJ" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/FrontAndBack/~4/415919290" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://relivethefuture.com/choronzon/2006/11/14/getting-to-know-pixlib/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=FrontAndBack&amp;itemurl=http%3A%2F%2Frelivethefuture.com%2Fchoronzon%2F2006%2F11%2F14%2Fgetting-to-know-pixlib%2F</feedburner:awareness></item>
	<copyright>MDK</copyright><media:credit role="author">MDK</media:credit><media:rating>nonadult</media:rating><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetFeedData?uri=FrontAndBack</feedburner:awareness></channel>
</rss>
