<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Words, punctuated &#187; Application Design</title>
	<atom:link href="http://probertson.com/articles/category/application-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://probertson.com</link>
	<description>Thoughts on web development, user-centered design, code, etc. by Paul Robertson</description>
	<lastBuildDate>Mon, 30 Aug 2010 16:38:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Thoughts on multi-screen, multi-context app development</title>
		<link>http://probertson.com/articles/2010/02/09/thoughts-on-multi-screen-context-app-development/</link>
		<comments>http://probertson.com/articles/2010/02/09/thoughts-on-multi-screen-context-app-development/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 01:00:58 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[Contextual design]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Multi-screen]]></category>
		<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[User-centered design]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=372</guid>
		<description><![CDATA[Around 8 months ago I was asked to start thinking about the now emerging (particularly from a Flash Platform perspective) world of multi-screen application development. What are issues to consider? What guidance should we offer?
It turns out that my thinking on that topic isn&#8217;t going to become anything in the Adobe documentation. So I&#8217;ve sort [...]]]></description>
			<content:encoded><![CDATA[<p>Around 8 months ago I was asked to start thinking about the now emerging (particularly from a Flash Platform perspective) world of multi-screen application development. What are issues to consider? What guidance should we offer?</p>
<p>It turns out that my thinking on that topic isn&#8217;t going to become anything in the Adobe documentation. So I&#8217;ve sort of just been sitting on my ideas with the idea that someday I&#8217;ll probably share them.</p>
<p>Which brings me to this post.</p>
<h2>Aside: upcoming presentations on multi-screen development</h2>
<p>This is really a side note to the main ideas here, but I thought I&#8217;d mention it since it&#8217;s the reason I actually stopped to write this. In one of my mind-wandering moments this morning, I realized that at the upcoming <a href="http://360flex.com/">360|Flex conference (San Jose, March 7-10)</a> I&#8217;ll be involved in two presentations that are directly related to practical aspects of building multi-screen apps:</p>
<ul>
<li>
<p>As part of the pre-conference free training, <a href="http://joelhooks.com/">Joel Hooks</a> and I are doing a four-hour training on using the <a href="http://robotlegs.org/">Robotlegs micro-architecture</a>. (Joel is the main speaker, fortunately, because he&#8217;s one of the core Robotlegs developers and the main &#8220;evangelist.&#8221; I&#8217;ll be helping out, to try and help save his voice and maybe to help find typos. =)</p>
<p>If you&#8217;re wondering what a Robotlegs session has to do with multi-screen apps&#8230;keep reading, it&#8217;s explained below.</p>
</li>
<li>On Tuesday and Wednesday, <a href="http://renaun.com/">Renaun Erickson</a> and I are giving (two separate) presentations about building iPhone apps using Flash Platform tools. My session is more of an intro into the workflow, how it&#8217;s similar to other app building, and how it&#8217;s different. (Plenty of code to look at &#8212; don&#8217;t worry!) Renaun is going to get more into specifics of building a game, as well as some more intermediate/advanced topics like performance.</li>
</ul>
<p>Funny that I never really made that connection until this morning. I guess subconsciously I knew this is a direction I want to move in, and that&#8217;s why I&#8217;ve been focusing my learning (and hence my presenting) on these topics =)</p>
<h2>Background</h2>
<p>While I was partially trying to keep my thinking abstract, from a practical perspective I centered my thoughts around developing using the Flash Platform. So conceptually, what I was thinking about was the idea of making a single &#8220;app&#8221; for multiple screens, which would mean that (in the technology of the next year or so) it could be potentially take several forms:</p>
<ul>
<li>a browser/computer app (Flash Player)</li>
<li>a browser/mobile app (Flash Player)</li>
<li>a desktop app (AIR)</li>
<li>a mobile (iPhone) app (Publisher for iPhone, similar to AIR)</li>
<li>a mobile app for other devices (AIR)</li>
<li>a TV app or widget (<a href="http://tv.adobe.com/watch/max-2009-design/flash-for-the-digital-home-flash-on-tv/">Flash for the digital home</a>)
</ul>
<p>(Obviously many of these are only out in public beta, some have only been vaguely publicly acknowledged, and others may or may not ever exist as actual Adobe products =)</p>
<h2>One app, or many?</h2>
<p>Back when I started thinking about this, there seemed to be two main camps. One group was a strong advocate for the &#8220;single source&#8221; idea: you would build one SWF or one AIR app and distribute that same app on any platforms (desktop/mobile/TV). Obviously a key element to that, especially for desktop/mobile apps rather than browser apps, would be having code that detects screen size and device capabilities and adapts the UI to the device.</p>
<p>The second group felt that it was more likely that developers who are creating an app for multiple screens would actually create multiple apps (from the perspective of the IDE). The apps would obviously share some code, visual assets, etc., but would be different enough that they&#8217;d be created separately and distributed as separate file types. (In the case of apps created for the iPhone, of necessity this has to be true, at least in terms of the publishing part.)</p>
<p>Since I try to be pragmatic about things unless I have a <em>really</em> good reason, I favored the second viewpoint. However, I acknowledge that in some circumstances the first approach might be used. As always, I think that developers are going to use a mix of approaches.</p>
<p>For example, suppose I&#8217;m building an app and I want to create a version for desktop computers, a version for the iPhone, and a version for other mobile devices. Personally I see this not just as an issue of &#8220;porting&#8221; the app from one platform to another. I think that each device has its strengths, and more importantly, each device is used for different purposes and in different contexts. If I&#8217;m building an app for a device, I should definitely be <a href="http://blog.digitalbackcountry.com/2009/10/introducing-contextual-applications/">taking that notion of context into account</a> as I&#8217;m designing the app. That pretty much rules out the possibility of using the exact same app (UI and everything) for both computers and mobile devices, unless I want it to run as a widget-type app on the desktop.</p>
<p class="editornote">Also see: <a href="http://www.adobe.com/devnet/flashplatform/context_apps/">Adobe Flash Platform contextual applications developer center</a></p>
<h2>Adaptable code to the rescue</h2>
<p>On the other hand, that doesn&#8217;t mean that developers will always create completely separate projects. For example, suppose I&#8217;m creating an app for iPhone, and another for another mobile device. Or perhaps I&#8217;m using the Publisher for iPhone to create an iPhone version of my app and an iPad version. If my app is a game where I can more freely discard the conventions of the platforms, perhaps the only platform difference I need to consider is the difference in screen dimensions and pixel density. In that case, it&#8217;s quite possible that I can <a href="http://www.adobe.com/devnet/flash/articles/authoring_for_multiple_screen_sizes.html"use the same source code and have it adapt to the different screen sizes</a>.</p>
<h2>Frameworks to the rescue</h2>
<p>Even for a more line-of-business or productivity app, one of the key ideas in <a href="http://tv.adobe.com/watch/max-2009-develop/preview-flex-for-mobile-devices/">Slider</a>, the future <a href="http://flashmobile.scottjanousek.com/2010/02/12/adobe-flex-for-mobile-whitepaper/">Flex mobile framework</a>, is to (as much as possible) abstract away platform convention differences. For example, if iPhone usually puts the back button on the top, and another platform puts it on the bottom, and another platform puts it in a menu, and another platform has it assigned to a physical button on the device, then Slider might have a &#8220;back&#8221; event that you can hook into, and you can make your app perform the necessary &#8220;back&#8221; tasks regardless of platform.</p>
<h2>Design patterns to the rescue</h2>
<p>And, of course, in some situations you&#8217;ll almost surely need to create different versions of apps for different screens. For example, suppose you&#8217;re building a desktop Twitter client and a mobile Twitter client. Chances are good you&#8217;ll put some functionality into the desktop version that doesn&#8217;t go into the mobile one &#8212; such as previewing images, or maybe Facebook integration. On the other hand, adding a feature like automatic location tagging would make lots of sense in the mobile version, but not so much in the desktop one.</p>
<p>As I was thinking, many months ago, about the idea of efficiently creating different versions of the same app for different devices, a thought hit me like a ton of bricks. This is exactly the use case that the oft-mentioned &#8220;separation of concerns&#8221; is designed for:</p>
<p>Over several years, various &#8220;micro architectures&#8221; and &#8220;application frameworks&#8221; have emerged and waxed and waned in popularity. Many of these architectures are modeled around the &#8220;<a href="http://en.wikipedia.org/wiki/Model-view-controller">Model-View-Controller</a>&#8221; design pattern (or its many variations).</p>
<p>One of the key benefits that these architectures claim is that it helps you keep the pieces of your application separate, without explicit links and dependencies between them. I&#8217;ve looked into and even tried out several of these over the years. One example that is frequently used to describe the notion of separation of concerns, which I always struggled with, goes something like this:</p>
<blockquote><p>
Suppose you&#8217;re creating an app, and you build the user interface and the other logic like server communication and data processing. If you use MVC/separation of concerns, then it&#8217;s really easy to just rip out your whole user interface layer and replace it with a new one.
</p></blockquote>
<p>They usually lost me with that one. As much as I tried, I couldn&#8217;t imagine a situation in which I&#8217;d want to build my app and then just rip out the UI and replace it with a different one <a id="note1src" class="footnote" href="#note1">note 1</a>.</p>
<p>Until now.</p>
<p>Suddenly I had discovered, for myself at least, a real-world use case for the separation-of-concerns-so-you-can-swap-out-the-UI argument. If I&#8217;m building an app for the desktop and mobile, I&#8217;d like to be able to reuse my code where I can. At the same time, some functionality is only going to apply to one app or the other, so it&#8217;d be nice to be able to plug it in cleanly. Oh and by the way, the user interfaces are going to be different, so being able to swap those out is an absolute must.</p>
<p>I&#8217;d always liked micro-architectures in general, if only because I like knowing that I&#8217;m building my app using some pattern or structure that is based on developers&#8217; real-world experience. It&#8217;s much nicer than trying to invent it myself and having to deal with all the pain points they&#8217;ve already gotten over. Now that I am imagining a world where I create multiple versions of the same app, with similar functionality but different user interfaces, suddenly micro-architecture patterns have become indispensable in my mind.</p>
<h2>Conclusion</h2>
<p>These are only just a few of my thoughts about the future world of multi-screen, contextual applications. Like Lee Brimelow, I believe that going forward <a href="http://theflashblog.com/?p=1743">building multi-screen, multi-context apps is going to be a much more common scenario</a>. From my perspective as someone who thinks a lot about user experience design, and trying to optimize tools for the task and context, I think this is one of the most exciting aspects of the current technology revolution. I&#8217;ll definitely continue to share my thoughts and ideas in the future (hopefully more practical ones, too, not just abstract ones like this =)</p>
<h2>Notes</h2>
<p class="footnote" id="note1">Note 1: Just to be clear, I&#8217;m not trying to sound negative about MVC or micro-architectures/frameworks. Most of them provide many benefits, many of which are also related to the idea of separation of concerns, such as making code easier to test, making code cleaner, reducing boilerplate code, providing structure so that teams or developers who inherit a project can get going more quickly, etc. Swapping out the view layer is just one little benefit they mention. (<a href="#note1src">back</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2010/02/09/thoughts-on-multi-screen-context-app-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New project: AIR SQLite utilities</title>
		<link>http://probertson.com/articles/2010/02/03/new-project-air-sqlite-utilities/</link>
		<comments>http://probertson.com/articles/2010/02/03/new-project-air-sqlite-utilities/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 20:44:55 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[local SQL database]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=367</guid>
		<description><![CDATA[I&#8217;m excited to announce that I&#8217;m &#8220;officially&#8221; releasing a new open-source project that I&#8217;ve been using on personal and work projects for over a year.
For lack of a better name, I call it my &#8220;AIR SQLite utility library&#8221;
The code currently contains one major piece of functionality (well, two different variations on one bit of functionality), [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m excited to announce that I&#8217;m &#8220;officially&#8221; releasing a new open-source project that I&#8217;ve been using on personal and work projects for over a year.</p>
<p>For lack of a better name, I call it my &#8220;<a href="/projects/air-sqlite/">AIR SQLite utility library</a>&#8221;</p>
<p>The code currently contains one major piece of functionality (well, two different variations on one bit of functionality), which is a SQL &#8220;query runner&#8221; library. This is a wrapper for the AIR SQL classes that allows you to run a SQL statement by just passing a few bits of information:</p>
<ul>
<li>The text of the SQL statement itself</li>
<li>An object containing properties with the values for any statement parameters in the SQL</li>
<li>A Function to call when the operation completes</li>
<li>A failure Function</li>
<li>(optionally) a class to use as the data type for the data returned from a <code>SELECT</code> statement</li>
</ul>
<p>The library does all the work of creating SQLStatement objects and caching prepared queries, as well as pooling SQLConnection instances so you can execute multiple statements simultaneously. It also has a variation that allows you to specify a &#8220;batch&#8221; of statements to execute, and they are executed in order in a transaction.</p>
<p>I&#8217;ve also got an additional utility to add to the library. It&#8217;s a &#8220;database copy&#8221; utility that allows you to create a &#8220;deep copy&#8221; of a database &#8212; all it&#8217;s tables, views, etc. &#8212; with or without data. The key reason why this is useful is that you can use it to create an encrypted database from an unencrypted database (and vice-versa). It&#8217;s written and tested, but I decided to modify the structure slightly before releasing it, so it&#8217;s not checked in yet.</p>
<p>I&#8217;ve put the details about how it works and why it&#8217;s designed that way in <a href="/projects/air-sqlite/">the project page</a>. In case you&#8217;ve ever wondered how I design apps, I think the examples and this library give some insight into how I actually do my database-driven AIR app development. At least, how I structure the data-access part of my apps.</p>
<p>On (another) personal note, this project is also my first project that I&#8217;ve posted to <a href="http://github.com/probertson">my Github repository</a> (as opposed to projects I&#8217;ve forked). It was actually posted-but-not-advertised on Google code for a month or so, but I decided to move to Github because the collaboration and checkin-without-network-connection features are so awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2010/02/03/new-project-air-sqlite-utilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Adobe AIR data privacy and security&#8221; - slides, notes, links</title>
		<link>http://probertson.com/articles/2009/06/09/adobe-air-data-privacy-and-security-slides-notes-links/</link>
		<comments>http://probertson.com/articles/2009/06/09/adobe-air-data-privacy-and-security-slides-notes-links/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 17:03:48 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Privacy/security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[local SQL database]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=279</guid>
		<description><![CDATA[On May 20, 2009 at the 360&#124;Flex conference in Indianapolis I gave a presentation titled &#8220;Adobe AIR data privacy and security.&#8221; As I always do (and after a bit of a delay), here are the slides from my presentation. I&#8217;ve added fairly lengthy notes to the slides (I had to make the font smaller so [...]]]></description>
			<content:encoded><![CDATA[<p>On May 20, 2009 at the 360|Flex conference in Indianapolis I gave a presentation titled &#8220;Adobe AIR data privacy and security.&#8221; As I always do (and after a bit of a delay), here are the slides from my presentation. I&#8217;ve added fairly lengthy notes to the slides (I had to make the font smaller so they&#8217;d fit on the pages) so it&#8217;s more than just bullet points.</p>
<p><a href="/resources/2009/06/09/air-data-privacy-security-slides-links.zip">Adobe AIR data privacy and security slides, notes, and links</a> (1 MB .zip)</p>
<p>As a side note for those who actually attended the presentation, in retrospect I think I over-emphasized the security concerns and didn&#8217;t emphasize enough that there are plenty of use cases for which AIR is definitely secure &#8212; especially in the case where you need to keep the user&#8217;s private data secure. Hopefully the notes that accompany the slides help to clarify this somewhat.</p>
<p>I also used and referred to a number of resources in my presentation, which are listed below. The download .zip with the slides also includes an html page with all these links.</p>
<h2>Introduction</h2>
<ul>
<li>&quot;<a href="http://tv.adobe.com/#vi+f15384v1025">Maintaining security with Adobe AIR</a>&quot; by Ethan Malasky and Peleus Uhley (Adobe MAX 2008)</li>
</ul>
<h2>Background</h2>
<ul>
<li>&quot;<a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7fa3.html">AIR security</a>&quot; (Adobe AIR documentation)</li>
<li>&quot;<a href="http://blogs.adobe.com/simplicity/2009/03/why_air_does_not_include_your_favorite_feature.html">Why Adobe AIR Doesn&#8217;t (Yet) Include the Feature You Most Want</a>&quot; by Oliver Goldman</li>
<li>&quot;<a href="http://tv.adobe.com/#vi+f15384v1102">Understanding the Flash Player Security Model</a>&quot; by Deneb Meketa (Adobe MAX 2008)</li>
<li>&quot;<a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS34990ABF-C893-47ec-B813-9C9D9587A398.html">Considerations for using encryption with a database</a>&quot; (Adobe AIR documentation)</li>
<li>&quot;<a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118676a5be7-8000.html">Using digital rights management</a>&quot; (Adobe AIR documentation)</li>
<li>Operating system security (user and &quot;admin&quot; rights)
<ul>
<li>&quot;<a href="http://blogs.adobe.com/simplicity/2009/04/what_are_administrative_rights.html">What are Adminstrative Rights, Anyway?</a>&quot; by Oliver Goldman</li>
<li>&quot;<a href="http://blogs.adobe.com/simplicity/2009/04/does_installing_an_air_app_require_admin_rights.html">Does Installing an AIR Application Require Admin Rights?</a>&quot; by Oliver Goldman</li>
</ul>
</li>
<li>Source code visibility
<ul>
<li><a href="http://www.buraks.com/asv/">Action Script Viewer (ASV)</a></li>
<li>&quot;<a href="http://www.gotoandlearn.com/play?id=70">Ethical SWF Decompiling</a>&quot; by Lee Brimelow</li>
<li><a href="http://www.nitrolm.com/home">Nitro-LM</a></li>
</ul>
</li>
<li>Encryption: ActionScript  crypto libraries:
<ul>
<li><a href="http://code.google.com/p/as3crypto/">as3crypto</a></li>
<li><a href="http://labs.adobe.com/wiki/index.php/Alchemy:Libraries">OpenSSL (partially) cross-compiled to ActionScript</a> using <a href="http://labs.adobe.com/technologies/alchemy/">Alchemy</a></li>
</ul>
</li>
</ul>
<h2>AIR application installation</h2>
<ul>
<li>Sign your app with a trusted cert
<ul>
<li>&quot;<a href="http://www.ddj.com/architect/210004209">Code Signing in Adobe AIR</a>&quot; by Oliver Goldman</li>
<li>&quot;<a href="http://www.stage.adobe.com/devnet/air/articles/signing_air_applications.html">Digitally signing Adobe AIR applications</a>&quot; by Todd Prekaski</li>
<li>Promotion: get a free signing certificate (while supplies last) by submitting your app to the <a href="http://www.adobe.com/go/airmarketplace">Adobe AIR marketplace</a></li>
</ul>
</li>
<li>Plan for updates
<ul>
<li>&quot;<a href="http://www.adobe.com/devnet/air/articles/tips_building_air_apps.html">Building AIR applications that can be easily updated</a>&quot; by David Deraedt</li>
<li>&quot;<a href="http://www.adobe.com/devnet/air/flex/quickstart/update_framework.html">Using the Adobe AIR update framework</a>&quot; Quick Start article by Jeff Swartz (Adobe AIR documentation)</li>
</ul>
</li>
</ul>
<h2>Modular applications</h2>
<ul>
<li>Sandbox bridge
<ul>
<li>&quot;<a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7e5c.html">Scripting between content in different domains</a>&quot; (Adobe AIR documentation)</li>
</ul>
</li>
<li>XML signature validation
<ul>
<li>&quot;<a href="http://www.adobe.com/devnet/air/flex/quickstart/xml_signatures.html">Creating and validating XML signatures</a>&quot; by Joe Ward</li>
<li>&quot;<a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WSe3d2d529026165536d4beb2c11c33737198-8000.html">Using the XML signature validation classes</a>&quot; (Adobe AIR documentation)</li>
<li>&quot;<a href="http://livedocs.adobe.com/flex/3/langref/index.html?flash/security/package-detail.html&amp;flash/security/class-list.html">flash.security package</a>&quot; reference (Adobe AIR documentation)</li>
</ul>
</li>
</ul>
<h2>Local shared objects</h2>
<p>[No links]</p>
<h2>Encrypted Local Store</h2>
<ul>
<li>&quot;<a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7e31.html">Storing encrypted data</a>&quot; (Adobe AIR documentation)</li>
<li>&quot;<a href="http://livedocs.adobe.com/flex/3/langref/index.html?flash/data/EncryptedLocalStore.html&amp;flash/data/class-list.html">EncryptedLocalStore class</a>&quot; reference (Adobe AIR documentation)</li>
</ul>
<h2>Local files</h2>
<p>[No links]</p>
<h2>Local SQL database (SQLite)</h2>
<ul>
<li>SQL injection attack
<ul>
<li>&quot;<a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7d42.html">Using parameters in statements</a>&quot; (Adobe AIR documentation)</li>
<li>&quot;<a href="http://livedocs.adobe.com/flex/3/langref/index.html?flash/data/SQLStatement.html#parameters&amp;flash/data/class-list.html">SQLStatement.parameters property</a>&quot; reference (Adobe AIR documentation)</li>
</ul>
</li>
<li>Encrypted database
<ul>
<li>&quot;<a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS8AFC5E35-DC79-4082-9AD4-DE1A2B41DAAF.html">Using encryption with SQL databases</a>&quot; (Adobe AIR documentation)</li>
<li>&quot;<a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS44EC31A7-61B1-4e0a-8C61-D720AA95DE03.html">Using the EncryptionKeyGenerator class to obtain a secure encryption key</a>&quot; (Adobe AIR documentation)</li>
<li><a href="http://code.google.com/p/as3corelib/">as3corelib project</a> (includes the EncryptionKeyGenerator class and hashing algorithms</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2009/06/09/adobe-air-data-privacy-and-security-slides-notes-links/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A useful tool, the joy of shipping code, and a great developer</title>
		<link>http://probertson.com/articles/2009/03/12/useful-tool-joy-of-shipping-code/</link>
		<comments>http://probertson.com/articles/2009/03/12/useful-tool-joy-of-shipping-code/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 18:23:09 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[local SQL database]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=240</guid>
		<description><![CDATA[If you use David Deraedt&#8217;s great AIR SQLite administration tool Lita, you probably already saw that he just pushed an update (v. 1.2) a few days ago. Aside from my general happiness from seeing that this release fixes some bugs and adds new features that were important to me, this release has personal significance for [...]]]></description>
			<content:encoded><![CDATA[<p>If you use <a href="http://www.dehats.com/">David Deraedt</a>&#8217;s great <a href="http://www.dehats.com/drupal/?q=node/58">AIR SQLite administration tool Lita</a>, you probably already saw that he just pushed an update (v. 1.2) a few days ago. Aside from my general happiness from seeing that this release fixes some bugs and adds new features that were important to me, this release has personal significance for me as well. As David <a href="http://www.dehats.com/drupal/?q=node/75">noted last week</a>, I have joined him as a contributor to the project. So in fact, some of those bug fixes and new features were done by me! I&#8217;ve discovered that there are few feelings greater than wanting a feature in a tool you use every day, and then actually implementing it. =) Upgrading is more fun when you see your own bugs in the release notes, too =)</p>
<p>As David pointed out, the fact that I&#8217;m an Adobe employee and am participating in the project doesn&#8217;t mean it&#8217;s now an official Adobe product (for good or bad). I&#8217;m doing this 100% on my own time. And my role is still pretty small &#8212; David is certainly the lead, main, primary, controlling, etc. author. I just file bugs as I find them, add some comments about feature requests, and fix issues when I know how to.</p>
<p>In case you&#8217;re curious, the back story is really pretty straightforward. I started writing my own version of an AIR SQLite admin tool back before AIR beta 1, but never had time to take it beyond a &#8220;query runner&#8221; tool. Late in 2008 I discovered Lita, and once I started using it I realized that 1) it is implemented in a similar way to many of the ideas I had, and 2) It&#8217;s already got a big head start in features, so there&#8217;s not much point in me trying to &#8220;compete&#8221; or anything like that, especially for something that I wasn&#8217;t planning to make money from.</p>
<p>After using it for a while I discovered a few bugs, and decided to email David about them. (He and I had communicated a bit previously, about the <a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS8AFC5E35-DC79-4082-9AD4-DE1A2B41DAAF.html">encrypted database functionality added in Adobe AIR 1.5</a> and how to integrate it into Lita.) I think I probably mentioned in that message that I would be willing/interested to fix issues myself as I have time. Fortunately David was very kind and accepted my offer. So, as I said, now when I find issues I get to fix them myself, which is nice because I can fix them quickly, but also adds some responsibility since now the burden is on me to make those changes myself =)</p>
<p>As a side note, I really want to point out that David is a really great developer &#8212; something I appreciate greatly as we work in the same codebase. It is a big testament to his architectural and coding skills that I was able to dive right in and fix four bugs/feature requests in a very short time (literally a matter of minutes after first looking at the code). I&#8217;ve learned a lot just from seeing his code, and now I&#8217;m anxious to read his <a href="http://www.dehats.com/drupal/?q=node/32">&#8220;Flex Architecture Fundamentals&#8221; series</a> to learn more about the thinking behind the great code.</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2009/03/12/useful-tool-joy-of-shipping-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating more secure SWF applications</title>
		<link>http://probertson.com/articles/2008/01/03/creating-more-secure-swf-applications/</link>
		<comments>http://probertson.com/articles/2008/01/03/creating-more-secure-swf-applications/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 23:02:45 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2008/01/03/creating-more-secure-swf-applications/</guid>
		<description><![CDATA[If you&#8217;re like me and you&#8217;ve been heads-down in work or just getting through the pre/post-Christmas season, you may have missed the article &#8220;Creating more secure SWF web applications&#8221; by Peleus Uhley, that was posted on the Adobe Developer Center on Dec. 20.
In spite of the bad timing, it&#8217;s a nice, thorough article that gives [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me and you&#8217;ve been heads-down in work or just getting through the pre/post-Christmas season, you may have missed the article &#8220;<a href="http://www.adobe.com/devnet/flashplayer/articles/secure_swf_apps.html">Creating more secure SWF web applications</a>&#8221; by Peleus Uhley, that was posted on the Adobe Developer Center on Dec. 20.</p>
<p>In spite of the bad timing, it&#8217;s a nice, thorough article that gives a good view of things that we can do to make our apps more secure, in addition to security updates that Adobe continues to make to Flash Player.</p>
<p>(via email from Jeff Swartz)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2008/01/03/creating-more-secure-swf-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Worth watching: Flex application frameworks presentations</title>
		<link>http://probertson.com/articles/2007/10/18/flex-application-frameworks-presentations/</link>
		<comments>http://probertson.com/articles/2007/10/18/flex-application-frameworks-presentations/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 16:49:08 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/10/18/flex-application-frameworks-presentations/</guid>
		<description><![CDATA[Last week I posted some of my thoughts on the future of Flex application frameworks, which were my take-aways from the October Silicon valley Flex user&#8217;s group (a.k.a. &#8220;SilvaFUG&#8221;) users group meeting. In that post I strongly recommended watching the recordings of the presentations. The recordings are available now, so once again I highly recommend [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I posted some of <a href="/articles/2007/10/12/flex-frameworks-future/">my thoughts on the future of Flex application frameworks</a>, which were my take-aways from the October <a href="http://www.silvafug.org/">Silicon valley Flex user&#8217;s group (a.k.a. &#8220;SilvaFUG&#8221;)</a> users group meeting. In that post I strongly recommended watching the recordings of the presentations. The recordings are available now, so once again I highly recommend watching them (now that you actually <em>can</em> watch them =)</p>
<p>Here are the direct links:</p>
<ul>
<li><a href="http://adobechats.adobe.acrobat.com/p49294102/">Grant Straker on Moving ZoomFlex from a homegrown framework to Cairngorm</a></li>
<li><a href="http://adobechats.adobe.acrobat.com/p12266504/">Ali Mills and Luke Bayes on Flex application frameworks</a> (A great overview of the strengths and weaknesses of various frameworks like Cairngorm etc., from <a href="http://asserttrue.com/">two really smart developers</a>.)</li>
</ul>
<p>Enjoy!</p>
<p>(via email from <a href="http://www.silvafug.org/">SilvaFUG</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/10/18/flex-application-frameworks-presentations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The future of Flex application frameworks-my thoughts</title>
		<link>http://probertson.com/articles/2007/10/12/flex-frameworks-future/</link>
		<comments>http://probertson.com/articles/2007/10/12/flex-frameworks-future/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 16:55:14 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Opinions]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/10/12/flex-frameworks-future/</guid>
		<description><![CDATA[This post started out as my notes from the Oct. 11, 2007 SilvaFUG user&#8217;s group meeting, which included two talks on Flex application frameworks, but by the end I realized it was more of a restatement of (filtered through my opinion) some of the important forward-looking ideas that came out of the audience discussions and [...]]]></description>
			<content:encoded><![CDATA[<p>This post started out as my notes from the Oct. 11, 2007 SilvaFUG user&#8217;s group meeting, which included two talks on Flex application frameworks, but by the end I realized it was more of a restatement of (filtered through my opinion) some of the important forward-looking ideas that came out of the audience discussions and the presentations at that meeting. So I think it rambles more than I would normally like, but I was trying to capture my &#8220;raw thoughts&#8221; while the meeting was progressing.</p>
<p>If you&#8217;re interested in a summary of the talks, I&#8217;m afraid I didn&#8217;t do that. (But I highly recommend viewing the presentations:</p>
<ul>
<li><a href="http://adobechats.adobe.acrobat.com/p49294102/">Grant Strake on moving ZoomFlex from a homegrown framework to Cairngorm</a></li>
<li><a href="http://adobechats.adobe.acrobat.com/p12266504/">Ali Mills and Luke Bayes comparing various Flex application frameworks</a></li>
</ul>
<p>What I&#8217;ve written here is primarily just thoughts that I wanted to save for myself; things that maybe I don&#8217;t think about as often as I should, or things I want to remember about the audience of Flex and other Adobe developer products. Because I&#8217;m interested in the developer community, much of the focus is on points about the developer community that I sometimes need to remind myself of.</p>
<h2>Grant Straker</h2>
<p>The first speaker was Grant Straker, talking about his company&#8217;s choice to use a homegrown framework, and eventual decision to migrate it to Cairngorm instead. His company (<a href="http://www.strakerinteractive.co.uk/">Straker Interactive</a>) has a RAD product (&#8220;ZoomFlex,&#8221; I believe it&#8217;s called) that bundles ColdFusion and Flex to create apps quickly &#8212; you use wizards to define data structures, and the product generates database structure, backend ColdFusion, and front-end Flex code for apps using that data. (The idea is that developers then take those Flex files and customize the front-end forms, style the app, etc.)</p>
<p>Here are some interesting thoughts/points I picked up:</p>
<ul>
<li>Originally they chose not to use Cairngorm for the underlying framework for their generated code. The reason: while there are some developers who build big, fancy, complex enterprise apps, there&#8217;s also a group of developers who &#8220;just want to know what they need to know to get their job done&#8221; &#8212; which often means build basic CRUD apps as quickly and easily as possible (e.g. web-enabling existing databases, spreadsheets, etc.). This latter group was/is more in their target audience.</li>
<li>Code can be written in different ways &#8212; they try to generate code so that it&#8217;s clear and obvious what it does, and so that it can be easily extended by developers of varying levels of experience (key: don&#8217;t assume a high level of experience).</li>
<li>In retrospect, he wishes they had just stuck with Cairngorm in the beginning. Now, 1.5 years later, there&#8217;s a large community, examples, documentation, etc. making it easier for a less-experienced developer to learn enough Cairngorm that they can understand it and use it.</li>
<li>I was really amazed by how much code they are able to generate for developers. I&#8217;ve read some things about code generation tools, but I&#8217;ve never tried them out (due to the organizations I&#8217;ve worked for, and perhaps due to my personality as a developer who likes to have &#8220;control&#8221; of the code). However, I&#8217;ve definitely seen the down side of that, which is that I end up writing a lot of redundant or very similar code (especially for data access and manipulation). The &#8220;alternative&#8221; approach certainly has some attractions&#8230;</li>
<li>Part of what they include is a library of pre-built UI components. The process of migrating these components to Cairngorm has been challenging at times. One of the principles of many frameworks including Cairngorm is that the user interface code is separate from the &#8220;model&#8221; (the underlying data). However, some components by nature lend themselves to having knowledge of their underlying data (e.g. their video player component) so figuring out how to structure those components is complicated.</li>
</ul>
<h2>Luke Bayes and Ali Mills - Evaluating application frameworks for Flex</h2>
<p><a href="http://asserttrue.com/">Luke and Ali</a> came into this presentation with no background in any of the major frameworks (other than the Flex framework). This is good because they didn&#8217;t have any biases, but it means they may have some non-best-practices too.</p>
<p>This was a great talk, but there was a lot of info in a short time so again, I&#8217;m not going to bother trying to write detailed notes. I highly recommend watching <a href="http://adobechats.adobe.acrobat.com/p12266504/">the recording</a>.</p>
<p>However, once again in this presentation (in particular in the discussion afterwards) some of the same ideas came up. Luke in particular expressed a reluctance to have a prescriptive framework, because he doesn&#8217;t want to be &#8220;told how to code.&#8221; That opinion resonated with most of the audience there &#8212; but at the same time, everyone also acknowledged that the audience at a user&#8217;s group presentation isn&#8217;t really an accurate representation of the broad Flex developer community (especially the even broader community of developers who are considering Flex or who will be Flex developers in the future). If the Flex community is going to continue to grow, and be more accessible to new developers, it would be very helpful to have some prescriptive application frameworks that give people a predefined, standard architecture within which they can build their app (in the same way that Flex&#8217;s components provide user interface elements and layout elements that give developers a big head-start in building an app, compared to straight ActionScript or Flash).</p>
<p>What is the &#8220;next frontier&#8221; of Flex developers? Is it the &#8220;VB developer&#8221;<a class="footnote" href="#noteVBDeveloper">1</a> (the &#8220;behind-the-firewall&#8221; corporate developer). If so, then to support that group of developers we&#8217;re going to need prescriptive frameworks that are easy to get into (&#8220;accessible&#8221; in Luke and Ali&#8217;s terms), that do as much work for you as they can, but that still don&#8217;t get in the way as an app grows in complexity.</p>
<p>At the same time, more advanced Flex developers may not want such a framework, and they certainly aren&#8217;t going to want to have to carry along the &#8220;baggage&#8221; (meaning both prescriptive architecture imposed on them, and literal baggage in download size) that would come along with such a framework if they&#8217;re not using it.</p>
<p>Personally, I think that&#8217;s an extremely important point for both Adobe and third-party framework developers to keep in mind going into the future.</p>
<p id="noteVBDeveloper">&#8220;VB Developer&#8221; is my name for a developer who works in a medium-large corporation or organization, perhaps coding apps for a group within that organization, who doesn&#8217;t really want to learn everything there is to know about Flex (or their language of choice), or become a &#8220;guru,&#8221; but rather just wants to build their app and make it work nicely, but do so as quickly and painlessly as possible. Yes, the name &#8220;VB developer&#8221; is rather dated, since at this stage in history most such developers are doing web-based apps, probably using ASP.NET or J2EE in a large, standardized org or perhaps PHP or Ruby in a smaller or more independent group.</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/10/12/flex-frameworks-future/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Knowing when to not use AIR</title>
		<link>http://probertson.com/articles/2007/09/14/knowing-when-to-not-use-air/</link>
		<comments>http://probertson.com/articles/2007/09/14/knowing-when-to-not-use-air/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 22:58:03 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[User-centered design]]></category>
		<category><![CDATA[Web Browsers]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/09/14/knowing-when-to-not-use-air/</guid>
		<description><![CDATA[Simplified Chaos has an insightful article about deciding when to use AIR and when to stick to browser-based Flash/Flex. His recommendation is to use the browser by default, and only move to AIR if you really need that desktop functionality. His reasoning, which I can agree with, is that people are much less likely to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.simplifiedchaos.com/">Simplified Chaos</a> has an insightful article about deciding <a href="http://www.simplifiedchaos.com/2007/08/29/too-many-adobe-air-applications-that-shouldnt-be/">when to use AIR and when to stick to browser-based Flash/Flex</a>. His recommendation is to use the browser by default, and only move to AIR if you really need that desktop functionality. His reasoning, which I can agree with, is that people are much less likely to try out a desktop app that they have to install (and probably uninstall later) than to just look at something in a browser. I definitely agree &#8212; I hadn&#8217;t really realized it until reading this, but I&#8217;ve noticed that when I hear about a new AIR app then I always hope the web site has some screenshots or videos of the app in action, so that I don&#8217;t have to install it to try it out.</p>
<p><a href="http://www.bit-101.com/blog/">Keith Peters</a> wrote <a href="http://www.bit-101.com/blog/?p=1018">a similar post on the same topic</a>, which I also recommend.</p>
<p>(via <a href="http://jessewarden.com/">Jesse Warden</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/09/14/knowing-when-to-not-use-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Danny-T on database fundamentals for AIR</title>
		<link>http://probertson.com/articles/2007/06/26/database-fundamentals-for-air/</link>
		<comments>http://probertson.com/articles/2007/06/26/database-fundamentals-for-air/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 20:12:09 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[local SQL database]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/06/26/database-fundamentals-for-air/</guid>
		<description><![CDATA[Dan Thomas (&#8220;Danny-T&#8221;) has written up a nice concise intro to database concepts, geared toward working with databases in AIR. He ends it with a nice list of factors to consider in deciding whether to use a local database (with AIR&#8217;s local SQL database engine) or a remote database (available through the same mechanisms you&#8217;d [...]]]></description>
			<content:encoded><![CDATA[<p>Dan Thomas (&#8220;Danny-T&#8221;) has written up a nice <a href="http://danny-t.co.uk/index.php/2007/06/23/what-is-an-air-database/">concise intro to database concepts, geared toward working with databases in AIR</a><span id="more-147"></span>. He ends it with a nice list of factors to consider in deciding whether to use a local database (with AIR&#8217;s local SQL database engine) or a remote database (available through the same mechanisms you&#8217;d use in a browser-based Flex/Ajax app).</p>
<p>I definitely agree with his conclusion &#8212; one of the strengths of AIR is that you can use either, or both, of these approaches depending on the needs of your app.</p>
<p>As a side note, the AIR documentation also includes some introductory content on <a href="http://livedocs.adobe.com/labs/air/1/devappsflex/SQL_04.html">relational databases</a>, <a href="http://livedocs.adobe.com/labs/air/1/devappsflex/SQL_05.html">SQL</a>, and related concepts &#8212; although I intentionally kept it limited, since the topic of relational databases is so vast that many books have been written about the subject.</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/06/26/database-fundamentals-for-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem (and solution): Any AIR app can read any other app&#8217;s databases</title>
		<link>http://probertson.com/articles/2007/06/21/securing-air-sql-database/</link>
		<comments>http://probertson.com/articles/2007/06/21/securing-air-sql-database/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 15:06:46 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[local SQL database]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/06/21/securing-air-sql-database/</guid>
		<description><![CDATA[In a side note on a recent post about the AIR functionality for working with local SQL databases, Tim Anderson raised some concerns about the security model for AIR local SQL databases, that I thought would be valuable to discuss more.
Tim also raises other concerns which aren&#8217;t so much issues to keep in mind when [...]]]></description>
			<content:encoded><![CDATA[<p>In a side note on <a href="http://www.itwriting.com/blog/?p=253">a recent post about the AIR functionality for working with local SQL databases</a>, Tim Anderson raised some concerns about the security model for AIR local SQL databases, that I thought would be valuable to discuss more.</p>
<p class="editornote">Tim also raises other concerns which aren&#8217;t so much issues to keep in mind when developing AIR apps as they are issues surrounding the documentation. I&#8217;ve attempted to respond to those concerns in <a href="/articles/2007/06/19/air-sql-docs-dont-mention-sqlite-my-response/">a separate post</a>.</p>
<p>Tim says:</p>
<blockquote><p>unlike [Google] Gears, AIR makes no attempt to isolate databases based on the origin of the application. In AIR, a SQLite database may be anywhere in the file system, and it’s equally available to any AIR application - a big hole in the AIR sandbox.</p>
</blockquote>
<p>I think Tim raises an important point (although I disagree a bit with his conclusion). Very soon after I started working with the local SQL database functionality in AIR I realized the same thing &#8212; since any AIR database can be read by any AIR application, it means that I can write a database application in AIR, and you can write an application that finds the file I create with my app, and reads its data.</p>
<p>But let&#8217;s take a moment to get a little perspective, after which we&#8217;ll consider what we can do about it.</p>
<p>It&#8217;s true that in AIR, a SQLite database may be anywhere in the file system, and in general it&#8217;s equally available to any AIR application. However, while this differs from Google Gears&#8217; approach, there are some key reasons why this difference is allowed, and why it&#8217;s not considered a &#8220;big hole&#8221; security-wise. </p>
<p>First of all, there&#8217;s a significant difference between Google Gears and Adobe AIR. Google Gears is an extension to the standard capabilities of web browsers, but ultimately an application that uses Google Gears runs in a web browser and is therefore subject to all the security constraints of a browser-based application. This is similar to content that runs in the Flash Player browser plugin, or in a non-Gears-enabled HTML/JavaScript application &#8212; neither of which can freely access a user&#8217;s hard drive. Why is that? Well, it&#8217;s because all it takes for a user to access a Google Gears application is for the user to visit the url of that application in his or her web browser. That could be by clicking a link, or even by an automatic redirect that the user has limited control over.</p>
<p>On the other hand, an AIR application doesn&#8217;t require or use a browser. In order for a user to access an AIR application, he or she must first choose to install the application, including going through a security dialog that will describe whether the application was signed with a security certificate. In this way, an AIR application is comparable to any other desktop application, such as one written in C++. Since any C++ application could theoretically include the SQLite library, installing an AIR application is no different from installing any C++ application in the sense that, by doing so, a user opens himself up to possible abuses and security risks.</p>
<p>Likewise, any application that can read files from the file system (AIR or not) has the same potential for &#8220;stealing&#8221; sensitive information. If someone has written down his passwords in a Microsoft Word file, an installed application could search the hard drive for all Word files and read them all and send their contents to a malicious author. Even if your application uses a custom binary file format, there&#8217;s nothing that can be done to prevent someone else from reverse-engineering your file format and then writing an app that reads your files and extracts the data. Of course, it&#8217;s true that by using a SQLite-format database file, in return for the convenience and benefits it gives you, you&#8217;re saving Joe Evil the trouble of needing to reverse engineer your file format, and instead you&#8217;re handing your data over quite handily in a wonderful structured way.</p>
<p>On the other hand, all this openness actually has benefits. Since my app can read files written by another app, I can write two different apps that can understand each others&#8217; data. If I make a certain kind of app, and later you make another app that does the same thing but does it better, you can read my file format and import my data into your app &#8212; meaning you can help users migrate from my crummy app to your awesome one.</p>
<p>Having said all that, I don&#8217;t want you to think that I&#8217;m simply washing my hands of the issue. I think it&#8217;s an extremely important one, and I&#8217;m very glad it came up.</p>
<h2>Tell me how to fix it, already</h2>
<p>All openness aside, if you&#8217;re storing sensitive data in your application, data that you don&#8217;t think other applications ought to be able to read, there are some things you can do to try to minimize the potential for damage. Note that since the problem isn&#8217;t exclusive to apps that use a local SQL database (although it is perhaps more apparent for those apps), the possible solutions aren&#8217;t exclusive to local SQL databases either.</p>
<h3>Use user-specific directories</h3>
<p>Every AIR application has a special folder in the operating system that can be used to store files related to the app. The folder, known as the &#8220;application storage directory,&#8221; is actually different for different logged-in users of the same application. In that way it&#8217;s a convenient way to separate files for different users of your application. It&#8217;s location is always available using the <code>File.applicationStorageDirectory</code> property. Similarly, you can access the directories representing the user&#8217;s desktop and his/her documents directory; again, these are folders that will be different per-user, but your app can use the same code to access them regardless of who is using the app.</p>
<p>Note that this only provides limited protection. Any AIR app or any other app can traverse the file system (assuming the logged-in user has permission to do so) and discover and read files in the application storage directory or other user-specific directories. So while this might protect files belonging to other user accounts (if the user running the malicious app isn&#8217;t an administrator), it won&#8217;t protect files belonging to the logged-in user.</p>
<h3>Encrypt your data</h3>
<p>The most reliable way to protect sensitive data from other applications is to encrypt it. This can be done in a couple of ways:</p>
<ul>
<li><em>Encrypt the database file itself</em>. This approach could be somewhat involved. When a user opens the app you&#8217;d decrypt the database file and store the decrypted copy in a temporary location from which the app would actually access the db. Then, when your app shuts down (or at some other time) you&#8217;d encrypt the temporary file and save the encrypted version wherever you store that master version, and delete the temporary file. As a simpler but less secure variation, you could use a simpler form of encryption. For example, you could append some bytes (either random or meaningful) to the beginning of the database file (or end, or middle or any combination of the three). Before using the database file, you&#8217;d need to remove the extra bytes, of course, and actually access the unencrypted version of the file with your application.</li>
<li><em>Encrypt sensitive data within the database</em>. Rather than encrypting the entire database file, if your application stores some data that would be considered sensitive, you could simply encrypt the raw data before writing it to the database in your INSERT/UPDATE statement, then decrypt it after reading it with a SELECT statement.</li>
</ul>
<p>Note that in both of these cases I&#8217;m talking about using a two-way encryption algorithm. Typically such algorithms require you to have some sort of secret &#8212; the encryption key &#8212; that is used by the application to encrypt and decrypt the data. Since an AIR app consists of HTML and JavaScript files (plain text) and/or SWF files (binary, but known to be de-compileable), you won&#8217;t want to store the encryption key for your application within the source code of your application. Rather, you&#8217;ll want to generate the key for each user, and store it separately from the application data. <a href="http://labs.adobe.com/technologies/air/samples/">Christian Cantrell&#8217;s &#8220;Salsa&#8221; application</a> demonstrates how to do this (it actually uses a user-selected passphrase as the encryption key, although the release notes say that future versions won&#8217;t require that) so that&#8217;s an example app to look at for an example of two-way encryption.</p>
<h3>Not just reading</h3>
<p>On a somewhat related note, another concern with other applications being able to access your app&#8217;s data has to do with the integrity of the data. Not only could another app read your application&#8217;s data, but it could just as easily change the data as well. Apart from two-way encrypting the entire database file, there isn&#8217;t really any way to protect against this. If you don&#8217;t want to encrypt the entire database file, one way you can at least verify the integrity of your data is by using a one-way encryption algorithm (also know as a hash). It works like this:</p>
<ol>
<li>After closing your database, your app encrypts all or some of your database (either the bytes of the db file, or the db data) using a one-way encryption algorithm.</li>
<li>The next time your app opens your database (or before opening the db if you hashed the file itself) you run the same file (or portion of the file or data) through the encryption algorithm again.</li>
<li>If the source data (your db&#8217;s contents) hasn&#8217;t changed, the resulting hash value should be identical. If the contents of the database have changed, the resulting hash value will have changed &#8212; meaning the data has been tampered with by something other than your application.</li>
</ol>
<p>You could even combine an integrity check with two-way encrypting the file. For example, you could create a hash of all or part of the database file, then append the result to the file. When you reopen the file, you would need to extract the hash, then you could compare it to the rest of the database as well as using the database file (minus the hash) for your application.</p>
<p>Finally, I should acknowledge that, while I&#8217;ve done some study of encryption and securing applications, by no means do I consider myself an expert on the topic. If anyone has other ideas, suggestions, and especially if you see some issues with the techniques I&#8217;ve recommended here, please share your experience!</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/06/21/securing-air-sql-database/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Brandon Ellis&#8217;s DataAccess Utility class</title>
		<link>http://probertson.com/articles/2007/06/19/brandon-ellis-dataaccess-class/</link>
		<comments>http://probertson.com/articles/2007/06/19/brandon-ellis-dataaccess-class/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 16:17:56 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[local SQL database]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/06/19/brandon-ellis-dataaccess-class/</guid>
		<description><![CDATA[If you&#8217;re looking to simplify the local database access part of your AIR app, this might be the ticket. Brandon Ellis has written a no-frills wrapper class for AIR local database operations. The biggest benefit it provides is that if you add, delete, or update data in a table, it automatically updates whatever component is [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re looking to simplify the local database access part of your AIR app, this might be the ticket. Brandon Ellis has written a <a href="http://www.brandonellis.org/?p=49">no-frills wrapper class for AIR local database operations</a>. The biggest benefit it provides is that if you add, delete, or update data in a table, it automatically updates whatever component is displaying the data from the related SELECT statement.</p>
<p>The part that caught my eye the most was that the wrapper class doesn&#8217;t dispatch any events to notify the view when the operations have completed. How, I asked myself, does it notify the view when the updated data loads? After a few seconds I realized the answer &#8212; it&#8217;s the magic of Flex data binding. The DataAccess class exposes the SELECT results as a property (<code>dbResult</code>) that&#8217;s a Flex ArrayCollection, and it&#8217;s marked <code>[Bindable]</code>. A Flex control can bind to that property as a data provider, and whenever the DataAccess instance reloads its data and updates the ArrayCollection. Then the Flex framework takes over, and the view gets updated automatically. Pretty slick; and it definitely saves a lot of event-handling code. So I guess seeing this in action gave me further appreciation for the power of data binding.</p>
<p>It has a couple of minor issues that I&#8217;ve noted in the comments on that page (but mostly they should be fairly easy to fix, if Brandon or someone else decides to do so).</p>
<p>(via: <a href="http://blog.halcyonsolutions.net/">Greg Hamer</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/06/19/brandon-ellis-dataaccess-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intro to complex Flex apps</title>
		<link>http://probertson.com/articles/2006/05/31/intro-to-complex-flex-apps/</link>
		<comments>http://probertson.com/articles/2006/05/31/intro-to-complex-flex-apps/#comments</comments>
		<pubDate>Thu, 01 Jun 2006 02:47:50 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Sites to remember]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2006/05/31/intro-to-complex-flex-apps/</guid>
		<description><![CDATA[If you&#8217;re interested in building large-scale Flex apps and not sure where to start, Brian Riggs has a nice article on Architecting a Flex App, where he gives a good overview and introduction to structuring an application using the Model-View-Controller pattern, as implemented in the Cairngorm framework.
Brian is one of two (at least so far, [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re interested in building large-scale Flex apps and not sure where to start, Brian Riggs has a nice article on <a href="http://blogs.adobe.com/kiwi/2006/05/architecting_a_flex_app_1.html">Architecting a Flex App</a>, where he gives a good overview and introduction to structuring an application using the Model-View-Controller pattern, as implemented in the Cairngorm framework.</p>
<p>Brian is one of two (at least so far, maybe there are more) authors writing on the <a href="http://blogs.adobe.com/kiwi/">Adobe Kiwi Project blog</a>. The Kiwi Project (as stated in the tagline of the site) is a project which is working on creating &#8220;Read/Write Web Components for Flex.&#8221;  I&#8217;m not sure of the details of what that means, but parts of it can be seen in the <a href="http://labs.adobe.com/wiki/index.php/NoteTag">open-source NoteTag note-taking application</a> which Brian uses as his example in this and other articles, and which is available on the Adobe Labs site.</p>
<p>Darrick Brown, who also writes on the site, has put up a couple of nice articles on ActionScript 3 from a C/C++ perspective. I don&#8217;t know either of those languages, although I work a lot in C# so I understood all his examples just fine.  In any case he&#8217;s got what I think are some nice examples and thoughts for someone coming from any modern language.</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2006/05/31/intro-to-complex-flex-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Hypertext Application Technology  Working Group</title>
		<link>http://probertson.com/articles/2004/12/02/web-hypertext-application-technology-working-group/</link>
		<comments>http://probertson.com/articles/2004/12/02/web-hypertext-application-technology-working-group/#comments</comments>
		<pubDate>Thu, 02 Dec 2004 18:02:34 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Sites to remember]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2004/12/02/web-hypertext-application-technology-working-group/</guid>
		<description><![CDATA[Web Hypertext Application Technology  Working Group
]]></description>
			<content:encoded><![CDATA[<p><a href="http://whatwg.org/">Web Hypertext Application Technology  Working Group</a></p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2004/12/02/web-hypertext-application-technology-working-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript UML Code generator</title>
		<link>http://probertson.com/articles/2004/10/14/actionscript-uml-code-generator/</link>
		<comments>http://probertson.com/articles/2004/10/14/actionscript-uml-code-generator/#comments</comments>
		<pubDate>Thu, 14 Oct 2004 16:47:35 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles to remember]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2004/10/14/actionscript-uml-code-generator/</guid>
		<description><![CDATA[ActionScript UML Code generator
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codealloy.com/umlconverter.htm">ActionScript UML Code generator</a></p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2004/10/14/actionscript-uml-code-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server: Building a Mail Queue System</title>
		<link>http://probertson.com/articles/2004/09/08/sql-server-building-a-mail-queue-system/</link>
		<comments>http://probertson.com/articles/2004/09/08/sql-server-building-a-mail-queue-system/#comments</comments>
		<pubDate>Wed, 08 Sep 2004 07:15:10 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2004/09/08/sql-server-building-a-mail-queue-system/</guid>
		<description><![CDATA[SQL Server: Building a Mail Queue System
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sqlteam.com/item.asp?ItemID=5908">SQL Server: Building a Mail Queue System</a></p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2004/09/08/sql-server-building-a-mail-queue-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
