2. The State of Your App
● What does your app look like?
● Using other frameworks?
● Partially converted to Coldbox?
● What are your goals?
3. Reasons to migrate to a modern framework
● Code organization
● Devs are all using the same organization and patterns
● Consolidated functionality like logging, caching, tier
detection
● Regular updates
● Makes your dev shop more attractive to prospective
employees
4. Gotcha’s
● You still have to write code
● Not a silver bullet
● Don’t try a full 100% rewrite
● Baby steps are better than trying everything new at once
● Refactor refactor refactor
● The pilot system (write a throwaway test)
5. Install ColdBox
● Environment (tier) detection
● Can use legacy checks for environment
● It’s ok for the ColdBox config to reference old application
variables
● It’s also possible to find/replace legacy code to use
ColdBox settings!
6. Application.cfm -> Application.cfc
● Watch out for transcendent variables scope
○ Use onRequest() if needed
function onRequest( targetPage ) {
variables.mySetting = “myValue”;
include arguments.targetPage;
}
7. Add in ColdBox bootstrap
● ColdBox is always loaded
○ onApplicationStart()
● You get to decide what requests will be
processed by ColdBox
○ onRequestStart()
8. Create a Layout
● Convert your main layout
● Reuse as much as possible via includes
● This will let you start converting views
9. Start plugging in ColdBox aspects
● Proactively convert legacy:
○ Logging -> LogBox
○ Caching -> CacheBox
○ CFC creation -> Wirebox
● This can happen outside of ColdBox!
10. Pick a site area to start
● Maybe something simple like login
● Move .cfm pages into a view
○ Implicit view dispatch
○ Swap out build links calls
11. Handle external URLs
● Just change them and have people update
bookmarks
● Put in URL rewrites at the web server level
● Put in routing in your Application.cfc to
re-route to ColdBox
12. Shorten your feedback loop
● When you have a part of the app working, test it and RELEASE IT!
● Don’t try to save up and do a huge chunk. You’ll never finish!
● Use this as an opportunity to do script conversion, etc but don’t get
bogged down
● Employ group code reviews to discuss conventions and stay on the
same page
● Make sure you update your product owner so they know about your
progress!
13. Legacy/ColdBox App Demo
● https://github.com/bdw429s/coldbox-legacy-app-demo
● Clone repo and start server
● Each page tells you how it works
● Half of the demo site runs legacy .cfm files
● Half of the demo site runs ColdBox handlers