<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Storing an ActionScript Object class in SQLite with AIR</title>
	<atom:link href="http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/feed/" rel="self" type="application/rss+xml" />
	<link>http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/</link>
	<description>A blog about Web, Dev, Design, Fun and Food</description>
	<lastBuildDate>Tue, 28 Jun 2011 12:25:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Neil</title>
		<link>http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/comment-page-1/#comment-365</link>
		<dc:creator>Neil</dc:creator>
		<pubDate>Thu, 16 Sep 2010 08:22:07 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=255#comment-365</guid>
		<description>Thanks for sharing this info, just wondering why do you extend Object? I thought every class eventually extends Object in Actionscript.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing this info, just wondering why do you extend Object? I thought every class eventually extends Object in Actionscript.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/comment-page-1/#comment-360</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Mon, 05 Jul 2010 10:44:26 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=255#comment-360</guid>
		<description>Thanks for the heads-up on &lt;strong&gt;itemClass &lt;/strong&gt;Abhishek
That looks good but you need to have a table for each class, I&#039;m sure ill find more of a use for this one over registerClassAlias.</description>
		<content:encoded><![CDATA[<p>Thanks for the heads-up on <strong>itemClass </strong>Abhishek<br />
That looks good but you need to have a table for each class, I&#8217;m sure ill find more of a use for this one over registerClassAlias.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhishek</title>
		<link>http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/comment-page-1/#comment-358</link>
		<dc:creator>Abhishek</dc:creator>
		<pubDate>Sun, 04 Jul 2010 19:40:05 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=255#comment-358</guid>
		<description>Sam, have you tried using the itemClass property of a SQLStatement? That does most of the work for you. 

http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/data/SQLStatement.html#itemClass</description>
		<content:encoded><![CDATA[<p>Sam, have you tried using the itemClass property of a SQLStatement? That does most of the work for you. </p>
<p><a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/data/SQLStatement.html#itemClass" rel="nofollow">http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/data/SQLStatement.html#itemClass</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sharedtut</title>
		<link>http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/comment-page-1/#comment-251</link>
		<dc:creator>Sharedtut</dc:creator>
		<pubDate>Wed, 03 Feb 2010 14:20:57 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=255#comment-251</guid>
		<description>Great job, thank you for sharing.</description>
		<content:encoded><![CDATA[<p>Great job, thank you for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Hassan</title>
		<link>http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/comment-page-1/#comment-217</link>
		<dc:creator>Sam Hassan</dc:creator>
		<pubDate>Fri, 22 Jan 2010 11:22:26 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=255#comment-217</guid>
		<description>Thanks Andrew,

This is just a little example and not how I usually code, normally I would have a Database controller handling the setup and another class or several classes dealing with the service methods.

I’m always appreciative of your knowledge :)
I like this letter: http://writing.bryanwoods4e.com/</description>
		<content:encoded><![CDATA[<p>Thanks Andrew,</p>
<p>This is just a little example and not how I usually code, normally I would have a Database controller handling the setup and another class or several classes dealing with the service methods.</p>
<p>I’m always appreciative of your knowledge <img src='http://samhassan.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I like this letter: <a href="http://writing.bryanwoods4e.com/" rel="nofollow">http://writing.bryanwoods4e.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/comment-page-1/#comment-213</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Thu, 21 Jan 2010 10:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=255#comment-213</guid>
		<description>Good post.
A pattern that follows from this is the Repository pattern.. as your application grows your Controller class is in danger of overgrowing with data storage logic, so a way to separate this out would be to create a DaveRepository class, as in:

public class DaveRepository extends Object
{
    private var _database : SQLConnection;
    public function DaveRepository(Database : SQLConnection) : void {
        registerClassAlias(&quot;DataVO&quot;, DataVO);
        this._database = Database;
    }

    public function Add(daveVO : DaveVO) {
        // ... database logic here
    }

    public function All() {
        ...
    }

    .. etc
}

Then your controller just looks like this:

public class Controller extends MovieClip
{
    private var theDB : SQLConnection
    public function Controller()
    {
         theDB = new SQLConnection(); // etc etc
    }

   public function SaveDave()
   {
        DaveVO dave = new DaveVO();
        dave.name = &quot;dave&quot;;
        dave.number = randRange(0,100);

        new DaveRepository(theDB).Add(dave);
   }
}

Makes your controller much lighter. Pays to move all your DB connection logic into a single class too and have all your repository classes accept a DB connection class in the constructor.

:)</description>
		<content:encoded><![CDATA[<p>Good post.<br />
A pattern that follows from this is the Repository pattern.. as your application grows your Controller class is in danger of overgrowing with data storage logic, so a way to separate this out would be to create a DaveRepository class, as in:</p>
<p>public class DaveRepository extends Object<br />
{<br />
    private var _database : SQLConnection;<br />
    public function DaveRepository(Database : SQLConnection) : void {<br />
        registerClassAlias(&#8220;DataVO&#8221;, DataVO);<br />
        this._database = Database;<br />
    }</p>
<p>    public function Add(daveVO : DaveVO) {<br />
        // &#8230; database logic here<br />
    }</p>
<p>    public function All() {<br />
        &#8230;<br />
    }</p>
<p>    .. etc<br />
}</p>
<p>Then your controller just looks like this:</p>
<p>public class Controller extends MovieClip<br />
{<br />
    private var theDB : SQLConnection<br />
    public function Controller()<br />
    {<br />
         theDB = new SQLConnection(); // etc etc<br />
    }</p>
<p>   public function SaveDave()<br />
   {<br />
        DaveVO dave = new DaveVO();<br />
        dave.name = &#8220;dave&#8221;;<br />
        dave.number = randRange(0,100);</p>
<p>        new DaveRepository(theDB).Add(dave);<br />
   }<br />
}</p>
<p>Makes your controller much lighter. Pays to move all your DB connection logic into a single class too and have all your repository classes accept a DB connection class in the constructor.<br />
 <img src='http://samhassan.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

