SlideShare una empresa de Scribd logo
1 de 109
Working With Data

    SYNCHRONISING
DATABASES WITHOUT
   SQL STATEMENTS
Who Am I ?
Steven Peeters
Instructor / consultant at multimediacollege™



   Adobe Flex & AIR Certified Instructor
   ColdFusion User Group Manager
   10+ years development experience
   Author for Friends of ED


    Email:           steven@multimediacollege.be
    LinkedIn:        www.linkedin.com/in/stevenpeeters
    Blog:            www.multimediacollege.be/blog
    Twitter:         @aikisteve
    Personal site:   www.flexpert.be
What will I be talking about?
 SQLite basics
 Synchronous vs asynchronous access
 Encryption
 ORM
 Hands-on exercise
SQLite
SQLite
  Lightweight database
SQLite
  Lightweight database
  No configuration necessary
SQLite
  Lightweight database
  No configuration necessary
     No tablespaces
SQLite
  Lightweight database
  No configuration necessary
     No tablespaces
     No user rights
SQLite
  Lightweight database
  No configuration necessary
      No tablespaces
      No user rights
  Single database file
SQLite: advantages
SQLite: advantages
  Resides on client
SQLite: advantages
  Resides on client
  Can be encrypted to protect data inside
SQLite: advantages
  Resides on client
  Can be encrypted to protect data inside
  Cross-platform
SQLite: advantages
  Resides on client
  Can be encrypted to protect data inside
  Cross-platform
  Easy to use
SQLite: advantages
  Resides on client
  Can be encrypted to protect data inside
  Cross-platform
  Easy to use
  Both synchronous and asynchronous access
SQLite: disadvantages
SQLite: disadvantages
  Limited SQL statements
SQLite: disadvantages
  Limited SQL statements
     No full ANSI-92 SQL support
SQLite: disadvantages
  Limited SQL statements
     No full ANSI-92 SQL support
     No ALTER TABLE <table> ALTER COLUMN
SQLite: disadvantages
  Limited SQL statements
      No full ANSI-92 SQL support
      No ALTER TABLE <table> ALTER COLUMN
  Limited data types
SQLite: disadvantages
  Limited SQL statements
      No full ANSI-92 SQL support
      No ALTER TABLE <table> ALTER COLUMN
  Limited data types
      INTEGER
SQLite: disadvantages
  Limited SQL statements
      No full ANSI-92 SQL support
      No ALTER TABLE <table> ALTER COLUMN
  Limited data types
      INTEGER
      REAL
SQLite: disadvantages
  Limited SQL statements
      No full ANSI-92 SQL support
      No ALTER TABLE <table> ALTER COLUMN
  Limited data types
      INTEGER
      REAL
      TEXT
SQLite: disadvantages
  Limited SQL statements
      No full ANSI-92 SQL support
      No ALTER TABLE <table> ALTER COLUMN
  Limited data types
      INTEGER
      REAL
      TEXT
      BLOB
SQLite: disadvantages
  Limited SQL statements
      No full ANSI-92 SQL support
      No ALTER TABLE <table> ALTER COLUMN
  Limited data types
      INTEGER
      REAL
      TEXT
      BLOB
      DATE
SQLite: disadvantages
  Limited SQL statements
      No full ANSI-92 SQL support
      No ALTER TABLE <table> ALTER COLUMN
  Limited data types
      INTEGER
      REAL
      TEXT
      BLOB
      DATE
  Mapping remote DB can be troublesome
SQLite: encryption
SQLite: encryption
  Need password before accessing the database
SQLite: encryption
  Need password before accessing the database
  Use EncryptionKeyGenerator to validate the
  strength of the password
SQLite: encryption
  Need password before accessing the database
  Use EncryptionKeyGenerator to validate the
  strength of the password
     as3corelib project on code.google.com
SQLite: encryption
  Need password before accessing the database
  Use EncryptionKeyGenerator to validate the
  strength of the password
     as3corelib project on code.google.com
  Re-encryption possible
SQLite: encryption
     Need password before accessing the database
     Use EncryptionKeyGenerator to validate the
       strength of the password
           as3corelib project on code.google.com
     Re-encryption possible


connection.open(dbFile, SQLMode, autoCompact, pageSize, encryptionKey);
connection.openAsync(dbFile, SQLMode, autoCompact, pageSize, encryptionKey);
Password as encryption key
Password as encryption key
  Login procedure used for obtaining encryption
  password at runtime
Password as encryption key
  Login procedure used for obtaining encryption
   password at runtime
  Password doesn’t have to be stored
Password as encryption key
  Login procedure used for obtaining encryption
   password at runtime
  Password doesn’t have to be stored
  Need to re-encrypt DB when user changes
   password
Password as encryption key
  What if user changes password on another
  machine?
Password as encryption key
  What if user changes password on another
  machine?
     2 passwords for same application
Password as encryption key
  What if user changes password on another
  machine?
     2 passwords for same application
     synchronise with remote server
Password as encryption key
  What if user changes password on another
  machine?
     2 passwords for same application
     synchronise with remote server
     store current password in ELS
Password as encryption key
  What if user changes password on another
  machine?
     2 passwords for same application
     synchronise with remote server
     store current password in ELS
     Log in procedure:
Password as encryption key
  What if user changes password on another
  machine?
     2 passwords for same application
     synchronise with remote server
     store current password in ELS
     Log in procedure:
      - Online: attempt login with new password
Password as encryption key
  What if user changes password on another
  machine?
     2 passwords for same application
     synchronise with remote server
     store current password in ELS
     Log in procedure:
      - Online: attempt login with new password
        •     Success: re-encrypt and update ELS
Password as encryption key
  What if user changes password on another
  machine?
     2 passwords for same application
     synchronise with remote server
     store current password in ELS
     Log in procedure:
      - Online: attempt login with new password
        •     Success: re-encrypt and update ELS
        •     Fail: attempt login with ELS password
Password as encryption key
  What if user changes password on another
  machine?
     2 passwords for same application
     synchronise with remote server
     store current password in ELS
     Log in procedure:
      - Online: attempt login with new password
        •      Success: re-encrypt and update ELS
        •      Fail: attempt login with ELS password
      - Offline: attempt login with ELS password
Synchronous access
Synchronous access
  Similar to executing an ActionScript method
Synchronous access
  Similar to executing an ActionScript method
      pauses application
Synchronous access
  Similar to executing an ActionScript method
      pauses application
      immediate result
Synchronous access
  Similar to executing an ActionScript method
      pauses application
      immediate result
  Very easy to understand
Synchronous access
  Similar to executing an ActionScript method
      pauses application
      immediate result
  Very easy to understand
  Very easy to use
Synchronous access
  Similar to executing an ActionScript method
      pauses application
      immediate result
  Very easy to understand
  Very easy to use
  Not always user friendly with batch operations
Synchronous access
public function insertRecord(firstname:String, lastname:String):void {
  _dbConnection.open(_dbFile);

    var stmt:SQLStatement = new SQLStatement();
    stmt.sqlConnection = _dbConnection;

    stmt.text = “INSERT INTO person(firstname, lastname) “
              + “VALUES (‘Steven’, ‘Peeters’)”;
    stmt.execute();

    _dbConnection.close();
}
Asynchronous access
Asynchronous access
  Fire and forget
Asynchronous access
  Fire and forget
      does not pause application
Asynchronous access
  Fire and forget
      does not pause application
      don’t know when result is available
Asynchronous access
  Fire and forget
      does not pause application
      don’t know when result is available
  Needs event handler to capture result
Asynchronous access
  Fire and forget
      does not pause application
      don’t know when result is available
  Needs event handler to capture result
  More complex
Asynchronous access
  Fire and forget
      does not pause application
      don’t know when result is available
  Needs event handler to capture result
  More complex
  Especially useful with batch operations
Asynchronous access
public function openDB():void {
  _dbConnection.openAsync(_dbFile);
  _dbConnection.addEventListener(SQLEvent.OPEN, insertRecord);
}

public function insertRecord(event:SQLEvent):void {
  var stmt:SQLStatement = new SQLStatement();
  stmt.sqlConnection = _dbConnection;

    stmt.text = “INSERT INTO person(firstname, lastname) “
              + “VALUES (‘Steven’, ‘Peeters’)”;
    stmt.addEventListener(SQLEvent.RESULT, recordInserted);
    stmt.execute();
}

public function recordInserted(event:SQLEvent):void {
  _dbConnection.close();
}
ORM
ORM
What the <bleep> is ORM?
ORM
What the <bleep> is ORM?
  Object Relational Mapping
ORM
What the <bleep> is ORM?
  Object Relational Mapping
  Hibernate framework
ORM
What the <bleep> is ORM?
  Object Relational Mapping
  Hibernate framework
  Server technology
ORM
What the <bleep> is ORM?
  Object Relational Mapping
  Hibernate framework
  Server technology
  Database independent
ORM
What the <bleep> is ORM?
  Object Relational Mapping
  Hibernate framework
  Server technology
  Database independent
  No more SQL
ORM
What the <bleep> is ORM?
  Object Relational Mapping
  Hibernate framework
  Server technology
  Database independent
  No more SQL
  Implicit getters/setters in ColdFusion
ORM
What the <bleep> is ORM?
  Object Relational Mapping
  Hibernate framework
  Server technology
  Database independent
  No more SQL
  Implicit getters/setters in ColdFusion
ORM
What the <bleep> is ORM?
  Object Relational Mapping
  Hibernate framework
  Server technology
  Database independent
  No more SQL
  Implicit getters/setters in ColdFusion


  Let’s look at the code...
ORM in AIR
ORM in AIR
  Server technology on client?
ORM in AIR
  Server technology on client?
      cfair.swc
ORM in AIR
  Server technology on client?
      cfair.swc
      To be found in CFIDE/Scripts/AIR on server
ORM in AIR
  Server technology on client?
      cfair.swc
      To be found in CFIDE/Scripts/AIR on server
  Works with local SQLite database
ORM in AIR
  Server technology on client?
      cfair.swc
      To be found in CFIDE/Scripts/AIR on server
  Works with local SQLite database
  Need to adjust DTOs with metadata
ORM in AIR
  Server technology on client?
      cfair.swc
      To be found in CFIDE/Scripts/AIR on server
  Works with local SQLite database
  Need to adjust DTOs with metadata
  Use SyncManager class
ORM in AIR
  Server technology on client?
      cfair.swc
      To be found in CFIDE/Scripts/AIR on server
  Works with local SQLite database
  Need to adjust DTOs with metadata
  Use SyncManager class
  No BLOB possible :-(
ORM in AIR
  Server technology on client?
      cfair.swc
      To be found in CFIDE/Scripts/AIR on server
  Works with local SQLite database
  Need to adjust DTOs with metadata
  Use SyncManager class
  No BLOB possible :-(
ORM in AIR
  Server technology on client?
      cfair.swc
      To be found in CFIDE/Scripts/AIR on server
  Works with local SQLite database
  Need to adjust DTOs with metadata
  Use SyncManager class
  No BLOB possible :-(


  Let’s look at the code...
ORM metadata
ORM metadata
  [Entity]
ORM metadata
  [Entity]
  [Table(name=”name”)]
ORM metadata
  [Entity]
  [Table(name=”name”)]
  [Id]
ORM metadata
  [Entity]
  [Table(name=”name”)]
  [Id]
  [Transient]
ORM metadata
  [Entity]
  [Table(name=”name”)]
  [Id]
  [Transient]
  [Column(name=”name”, columnDefinition=”TEXT|
   INTEGER|REAL|DATE”, nullable=true|false,
   unique=true|false)]
ORM metadata
  [Entity]
  [Table(name=”name”)]
  [Id]
  [Transient]
  [Column(name=”name”, columnDefinition=”TEXT|
   INTEGER|REAL|DATE”, nullable=true|false,
   unique=true|false)]
  [RemoteClass]
ORM relationship metadata
ORM relationship metadata
  [OneToOne(targetEntity=”entity”,
  fetchType=”EAGER(default)|LAZY”)]
ORM relationship metadata
  [OneToOne(targetEntity=”entity”,
   fetchType=”EAGER(default)|LAZY”)]
  [OneToMany(targetEntity=”entity”,
   mappedBy=”entity”, fetchType=”EAGER(default)|
   LAZY”)]
ORM relationship metadata
  [OneToOne(targetEntity=”entity”,
   fetchType=”EAGER(default)|LAZY”)]
  [OneToMany(targetEntity=”entity”,
   mappedBy=”entity”, fetchType=”EAGER(default)|
   LAZY”)]
  [ManyToOne(targetEntity=”entity”,
   fetchType=”EAGER(default)|LAZY”)]
ORM relationship metadata
  [OneToOne(targetEntity=”entity”,
   fetchType=”EAGER(default)|LAZY”)]
  [OneToMany(targetEntity=”entity”,
   mappedBy=”entity”, fetchType=”EAGER(default)|
   LAZY”)]
  [ManyToOne(targetEntity=”entity”,
   fetchType=”EAGER(default)|LAZY”)]
ORM relationship metadata
  [OneToOne(targetEntity=”entity”,
   fetchType=”EAGER(default)|LAZY”)]
  [OneToMany(targetEntity=”entity”,
   mappedBy=”entity”, fetchType=”EAGER(default)|
   LAZY”)]
  [ManyToOne(targetEntity=”entity”,
   fetchType=”EAGER(default)|LAZY”)]

  [JoinColumn(name=”name”,
  referencedColumnName=”name”)]
ORM relationship metadata
ORM relationship metadata
  [ManyToMany(targetEntity=”entity”,
  fetchType=”EAGER|LAZY(default)”)]
ORM relationship metadata
  [ManyToMany(targetEntity=”entity”,
  fetchType=”EAGER|LAZY(default)”)]
ORM relationship metadata
  [ManyToMany(targetEntity=”entity”,
  fetchType=”EAGER|LAZY(default)”)]

  [JoinTable(name=”name”)]
ORM relationship metadata
  [ManyToMany(targetEntity=”entity”,
  fetchType=”EAGER|LAZY(default)”)]

  [JoinTable(name=”name”)]
  [JoinColumn(name=”name”,
  referencedColumnName=”name”)]
ORM relationship metadata
  [ManyToMany(targetEntity=”entity”,
  fetchType=”EAGER|LAZY(default)”)]

  [JoinTable(name=”name”)]
  [JoinColumn(name=”name”,
   referencedColumnName=”name”)]
  [InverseJoinColumn(name=”name”,
   referencedColumnName=”name”)]
What can you do with it?
What can you do with it?
  Offline applications
What can you do with it?
  Offline applications
  Use DB as temporary storage
What can you do with it?
  Offline applications
  Use DB as temporary storage
  Online/offline synchronisation
What can you do with it?
  Offline applications
  Use DB as temporary storage
  Online/offline synchronisation
  Protect private data
Flexpert Photo
Enough technical blabber

   Let’s just do it !!!
Thank You...

               Twitter:
               @aikisteve

               Email:
               steven@multimediacollege.be

               Blog:
               www.multimediacollege.be/blog

               Personal site:
               www.flexpert.be

Más contenido relacionado

La actualidad más candente

Creating scalable message driven solutions akkadotnet
Creating scalable message driven solutions akkadotnetCreating scalable message driven solutions akkadotnet
Creating scalable message driven solutions akkadotnetDavid Hoerster
 
Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Mindfire Solutions
 
Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015Alex Theedom
 
Introduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the EngineIntroduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the EngineBrent Ozar
 
Aws whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibboleth
Aws whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibbolethAws whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibboleth
Aws whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibbolethremayssat
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use itnspyre_net
 

La actualidad más candente (9)

Creating scalable message driven solutions akkadotnet
Creating scalable message driven solutions akkadotnetCreating scalable message driven solutions akkadotnet
Creating scalable message driven solutions akkadotnet
 
Background processing with hangfire
Background processing with hangfireBackground processing with hangfire
Background processing with hangfire
 
Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)
 
Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015
 
Introduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the EngineIntroduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the Engine
 
Aws whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibboleth
Aws whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibbolethAws whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibboleth
Aws whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibboleth
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use it
 
Ruby For Startups
Ruby For StartupsRuby For Startups
Ruby For Startups
 
ALL NEW OOP 2014
ALL NEW OOP 2014ALL NEW OOP 2014
ALL NEW OOP 2014
 

Destacado

Sql server 2012_licensing_reference_guide
Sql server 2012_licensing_reference_guideSql server 2012_licensing_reference_guide
Sql server 2012_licensing_reference_guideamenus006
 
Fusion-io SSD and SQL Server 2008
Fusion-io SSD and SQL Server 2008Fusion-io SSD and SQL Server 2008
Fusion-io SSD and SQL Server 2008Mark Ginnebaugh
 
Mcts self paced training kit exam 432 sql server 2008 - implementation and ...
Mcts self paced training kit exam 432   sql server 2008 - implementation and ...Mcts self paced training kit exam 432   sql server 2008 - implementation and ...
Mcts self paced training kit exam 432 sql server 2008 - implementation and ...Portal_do_Estudante_SQL
 
How to Install Hyperion Planning / Workspace / Essbase Part 1 - SQL Server In...
How to Install Hyperion Planning / Workspace / Essbase Part 1 - SQL Server In...How to Install Hyperion Planning / Workspace / Essbase Part 1 - SQL Server In...
How to Install Hyperion Planning / Workspace / Essbase Part 1 - SQL Server In...Arfan Mazhar
 
SQL Server Encryption - Adi Cohn
SQL Server Encryption - Adi CohnSQL Server Encryption - Adi Cohn
SQL Server Encryption - Adi Cohnsqlserver.co.il
 

Destacado (6)

Sql server 2012_licensing_reference_guide
Sql server 2012_licensing_reference_guideSql server 2012_licensing_reference_guide
Sql server 2012_licensing_reference_guide
 
Fusion-io SSD and SQL Server 2008
Fusion-io SSD and SQL Server 2008Fusion-io SSD and SQL Server 2008
Fusion-io SSD and SQL Server 2008
 
Mcts self paced training kit exam 432 sql server 2008 - implementation and ...
Mcts self paced training kit exam 432   sql server 2008 - implementation and ...Mcts self paced training kit exam 432   sql server 2008 - implementation and ...
Mcts self paced training kit exam 432 sql server 2008 - implementation and ...
 
How to Install Hyperion Planning / Workspace / Essbase Part 1 - SQL Server In...
How to Install Hyperion Planning / Workspace / Essbase Part 1 - SQL Server In...How to Install Hyperion Planning / Workspace / Essbase Part 1 - SQL Server In...
How to Install Hyperion Planning / Workspace / Essbase Part 1 - SQL Server In...
 
SQL Server Encryption - Adi Cohn
SQL Server Encryption - Adi CohnSQL Server Encryption - Adi Cohn
SQL Server Encryption - Adi Cohn
 
Database security
Database securityDatabase security
Database security
 

Similar a Flash And The City 2010

2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)Scott Sutherland
 
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...Michael Noel
 
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShellScott Sutherland
 
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory EnvironmentsTROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory EnvironmentsScott Sutherland
 
PowerUpSQL - 2018 Blackhat USA Arsenal Presentation
PowerUpSQL - 2018 Blackhat USA Arsenal PresentationPowerUpSQL - 2018 Blackhat USA Arsenal Presentation
PowerUpSQL - 2018 Blackhat USA Arsenal PresentationScott Sutherland
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETFernando G. Guerrero
 
Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101IDERA Software
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETFernando G. Guerrero
 
2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShell2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShellScott Sutherland
 
You Can Do It in SQL
You Can Do It in SQLYou Can Do It in SQL
You Can Do It in SQLDatabricks
 
Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51Mark Ginnebaugh
 
Getting Started with Sql Server Compact Edition
Getting Started with Sql Server Compact EditionGetting Started with Sql Server Compact Edition
Getting Started with Sql Server Compact EditionDonRobins
 
Creating Secure Applications
Creating Secure Applications Creating Secure Applications
Creating Secure Applications guest879f38
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsJim Jeffers
 
SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012Michael Noel
 
Sql server security in an insecure world
Sql server security in an insecure worldSql server security in an insecure world
Sql server security in an insecure worldGianluca Sartori
 

Similar a Flash And The City 2010 (20)

2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
 
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
 
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
 
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory EnvironmentsTROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
 
PowerUpSQL - 2018 Blackhat USA Arsenal Presentation
PowerUpSQL - 2018 Blackhat USA Arsenal PresentationPowerUpSQL - 2018 Blackhat USA Arsenal Presentation
PowerUpSQL - 2018 Blackhat USA Arsenal Presentation
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
 
Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
 
Fortress SQL Server
Fortress SQL ServerFortress SQL Server
Fortress SQL Server
 
Google Dorks and SQL Injection
Google Dorks and SQL InjectionGoogle Dorks and SQL Injection
Google Dorks and SQL Injection
 
Day2
Day2Day2
Day2
 
2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShell2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShell
 
You Can Do It in SQL
You Can Do It in SQLYou Can Do It in SQL
You Can Do It in SQL
 
Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51
 
Getting Started with Sql Server Compact Edition
Getting Started with Sql Server Compact EditionGetting Started with Sql Server Compact Edition
Getting Started with Sql Server Compact Edition
 
Creating Secure Applications
Creating Secure Applications Creating Secure Applications
Creating Secure Applications
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
 
SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
 
Sql server security in an insecure world
Sql server security in an insecure worldSql server security in an insecure world
Sql server security in an insecure world
 

Más de Steven Peeters

Applying Lean Thinking to Software Development
Applying Lean Thinking to Software DevelopmentApplying Lean Thinking to Software Development
Applying Lean Thinking to Software DevelopmentSteven Peeters
 
Coding and naming conventions
Coding and naming conventionsCoding and naming conventions
Coding and naming conventionsSteven Peeters
 
Fiddling With Phidgets
Fiddling With PhidgetsFiddling With Phidgets
Fiddling With PhidgetsSteven Peeters
 
Scotch On The Rocks 2011
Scotch On The Rocks 2011Scotch On The Rocks 2011
Scotch On The Rocks 2011Steven Peeters
 

Más de Steven Peeters (6)

Applying Lean Thinking to Software Development
Applying Lean Thinking to Software DevelopmentApplying Lean Thinking to Software Development
Applying Lean Thinking to Software Development
 
Coding and naming conventions
Coding and naming conventionsCoding and naming conventions
Coding and naming conventions
 
SOTR 2012
SOTR 2012SOTR 2012
SOTR 2012
 
Bridging the Gap
Bridging the GapBridging the Gap
Bridging the Gap
 
Fiddling With Phidgets
Fiddling With PhidgetsFiddling With Phidgets
Fiddling With Phidgets
 
Scotch On The Rocks 2011
Scotch On The Rocks 2011Scotch On The Rocks 2011
Scotch On The Rocks 2011
 

Último

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Último (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Flash And The City 2010

  • 1. Working With Data SYNCHRONISING DATABASES WITHOUT SQL STATEMENTS
  • 2. Who Am I ? Steven Peeters Instructor / consultant at multimediacollege™  Adobe Flex & AIR Certified Instructor  ColdFusion User Group Manager  10+ years development experience  Author for Friends of ED Email: steven@multimediacollege.be LinkedIn: www.linkedin.com/in/stevenpeeters Blog: www.multimediacollege.be/blog Twitter: @aikisteve Personal site: www.flexpert.be
  • 3. What will I be talking about?  SQLite basics  Synchronous vs asynchronous access  Encryption  ORM  Hands-on exercise
  • 6. SQLite  Lightweight database  No configuration necessary
  • 7. SQLite  Lightweight database  No configuration necessary  No tablespaces
  • 8. SQLite  Lightweight database  No configuration necessary  No tablespaces  No user rights
  • 9. SQLite  Lightweight database  No configuration necessary  No tablespaces  No user rights  Single database file
  • 11. SQLite: advantages  Resides on client
  • 12. SQLite: advantages  Resides on client  Can be encrypted to protect data inside
  • 13. SQLite: advantages  Resides on client  Can be encrypted to protect data inside  Cross-platform
  • 14. SQLite: advantages  Resides on client  Can be encrypted to protect data inside  Cross-platform  Easy to use
  • 15. SQLite: advantages  Resides on client  Can be encrypted to protect data inside  Cross-platform  Easy to use  Both synchronous and asynchronous access
  • 17. SQLite: disadvantages  Limited SQL statements
  • 18. SQLite: disadvantages  Limited SQL statements  No full ANSI-92 SQL support
  • 19. SQLite: disadvantages  Limited SQL statements  No full ANSI-92 SQL support  No ALTER TABLE <table> ALTER COLUMN
  • 20. SQLite: disadvantages  Limited SQL statements  No full ANSI-92 SQL support  No ALTER TABLE <table> ALTER COLUMN  Limited data types
  • 21. SQLite: disadvantages  Limited SQL statements  No full ANSI-92 SQL support  No ALTER TABLE <table> ALTER COLUMN  Limited data types  INTEGER
  • 22. SQLite: disadvantages  Limited SQL statements  No full ANSI-92 SQL support  No ALTER TABLE <table> ALTER COLUMN  Limited data types  INTEGER  REAL
  • 23. SQLite: disadvantages  Limited SQL statements  No full ANSI-92 SQL support  No ALTER TABLE <table> ALTER COLUMN  Limited data types  INTEGER  REAL  TEXT
  • 24. SQLite: disadvantages  Limited SQL statements  No full ANSI-92 SQL support  No ALTER TABLE <table> ALTER COLUMN  Limited data types  INTEGER  REAL  TEXT  BLOB
  • 25. SQLite: disadvantages  Limited SQL statements  No full ANSI-92 SQL support  No ALTER TABLE <table> ALTER COLUMN  Limited data types  INTEGER  REAL  TEXT  BLOB  DATE
  • 26. SQLite: disadvantages  Limited SQL statements  No full ANSI-92 SQL support  No ALTER TABLE <table> ALTER COLUMN  Limited data types  INTEGER  REAL  TEXT  BLOB  DATE  Mapping remote DB can be troublesome
  • 28. SQLite: encryption  Need password before accessing the database
  • 29. SQLite: encryption  Need password before accessing the database  Use EncryptionKeyGenerator to validate the strength of the password
  • 30. SQLite: encryption  Need password before accessing the database  Use EncryptionKeyGenerator to validate the strength of the password  as3corelib project on code.google.com
  • 31. SQLite: encryption  Need password before accessing the database  Use EncryptionKeyGenerator to validate the strength of the password  as3corelib project on code.google.com  Re-encryption possible
  • 32. SQLite: encryption  Need password before accessing the database  Use EncryptionKeyGenerator to validate the strength of the password  as3corelib project on code.google.com  Re-encryption possible connection.open(dbFile, SQLMode, autoCompact, pageSize, encryptionKey); connection.openAsync(dbFile, SQLMode, autoCompact, pageSize, encryptionKey);
  • 34. Password as encryption key  Login procedure used for obtaining encryption password at runtime
  • 35. Password as encryption key  Login procedure used for obtaining encryption password at runtime  Password doesn’t have to be stored
  • 36. Password as encryption key  Login procedure used for obtaining encryption password at runtime  Password doesn’t have to be stored  Need to re-encrypt DB when user changes password
  • 37. Password as encryption key  What if user changes password on another machine?
  • 38. Password as encryption key  What if user changes password on another machine?  2 passwords for same application
  • 39. Password as encryption key  What if user changes password on another machine?  2 passwords for same application  synchronise with remote server
  • 40. Password as encryption key  What if user changes password on another machine?  2 passwords for same application  synchronise with remote server  store current password in ELS
  • 41. Password as encryption key  What if user changes password on another machine?  2 passwords for same application  synchronise with remote server  store current password in ELS  Log in procedure:
  • 42. Password as encryption key  What if user changes password on another machine?  2 passwords for same application  synchronise with remote server  store current password in ELS  Log in procedure: - Online: attempt login with new password
  • 43. Password as encryption key  What if user changes password on another machine?  2 passwords for same application  synchronise with remote server  store current password in ELS  Log in procedure: - Online: attempt login with new password • Success: re-encrypt and update ELS
  • 44. Password as encryption key  What if user changes password on another machine?  2 passwords for same application  synchronise with remote server  store current password in ELS  Log in procedure: - Online: attempt login with new password • Success: re-encrypt and update ELS • Fail: attempt login with ELS password
  • 45. Password as encryption key  What if user changes password on another machine?  2 passwords for same application  synchronise with remote server  store current password in ELS  Log in procedure: - Online: attempt login with new password • Success: re-encrypt and update ELS • Fail: attempt login with ELS password - Offline: attempt login with ELS password
  • 47. Synchronous access  Similar to executing an ActionScript method
  • 48. Synchronous access  Similar to executing an ActionScript method  pauses application
  • 49. Synchronous access  Similar to executing an ActionScript method  pauses application  immediate result
  • 50. Synchronous access  Similar to executing an ActionScript method  pauses application  immediate result  Very easy to understand
  • 51. Synchronous access  Similar to executing an ActionScript method  pauses application  immediate result  Very easy to understand  Very easy to use
  • 52. Synchronous access  Similar to executing an ActionScript method  pauses application  immediate result  Very easy to understand  Very easy to use  Not always user friendly with batch operations
  • 53. Synchronous access public function insertRecord(firstname:String, lastname:String):void { _dbConnection.open(_dbFile); var stmt:SQLStatement = new SQLStatement(); stmt.sqlConnection = _dbConnection; stmt.text = “INSERT INTO person(firstname, lastname) “ + “VALUES (‘Steven’, ‘Peeters’)”; stmt.execute(); _dbConnection.close(); }
  • 55. Asynchronous access  Fire and forget
  • 56. Asynchronous access  Fire and forget  does not pause application
  • 57. Asynchronous access  Fire and forget  does not pause application  don’t know when result is available
  • 58. Asynchronous access  Fire and forget  does not pause application  don’t know when result is available  Needs event handler to capture result
  • 59. Asynchronous access  Fire and forget  does not pause application  don’t know when result is available  Needs event handler to capture result  More complex
  • 60. Asynchronous access  Fire and forget  does not pause application  don’t know when result is available  Needs event handler to capture result  More complex  Especially useful with batch operations
  • 61. Asynchronous access public function openDB():void { _dbConnection.openAsync(_dbFile); _dbConnection.addEventListener(SQLEvent.OPEN, insertRecord); } public function insertRecord(event:SQLEvent):void { var stmt:SQLStatement = new SQLStatement(); stmt.sqlConnection = _dbConnection; stmt.text = “INSERT INTO person(firstname, lastname) “ + “VALUES (‘Steven’, ‘Peeters’)”; stmt.addEventListener(SQLEvent.RESULT, recordInserted); stmt.execute(); } public function recordInserted(event:SQLEvent):void { _dbConnection.close(); }
  • 62. ORM
  • 64. ORM What the <bleep> is ORM?  Object Relational Mapping
  • 65. ORM What the <bleep> is ORM?  Object Relational Mapping  Hibernate framework
  • 66. ORM What the <bleep> is ORM?  Object Relational Mapping  Hibernate framework  Server technology
  • 67. ORM What the <bleep> is ORM?  Object Relational Mapping  Hibernate framework  Server technology  Database independent
  • 68. ORM What the <bleep> is ORM?  Object Relational Mapping  Hibernate framework  Server technology  Database independent  No more SQL
  • 69. ORM What the <bleep> is ORM?  Object Relational Mapping  Hibernate framework  Server technology  Database independent  No more SQL  Implicit getters/setters in ColdFusion
  • 70. ORM What the <bleep> is ORM?  Object Relational Mapping  Hibernate framework  Server technology  Database independent  No more SQL  Implicit getters/setters in ColdFusion
  • 71. ORM What the <bleep> is ORM?  Object Relational Mapping  Hibernate framework  Server technology  Database independent  No more SQL  Implicit getters/setters in ColdFusion  Let’s look at the code...
  • 73. ORM in AIR  Server technology on client?
  • 74. ORM in AIR  Server technology on client?  cfair.swc
  • 75. ORM in AIR  Server technology on client?  cfair.swc  To be found in CFIDE/Scripts/AIR on server
  • 76. ORM in AIR  Server technology on client?  cfair.swc  To be found in CFIDE/Scripts/AIR on server  Works with local SQLite database
  • 77. ORM in AIR  Server technology on client?  cfair.swc  To be found in CFIDE/Scripts/AIR on server  Works with local SQLite database  Need to adjust DTOs with metadata
  • 78. ORM in AIR  Server technology on client?  cfair.swc  To be found in CFIDE/Scripts/AIR on server  Works with local SQLite database  Need to adjust DTOs with metadata  Use SyncManager class
  • 79. ORM in AIR  Server technology on client?  cfair.swc  To be found in CFIDE/Scripts/AIR on server  Works with local SQLite database  Need to adjust DTOs with metadata  Use SyncManager class  No BLOB possible :-(
  • 80. ORM in AIR  Server technology on client?  cfair.swc  To be found in CFIDE/Scripts/AIR on server  Works with local SQLite database  Need to adjust DTOs with metadata  Use SyncManager class  No BLOB possible :-(
  • 81. ORM in AIR  Server technology on client?  cfair.swc  To be found in CFIDE/Scripts/AIR on server  Works with local SQLite database  Need to adjust DTOs with metadata  Use SyncManager class  No BLOB possible :-(  Let’s look at the code...
  • 83. ORM metadata  [Entity]
  • 84. ORM metadata  [Entity]  [Table(name=”name”)]
  • 85. ORM metadata  [Entity]  [Table(name=”name”)]  [Id]
  • 86. ORM metadata  [Entity]  [Table(name=”name”)]  [Id]  [Transient]
  • 87. ORM metadata  [Entity]  [Table(name=”name”)]  [Id]  [Transient]  [Column(name=”name”, columnDefinition=”TEXT| INTEGER|REAL|DATE”, nullable=true|false, unique=true|false)]
  • 88. ORM metadata  [Entity]  [Table(name=”name”)]  [Id]  [Transient]  [Column(name=”name”, columnDefinition=”TEXT| INTEGER|REAL|DATE”, nullable=true|false, unique=true|false)]  [RemoteClass]
  • 90. ORM relationship metadata  [OneToOne(targetEntity=”entity”, fetchType=”EAGER(default)|LAZY”)]
  • 91. ORM relationship metadata  [OneToOne(targetEntity=”entity”, fetchType=”EAGER(default)|LAZY”)]  [OneToMany(targetEntity=”entity”, mappedBy=”entity”, fetchType=”EAGER(default)| LAZY”)]
  • 92. ORM relationship metadata  [OneToOne(targetEntity=”entity”, fetchType=”EAGER(default)|LAZY”)]  [OneToMany(targetEntity=”entity”, mappedBy=”entity”, fetchType=”EAGER(default)| LAZY”)]  [ManyToOne(targetEntity=”entity”, fetchType=”EAGER(default)|LAZY”)]
  • 93. ORM relationship metadata  [OneToOne(targetEntity=”entity”, fetchType=”EAGER(default)|LAZY”)]  [OneToMany(targetEntity=”entity”, mappedBy=”entity”, fetchType=”EAGER(default)| LAZY”)]  [ManyToOne(targetEntity=”entity”, fetchType=”EAGER(default)|LAZY”)]
  • 94. ORM relationship metadata  [OneToOne(targetEntity=”entity”, fetchType=”EAGER(default)|LAZY”)]  [OneToMany(targetEntity=”entity”, mappedBy=”entity”, fetchType=”EAGER(default)| LAZY”)]  [ManyToOne(targetEntity=”entity”, fetchType=”EAGER(default)|LAZY”)]  [JoinColumn(name=”name”, referencedColumnName=”name”)]
  • 96. ORM relationship metadata  [ManyToMany(targetEntity=”entity”, fetchType=”EAGER|LAZY(default)”)]
  • 97. ORM relationship metadata  [ManyToMany(targetEntity=”entity”, fetchType=”EAGER|LAZY(default)”)]
  • 98. ORM relationship metadata  [ManyToMany(targetEntity=”entity”, fetchType=”EAGER|LAZY(default)”)]  [JoinTable(name=”name”)]
  • 99. ORM relationship metadata  [ManyToMany(targetEntity=”entity”, fetchType=”EAGER|LAZY(default)”)]  [JoinTable(name=”name”)]  [JoinColumn(name=”name”, referencedColumnName=”name”)]
  • 100. ORM relationship metadata  [ManyToMany(targetEntity=”entity”, fetchType=”EAGER|LAZY(default)”)]  [JoinTable(name=”name”)]  [JoinColumn(name=”name”, referencedColumnName=”name”)]  [InverseJoinColumn(name=”name”, referencedColumnName=”name”)]
  • 101. What can you do with it?
  • 102. What can you do with it?  Offline applications
  • 103. What can you do with it?  Offline applications  Use DB as temporary storage
  • 104. What can you do with it?  Offline applications  Use DB as temporary storage  Online/offline synchronisation
  • 105. What can you do with it?  Offline applications  Use DB as temporary storage  Online/offline synchronisation  Protect private data
  • 107.
  • 108. Enough technical blabber Let’s just do it !!!
  • 109. Thank You... Twitter: @aikisteve Email: steven@multimediacollege.be Blog: www.multimediacollege.be/blog Personal site: www.flexpert.be

Notas del editor