SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Plus 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
 

Plus 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
 

Dernier

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Dernier (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

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

Notes de l'éditeur