Ryan Vikander's Development Blog - cfObjectivehttp://blog.ryanvikander.com/index.cfm
Development blog that may contain but not limited to entries about Coldfusion, Javascript, Flex, and life. Maybe a splash of video games as well.en-usWed, 19 Dec 2018 05:05:35 -0600Thu, 12 May 2011 13:06:00 -0600BlogCFChttp://blogs.law.harvard.edu/tech/rssr.vikander@gmail.comr.vikander@gmail.comr.vikander@gmail.comnocf.Objective 2011!http://blog.ryanvikander.com/index.cfm/2011/5/12/cfObjective-2011
I was blessed to be able to attend cf.Objective() again this year. I will be posting my notes as I did last year. I hope to meet any of the people that read this blog. I will be the guy with the big beard.
cfObjectiveThu, 12 May 2011 13:06:00 -0600http://blog.ryanvikander.com/index.cfm/2011/5/12/cfObjective-2011cfObjective(): SQLite Database Development for AIR with Raymond Camdenhttp://blog.ryanvikander.com/index.cfm/2010/4/23/cfObjective-SQLite-Database-Development-for-AIR-with-Raymond-Camden
Ray did a good job at talking about SQLite and the basic information on SQLite. I have not used SQLite before and wasn't aware of some of it's functionality and it's limitations.
<span xmlns=''><ul><li><div>Features
</div><ul><li><div>Typeless
</div><ul><li>You can enter characters into an integer field
</li></ul></li></ul></li><li><div>What's Missing?
</div><ul><li>Right outer join, full outer join
</li><li>When altering tables only rename table and add column
</li><li>Views are read only
</li><li>No grant/revoke
</li><li>No stored procedures
</li></ul></li><li><div>What's Missing in AIR?
</div><ul><li>FK Constraints
</li><li>SQLite_Version(), Match()
</li></ul></li><li><div>SQLite In AIR
</div><ul><li>Support in both FLEX and HTML
</li><li>Actionscript API
</li><li>Connecting/Performing Questions/Table Analysis
</li><li>Synchonous and Asynchronous
</li><li>Encryption for "Sensitive" Data
</li></ul></li><li><div>Getting Started
</div><ul><li>Creating a DB
</li><li>SQLConnection.open()
</li><li>SQLConnection.openAsync()
</li><li>Any filename is valid (and any extension)
</li><li>In memory database are supported
</li></ul></li><li><div>Creating Tables
</div><ul><li>With SQL!
</li><li>Create Table if not exists
</li><li>Can also copy a "seed" db
</li><li>Types: Integer, real, text, blob, null
</li><li>Typeless: you can put text in integer
</li><li>Column "Affinities" are used as hints
</li><li>Affinities: Text, Numeric, Integer, real, Boolean, Date, XML, XMLList, Object, None
</li></ul></li><li><div>Performing Queries
</div><ul><li>Uses SQLStatement class
</li><li>Speicfy SQL, Parameters, Connection, events
</li><li>Returns a SQLResult Class
</li><li>Contains Complete, data
</li></ul></li><li><div>Parameters
</div><ul><li>Performance, typing, security
</li><li><div>Named
</div><ul><li>Values(:name, @rank)
</li></ul></li><li><div>Ordered
</div><ul><li>Values (?, ?)
</li></ul></li></ul></li><li><div>Error Handling
</div><ul><li>Uses SQLErrorEvent Class
</li><li>Focus on:Connection issues, sql syntax, constraint errors
</li></ul></li><li><div>Selecting With Class
</div><ul><li>Select results can be bound to ActionSCript Classes
</li><li>Allows for Typed Results
</li></ul></li><li><div>Transactions
</div><ul><li>Gives much better performance for multiple inserts/updates
</li></ul></li><li><div>Paged Results
</div><ul><li>Allows you to paginate through large result sets
</li><li>Stmt.execute(n)
</li><li>Stmt.next(n)
</li></ul></li><li><div>Encryption
</div><ul><li>Uses a key for connection
</li><li>Must be done at creation!
</li><li>Can't change your mind...
</li><li>Keys can be changed (reencryption())
</li><li>Encryptions keys are bytearray (16 bytes)
</li></ul></li><li><div>Schema
</div><ul><li>Gives you access to tables, views, columns.
</li></ul></li><li><div>Tips
</div><ul><li>Using a pre-populated DB
</li><li>Use On SQLSTatement per action
</li><li>LITA is your friend
</li></ul></li><li><div>Air 2?
</div><ul><li>DB Transactions have save points
</li></ul></li></ul></span>
cfObjectiveFri, 23 Apr 2010 17:17:00 -0600http://blog.ryanvikander.com/index.cfm/2010/4/23/cfObjective-SQLite-Database-Development-for-AIR-with-Raymond-CamdencfObjective(): Common Sense Approach to Object Orientated Coldfusion, 2010 Ed. with Brian Melochehttp://blog.ryanvikander.com/index.cfm/2010/4/23/cfObjective-Common-Sense-Approach-to-Object-Orientated-Coldfusion-2010-Ed-with-Brian-Meloche
I was unsure of what to expect at this presentation. But I agreed with Brian on a lot of how Object Orientation in Coldfusion has become over complicated when developing Coldfusion is supposed to be simpler.
<span xmlns=''><ul><li><div>Pre-MX Coldfusion
</div><ul><li>Though OO Coldfusion didn't become popular until components, you could do using custom tags since CF 4 with some issues, Remember Spectra?
</li><li>You'd typically write CF apps old school. Procedurally
</li><li>Many CF developers still build apps this way today
</li><li>Many more still build procedural
</li><li>Before MX you started seeing procedural MVC promoted mostly within the FuseBox community
</li></ul></li><li><div>Modern OO CF
</div><ul><li>Mach-ii was the first modern framework written for OO CF (2003)
</li><li><div>Soon
</div><ul><li>Model-Glue
</li><li>Coldbox
</li><li>Fusebox
</li><li>Coldfusion on Wheels
</li></ul></li><li>Controller/view Based
</li><li>Steeper learning curve
</li></ul></li><li><div>We need design patterns
</div><ul><li><div>As we started building model, we started seeing accepted ways to build model we need:
</div><ul><li>Beans
</li><li>DAOs
</li><li>Gateways
</li><li>Services
</li><li>Value Objects
</li><li>Validators
</li></ul></li><li><div>As our apps got more complex, we needed more design patterns:
</div><ul><li>Singletons
</li><li>Object factories
</li><li>Dependencey injection
</li><li>Inversion of control
</li><li>Coldspring, Lightwire
</li></ul></li></ul></li><li><div>OO Coldfusion
</div><ul><li>Coldspring both simplified code, and added additional complexities to learn
</li><li>Models grew...we need something to manage all this data
</li><li>ORM! Reactor, transfer
</li><li>That's not to say that you need these frameworks to develop OO CF; all are optional.
</li></ul></li><li><div>Modern OO CF - The Good and the bad
</div><ul><li><div>Good:
</div><ul><li>Modular code
</li><li>Separation of business logic, data &amp; presentation
</li><li>Easier to maintain as apps grow
</li><li>Encapsulate logic
</li><li>Reduces the dependences
</li><li>Predictable way of building apps
</li><li>Code generates: illudium, IDEs to generate CFCs CAN* help speed up development
</li></ul></li><li><div>Bad (in currently accepted OO CF Practices)
</div><ul><li>Adds a pretty steep learning curve over old school CF
</li><li>Greatly increases the amount of code needed
</li><li>Takes longer to develop (even with shortcuts)
</li><li>One small change could require changes in for or five files
</li><li><div>Frameworks have:
</div><ul><li>Performance issues
</li><li>Instantiation Times
</li><li>Memory Requirements
</li><li>Some or all of above
</li></ul></li><li><div>Beware of code generators!
</div><ul><li>Tables = objects (a table is not an object)
</li><li>Beware of anti-patterns!!! Can over complexify the model
</li></ul></li></ul></li></ul></li><li><div>Lightfront, lightfront.riaforge.org
</div>
cfObjectiveFri, 23 Apr 2010 12:59:00 -0600http://blog.ryanvikander.com/index.cfm/2010/4/23/cfObjective-Common-Sense-Approach-to-Object-Orientated-Coldfusion-2010-Ed-with-Brian-MelochecfObjective(): Understanding Security In Adobe Air Apps with Jason Deanhttp://blog.ryanvikander.com/index.cfm/2010/4/23/cfObjective-Understanding-Security-In-Adobe-Air-Apps-with-Jason-Dean
Jason Dean did a very good job on this presentation. It was VERY informational on AIR security.
<span xmlns=''><ul><li><div>Is Air secure?
</div><ul><li>Air is not a web application
</li><li>Security is the Developer's Responsibility
</li></ul></li><li><div>AIR is client-side
</div><ul><li>100% client-side
</li><li>Just like a web browser
</li><li>Traffic to server can be intercepted
</li><li>Even if over SSL
</li></ul></li><li><div>Installation and Security
</div><ul><li>Install screen cannot be modified
</li><li>Except for the certificate
</li><li><div>Code-signing Certificate
</div><ul><li>Applied through a company like Versign
</li><li>Proves that the developer is you
</li></ul></li></ul></li><li><div>Updating
</div><ul><li>Ye, updating is a security concern
</li><li>Do NOT count on your users
</li><li>YOU need to push new security fixes / features
</li><li>Update notifications are required
</li><li>If you do nothing else in your first version, make sure your app is self updating.
</li></ul></li><li><div>File System
</div><ul><li><div>Has same permissions as the user logged in
</div><ul><li>Any permission to the files the user has the AIR app has as well
</li></ul></li><li>Developers should not use the file system that could harm the system.
</li></ul></li><li><div>File System Best Practices
</div><ul><li>Apply to reading and writing
</li><li>Do not allow Dynamic paths to be set
</li><li>Try to use user and app specific file storage
</li><li>The Static flash.fileSystem.File class has properties for system locations
</li><li>Sensitive data should be encrypted before placing on the file system
</li></ul></li><li><div>Open Files in Default Application
</div><ul><li>AIR 2.0 offers the ability
</li><li><div>It does limits the type
</div><ul><li>Does not allow execute zip, terminal, app, automater, exe, url, cdm, bat, csh, com, lnk, pif, jar, and more
</li></ul></li></ul></li><li><div>Encrypted Local Store
</div><ul><li>Alternative to storing data on the file system or in the db
</li><li><div>Uses the OS sore
</div><ul><li>Keychain for OSX
</li><li>DPAPI for Windows
</li><li>Either KeyRIng or Kwallet for Linux
</li></ul></li><li>Stores Binary data
</li><li>Persistent Storage but can be lost.
</li><li>Great for small bits of data (severe performances issues at 10mb)
</li><li>Per-user, per-application store
</li><li>Uses 128-bit AES/CBC Encryption
</li></ul></li><li><div>ELS StronglyBound
</div><ul><li>Normally, ELS certification is bound only to publisher ID
</li><li>The stronglyBound property allows you to more strongly bind the ELS
</li><li>Binds to the bits of app as well
</li><li>If the app changes, then the ELS data will be inaccessible and need to be re-created
</li><li>This includes when the app is updated
</li><li>Really does not offer additional security
</li><li>Better off not using it
</li></ul></li><li><div>Certificate Replacement
</div><ul><li>Vulnerability in the ELS
</li><li>Installed app get replaced by a copy with a different publisher certificate
</li><li>All Data prior to replace is safe
</li><li>All data after replacement is threatened
</li><li>Difficult to perform this attack
</li></ul></li><li><div>Native Processes
</div><ul><li><div>AIR app must be packaged as a native installer
</div><ul><li>DMG,EXE,RPM,DEB
</li></ul></li><li>Extended Desktop profile
</li><li>Uses the same type of code-signing certificate
</li><li>ANY executable can be run
</li><li>BAT files are still prohibited on Windows
</li><li>Is any part of the dynamic statement from a third-party?
</li></ul></li><li><div>AIR has sandboxes
</div><ul><li>Used to separate content
</li><li>Used to separate permissions that your application
</li></ul></li><li><div>Application Sandbox
</div><ul><li>Directory where the application is installed
</li><li>Allowed full access to the AIR API
</li><li>All subfolders and files too
</li><li>Restricted from loading JS files from remote locations
</li><li>Only files in the sandbox can use the local file system
</li><li>Restricted from using code that converts string into executable code
</li><li>Except while the page is loading.
</li></ul></li><li><div>Non-Application Sandboxes
</div><ul><li><div>Flash Player Security Model/Browser Model
</div><ul><li>Remote
</li><li>Local-trusted
</li><li>Local-with-network
</li><li>Local with filesystem
</li></ul></li><li>Have NO access to the AIR API
</li><li>Can run code that turns string into executable code
</li><li>Some other minor restrictions to JS apply
</li></ul></li><li><div>Code restrictions
</div><ul><li><div>Application Sandbox
</div><ul><li>Eval
</li><li>innerHTML
</li><li>Src Attrib
</li><li>Javascript:
</li><li>setTimeout
</li><li>setInterval
</li><li>Document.write
</li><li>XMLHTTPRequest (onload)
</li></ul></li><li><div>Non-Application Sandbox
</div><ul><li>AIR API
</li><li>XMLHTTPRquest???
</li><li>Window.Open()
</li></ul></li></ul></li><li><div>Avoiding Restriction Errors
</div><ul><li>Map app content to a different sandbox
</li><li>Rewrite code to not use EVAL
</li><li><div>Rewrite code for setTImeout and setInterval
</div><ul><li>Pass in a unanymous function into settimeout
</li></ul></li><li>Rewrite JS URL syntax
</li></ul></li><li><div>Sandbox Bridge
</div><ul><li>A path for one sandbox to access properties and methods from another
</li><li>Involves a parent and a child
</li><li>Works both ways
</li><li>Uses properties childSandboxBridge and parentSandBoxBridge
</li></ul></li><li><div>Cross-Domain Requests
</div><ul><li>Request to a domain other than the originator
</li><li>AIR Apps can run on the desktop, so any request to remote resources are corss-domain
</li><li>Flash and Flex require cross-domain.xml
</li><li>HTML/JS apps do not.
</li><li>Of course just like in the browser, traffic is viewable.
</li><li>SSL will only protect from eaves droppers.
</li></ul></li><li><div>Inter-Application Communication
</div><ul><li>Two applications on the local machine to talk with each other
</li><li>With AIR appps can be done through localConnection class
</li><li>Allows communication between an AIR app and a SWF in browser
</li><li>Communications between two LocalConnections(same domain) is Secure
</li><li><div>Traffic between domains can be allowed using
</div><ul><li>AllowDoman()
</li><li>AllowInsecureDomain() (allows non-SSL)
</li></ul></li><li>In AIR 2.0 communication between AIR app and native app can be done using Sokcets
</li></ul></li><li><div>Local Database
</div><ul><li><div>AIR and SQLite Security
</div><ul><li>By default not secure
</li><li>Unless locked in a closet
</li><li>Susceptible to SQL Injection
</li><li>Unencrypted, over-writable, and accessible by other apps
</li><li>Other apps can read contents or even all.
</li></ul></li><li><div>Encrypted Database
</div><ul><li><div>Prevent Snooping
</div><ul><li>AIR provides support for Encrypted SQLLite DBs
</li><li>Easy to do
</li><li>Strong Encryptions (AES-128)
</li><li>Keeps other apps from being able to open the DB
</li><li>Will NOT prevent them from deleting or copying the DB
</li></ul></li><li>Using an Encrypted Database
</li><li>Encrypted DB Considerations
</li><li>Don't hard-code the encryption key
</li><li>Weak Password == Weak Key
</li><li>Data in memory is unencrypted
</li><li>Shared DBs mean shared DB key
</li><li>Keys can be stored in the ELS
</li><li>If the key is lost, so is the data
</li></ul></li></ul></li><li><div>Coldfusion AIR Offline Support
</div><ul><li>Coldfusion 9 introduced
</li><li>AIR Sync with CF9
</li></ul></li><li><div>User Input Validation
</div><ul><li>Validate everything
</li></ul></li><li><div>Code Transparacy
</div><ul><li>Everything can be seen
</li></ul></li><li>Best Practices
</li><li>Sign your code
</li><li>Validate, validate, validate
</li><li>Understand sandboxes
</li><li>Enable self-updating
</li><li>Use the ELS and Encrypted DBs
</li><li>Think wisely about sandbox bridges
</li><li>XML signature validator
</li><li>Use the EncyrptionKeyGenerator
</li><li><div>Read the docs and try things out
</div>
cfObjectiveFri, 23 Apr 2010 12:32:00 -0600http://blog.ryanvikander.com/index.cfm/2010/4/23/cfObjective-Understanding-Security-In-Adobe-Air-Apps-with-Jason-DeancfObjective(): Speedy Websites: Through Better Front-End Optimization with Peter Farrellhttp://blog.ryanvikander.com/index.cfm/2010/4/23/Speedy-Websites-Through-Better-FrontEnd-Optimization-with-Peter-Farrell
The first of the sessions I attended. This session I really liked. I have never really looked at the different rules that websites can break causing pages to be slower. This session was VERY informational and probably one of my favorites. Peter Farrell did a really good job with this session. And here is the notes. Also this is just a copy paste from OneNote so I apologize for the weird icons.
<span xmlns=''><ul><li><div>80% of the time a page loads is spent on HTTP request.
</div><ul><li>20% is spent on back end requests like queries.
</li></ul></li><li><div>Tools
</div><ul><li><div>Firebug
</div><ul><li><div>Yslow
</div><ul><li>Developer.yahoo.com/yslow
</li></ul></li><li><div>Google Page speed
</div><ul><li>Code.google.com/speed/page-speed
</li></ul></li></ul></li></ul></li><li><div>The 34 Rules
</div><ul><li>It's not wise to violate rules until you know how to observe them - T.S. Elliot
</li><li><div>Content RUles
</div><ul><li><div>Minimize HTTP requests
</div><ul><li>Reduce # of components on files
</li><li>Combine JS files into 1 file.
</li><li>For images use CSS sprites
</li><li>Imagemaps
</li></ul></li><li><div>Reduce the # of DNS lookups
</div><ul><li>20-100 seconds to do a DNS lookup
</li><li>IE caches DNS lookups for 20 minutes.
</li><li>Firefox caches for 1 minute
</li><li>Too many hosts can penalize a page. Limit to 2-4 hosts per page.
</li></ul></li><li><div>Avoid Redirects
</div><ul><li>Redirects are slow
</li><li>Browsers will NOT cache redirects
</li><li>Trailing /s can cause penalties.
</li></ul></li><li><div>Make AJAX cacheable
</div><ul><li>Set expires header with cfhttpheader
</li><li><div>Post loading components instead of pre loading
</div><ul><li>Drag and drop features could be post loaded
</li><li><div>Photo gallery
</div><ul><li>Load first image instead of the rest.
</li></ul></li></ul></li><li><div>Preloading
</div><ul><li>Unconditional Preload
</li><li>Conditional Preload
</li><li>Anticipated Preload
</li></ul></li><li>Reduce the # of DOM elements
</li></ul></li><li><div>Split your components across domains
</div><ul><li>Ex: static.google.com
</li></ul></li><li><div>Minimize iframes
</div><ul><li>If iFrame stalls out, your page stalls out
</li></ul></li><li><div>No 404 errors
</div><ul><li>Slows down user experience
</li><li>Send back light 404 error pages
</li></ul></li></ul></li><li><div>Server Rules
</div><ul><li><div>User a Content Delivery Network (CDN)
</div><ul><li>Using a CDN improved Yahoos load time by 20%
</li></ul></li><li><div>Add Expires or Cache-Control Header
</div><ul><li>Turn expire headers on specific static stuff (images)
</li></ul></li><li>Gzip Components
</li><li><div>Configure Etags
</div><ul><li>Turn eTags on when serving one host
</li></ul></li><li>Flush Buffer Early
</li><li><div>Use GET for Ajax Requests
</div><ul><li>POSTs are 2 step process
</li><li>IE only allows for URLs that are 2KB long
</li></ul></li><li><div>Avoid Empty Image Src
</div><ul><li>Browsers do weird things with blank src tags
</li><li>Makes request to the directory of current page
</li></ul></li></ul></li><li><div>Cookie Rule
</div><ul><li><div>Reduce the size of cookie
</div><ul><li>When making a request all the cookies get sent
</li><li>*.mydomain.com = bad. Be mindful of domains
</li><li>Set expire date
</li></ul></li><li>Use Cookie-free domains
</li></ul></li><li><div>CSS Rules
</div><ul><li><div>Put stylesheets in the head
</div><ul><li>Allows for the page to load progressively
</li></ul></li><li>Avoid CSS expression
</li><li>Choose to use XML link over at import
</li><li><div>Avoid filters
</div><ul><li>_ filter hack
</li></ul></li></ul></li><li><div>Javascript Rules
</div><ul><li>Put Javascript rules as far on the page as possible
</li><li><div>Make css and js external files
</div><ul><li>Cacheable
</li></ul></li><li><div>Minify external css and js files
</div><ul><li>Minimize can be a 21% reduction
</li><li>Jasmine
</li></ul></li><li><div>Remove duplicate script
</div><ul><li>IE will request a file if it finds a duplicate
</li></ul></li><li>Minimize the access to the DOM
</li></ul></li><li><div>Image
</div><ul><li>Optimize Images
</li><li>Use CSS Sprites
</li><li><div>Don't scale with HTML
</div><ul><li>Create thumbnail
</li></ul></li><li><div>Make your favicon small and cacheable
</div><ul><li>Under 1 Kb
</li><li><div>Set an expires header
</div>
cfObjectiveFri, 23 Apr 2010 12:07:00 -0600http://blog.ryanvikander.com/index.cfm/2010/4/23/Speedy-Websites-Through-Better-FrontEnd-Optimization-with-Peter-FarrellcfObjective 2010http://blog.ryanvikander.com/index.cfm/2010/4/22/cfObjective-2010
I am currently attending this great conference. I will probably post my notes on here that I take throughout the conference.
cfObjectiveThu, 22 Apr 2010 19:13:00 -0600http://blog.ryanvikander.com/index.cfm/2010/4/22/cfObjective-2010cf.Objective() Attendee...http://blog.ryanvikander.com/index.cfm/2010/3/13/cfObjective-Attendee
Just a quick blog but I am excited to say that I am greatful to be able to attend cfObjective this year. I attended last year's event and had a great time learning new stuff whether it's about a framework that I have not seen before or just new coding techniques. I feel like last years event had motivated me in ways that I think has helped me as a developer. Not only did I learn new developing techniques but also fell in love with the art of user group meetings I guess you could say. I know that there is a local twin cities CFUG group but I hate driving to Minneapolis if I don't have to. I started up an internal Imagetrend user group meetings that seems to interest a lot of my co-workers. Usually I see turn outs of 15 people consistently which I think is pretty good. Anyways I digress, I cannot wait for this years conference and I will probably blog my thoughts and opinions on each of the sessions I tend. Hopefully to those that do read my blog and are attending the event I will get to meet you. I will be the big guy with the Halo tattoos hah.
cfObjectiveColdfusionSat, 13 Mar 2010 11:52:00 -0600http://blog.ryanvikander.com/index.cfm/2010/3/13/cfObjective-Attendee