260 likes | 407 Views
Build/Deploy/Upgrade. Joshua Cyr www.usefulconcept.com www.besavvy.com t witer.com/ jcyr. All About Joshua Cyr. Developer - Savvy Content Manager CF User Group Manager CF Since Version 2 Past Team Allaire Member BS in Business Administration Lives in Beautiful New Hampshire
E N D
Build/Deploy/Upgrade Joshua Cyr www.usefulconcept.com www.besavvy.com twiter.com/jcyr
All About Joshua Cyr • Developer - Savvy Content Manager • CF User Group Manager • CF Since Version 2 • Past Team Allaire Member • BS in Business Administration • Lives in Beautiful New Hampshire www.usefulconcept.com www.besavvy.com twitter.com/jcyr www.plurk.com/user/jcyr
Agenda Common Issues In Development, Deployment, Upgrades and Support Useful Resources to Alleviate Issues Remind People of RIAdventureConference/Cruise!
Development Deployment Considerations • Operating Systems • ColdFusion Engines • Shared VS Private Hosting • Mappings • Licensing • Organizing Files
We Support What CF Supports Two Big Issues • Case Sensitivity • File Paths (use / or var) Resource: http://www.coldfusionmuse.com/index.cfm/2008/6/21/portable-coldfusion-linux-and-windows Typically we should support anything that the CF engine supports. That’s the beauty of CF!
ColdFusion Engines • ColdFusion 7,8,9, BlueDragon, Railo, Smith, Others • Not all features supported in all engines. Difficult to test on all without proper resources/software. Resource: http://www.compoundtheory.com/?action=displayPost&ID=334
Shared VS Private Shared Hosting Potential Gotchas • Not all hosts created equal. Many restrict fundamental tags (godaddy). • Sandbox Security (cftemp folder, semi obscure permissions issues, etc.) • Security Concerns (db user/pass, application scope, file paths, etc.) • Server Stability
Shared VS Private • Private Server Gotchas • Your Server vs Client Server • Limited Distribution Potential • Clients Server may be less accessible then shared hosting
Mappings • CF 8+ Makes Life MUCH Easier • Often Not Available w/ hosts. Sometimes hosts make bad mapping /transfer Resource: http://www.numtopia.com/terry/blog/archives/2007/09/coldfusion_8_mapping_application_name.cfm
Licensing • Using 3rd Party Code Saves Time • Check Those Licenses. • Can you distribute?
Organizing Files • File Organization Helps Upgrades • Config Files • Templates / Layout • Main Code • External Libraries
Deployment • Hosted vs Distributed • Users: Experienced vs Not • Database • Configuration
Deployment • Hosted Apps • Potentially one codebase to maintain (not always) • Liability of servers/uptime. • Additional Revenue Model
Deployment • Distributed Apps • Many Customers/Users Require • Potentially Difficult Upgrades • Loss of Server Environment Control
Database • Which Databases Should You Support? • MYSQL MSSSQL most Common • Oracle, Postgres, Derby? • SQL files VS Auto Build • DB Support: Your SQL vs ORM
Auto Build • CF9 ORM with Hibernate • DataMgr will take XML file and build tables/columns/default data from it in almost any db. http://datamgr.riaforge.org/
Auto Build – CF9 ORM Application.cfc: <cfset this.name = "ArtGallery"> <cfsetthis.ormenabled = "true"> <cfsetthis.ormsettings={datasource="cfartgallery", dbcreate="dropcreate"}>
Example employee.cfc <cfcomponentpersistent="true" output="false"> <cfproperty name=“employeeID" type="numeric" fieldtype="id" datatype="integer" generator="identity"> <cfproperty name=“firstname" type="string" /> <cfproperty name=“lastname" type="string“ /> <cfproperty name=“title" type="string“ /> … </cfcomponent>
DataMGR Auto Build / Create XML • The file to create xml: (createxml.cfm)<!--- set up objects ---><cfsetDataMgr = CreateObject("component","DataMgr").init("dev_sourcedb")><cfsetmytablelist = DataMgr.getDatabaseTables()><!--- load in tables from source database ---><cfloop list="#mytablelist#" index="iTables"> <cfsetDataMgr.loadTable('#iTables#')></cfloop><!--- get the xml from the source db ---><cfset synch = createobject("component","DataSynch").init(DataMgr)><cfsetmyxml = synch.getXML()><!--- create the xml file from the source db ---><cffile action = "write" file = "#expandpath('.')#/myxml.xml" output = "#myxml#">
Auto Build / Create Tables - Data • The file to make db: (loaddb.cfm)<!--- load datamgr ---><cfsetDataMgr = CreateObject("component","DataMgr").init("dev_desinationdb")><!--- get the xml file which describes our tables and data ---><cffile action = "read" file = "#expandpath('.')#/myxml.xml" variable="myxml"><!--- create or update the db with all tables, columns and data. ---><cfsetloaddb = DataMgr.loadXML(myxml, true, true)>
Auto Build / Upgrade DataMgr will: • Update default values for new columns. • Make sure default records stay (reinsert if needed) • Add new Columns / Tables to existing DB Wont: • Create Indexes • Scripts for data manipulation on version differences.
Database Support • Write and Test Code On Each DB? • ORM’s make make life much easier.
Configuration • Config file should be intuitive. • Only One primary file! • Saves MANY support issues.
Upgrade Issues • How To Upgrade DB? • New Default Data? • Which Files Need Replacing? • Clear Which Not to be Over Written? • Backwards Compatibility
RIAdventure • Come to my Cruise! • www.riadventure.com • December 6th – 13th • Western Caribbean Cruise • CF/Flex/Air/Mobile (Adobe RIA)
Questions What did I miss? www.usefulconcept.com www.besavvy.com Resources: http://datamgr.riaforge.org/ (datamgr) http://www.transfer-orm.com/ (transfer orm) http://datafaucet.riaforge.org/ (datafaucetorm) http://www.compoundtheory.com/?action=displayPost&ID=334 (Multi CF Engine Testing)