Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

FlexCamp London


Published on

Send me a mail if you want me to send you the demos for this presentation (

  • Be the first to comment

  • Be the first to like this

FlexCamp London

  1. 1. Marco Casario CTO – Comtaste
  2. 2. Who I am FlexCamp London <ul><li>CTO of Comtaste , RIA Development, Consulting and Training firm </li></ul><ul><ul><ul><ul><li> </li></ul></ul></ul></ul><ul><li>My Books </li></ul><ul><ul><ul><li>AIR Cookbook </li></ul></ul></ul><ul><ul><ul><li>Flex Solutions: Essential Techniques for Flex 2 and Flex 3 Developers </li></ul></ul></ul><ul><ul><ul><li>Advanced AIR Applications </li></ul></ul></ul><ul><li>My Blog and my contacts </li></ul><ul><ul><ul><ul><li> </li></ul></ul></ul></ul><ul><ul><ul><ul><li> </li></ul></ul></ul></ul>
  3. 3. AIR Cookbook Cook-off FlexCamp London <ul><li>Qualify for the Adobe AIR Cookbook Cook-off contest to celebrate the upcoming publication of the Adobe AIR Cookbook . </li></ul><ul><li>Submit your best solutions to common AIR coding challenges for a chance to win: </li></ul><ul><ul><li>One pass to the Adobe MAX 2008 conference in San Francisco, and US$500 in O'Reilly books </li></ul></ul><ul><ul><li>Every English-language Adobe Developer Library (ADL) book published by O'Reilly Media </li></ul></ul><ul><ul><li>Five O'Reilly Media books of the winner's choice </li></ul></ul><ul><ul><li>Community choice award: US$350 in O'Reilly Media books to the winner of the top-rated recipe during the contest period </li></ul></ul>
  4. 4. Agenda FlexCamp London <ul><li>We’ll talk about best practices using SQLite support in AIR with Flex </li></ul><ul><li>I’ll show examples on : </li></ul><ul><ul><ul><li>Create and open a database </li></ul></ul></ul><ul><ul><ul><li>Synchronous and Asyncronous operations </li></ul></ul></ul><ul><ul><ul><li>Insert records </li></ul></ul></ul><ul><ul><ul><li>Display records </li></ul></ul></ul><ul><ul><ul><li>Display records in a hierarchical mode </li></ul></ul></ul><ul><ul><ul><li>Using SQL statements from an XML file </li></ul></ul></ul><ul><ul><ul><li>Using the DAO Pattern </li></ul></ul></ul><ul><li>We will move very quickly  I have only 20 min </li></ul>
  5. 5. Demos FlexCamp London STOP TALKING DEMO NOW
  6. 6. DAO FlexCamp London <ul><li>Data Access Object is an object that provides an abstract interface to some type of data storage </li></ul>
  7. 7. DAO FlexCamp London <ul><li>Data Access Object is an object that provides an abstract interface to some type of data storage mechanism </li></ul><ul><li>It provides some specific operations without exposing details of the database </li></ul><ul><li>public function SalesManager() </li></ul><ul><li>{ </li></ul><ul><li>sqlConnection = SQLManager.getConnection( &quot;flexcamp&quot; ); </li></ul><ul><li>} </li></ul><ul><li>public function getContact(contactId:int):SalesManagerVO </li></ul><ul><li>{ </li></ul><ul><li>return getItem( &quot;SELECT * FROM STUDENTS WHERE CONTACT_ID=? , studentID) as SalesManagerVO; </li></ul><ul><li>} </li></ul>
  8. 8. DAO FlexCamp London <ul><li>Benefits of using DAO (as given by Sun): </li></ul><ul><li>The benefits of using data access objects is the relatively simple and rigorous separation between two important parts of an application which can and should know almost nothing of each other, and which can be expected to evolve frequently and independently. </li></ul><ul><li>Changing business logic can rely on the same DAO interface, while changes to persistence logic do not affect DAO clients as long as the interface remains correctly implemented. </li></ul>
  9. 9. What I don’t like FlexCamp London <ul><li>Inconsistency in the AIR and Flex APIs </li></ul><ul><li>SQL does not use IResponder but it uses events and Responder as an argument </li></ul><ul><li>FILE only uses events </li></ul><ul><li>RPC (in Flex SDK) uses events or the IResponders class (with AsynchToken class) </li></ul>
  10. 10. Best Practices FlexCamp London <ul><li>Open a SQLConnection at the application startup (avoid delays when running statements) </li></ul><ul><li>Use only one SQLStatement (with parameters) </li></ul><ul><li>Execute the statements within an explicit transaction </li></ul><ul><li>Do not concatenate user input into statement text to secure your app </li></ul><ul><li>When embedding a SQLite DB into the AIR package the ApplicationFolder is read-only. So, copy the DB in a different folder (using the copyTo method) </li></ul>
  11. 11. we make it RIA Marco Casario CTO – Comtaste
  12. 12. Marco Casario CTO – Comtaste