Don't Throw That Out!
Bringing Legacy ColdFusion Code In To
This Century
by Cutter
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
What's The Problem?

There are thousands of outdated applications

Millions of dollars and man hours went in to building these apps

Many never, or very infrequently, updated
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
The Consequences

Poor Performance

Major Security Issues

Hard to Maintain

Difficult To Extend

Publicity Nightmare
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Your Crossroads

Toss it for a COTS app

Toss it for a FOSS app

Write a new app in ColdFusion

Write a new app in “X”

Keep it, and modernize
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Key Considerations

Availability of third party applications

Customizability of those third party apps

Learning Curve/Skill Set

Existing Data

Current Investment

LOE

Resources
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
This Discussion
Here we discuss modernizing that existing
application. Leveraging that previous investment
and institutional knowledge with modern practices
to continue to capitalize on what's already been
created.
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Key Requirements

A Plan

Patience

A Will To Succeed
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Get Current

Modern OS

Modern Web Server

Modern Database Server

Modern Application Server (ColdFusion + Tomcat)

Hardware (?)

Virtual Machines (?)
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Pitfalls Of Getting Current

Will require code changes

Might require SQL changes (and more code changes)

Costs - $ and man power

Will require regression testing
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Some Suggested Tools

Version Control (Git, Subversion, etc)

Modern Editor/IDE (ColdFusion Builder, Brackets, Sublime Text, etc)

Redgate SQL Toolbelt

Application Firewall (FuseGuard?)

Profiling Tools (FusionReactor, SeeFusion, etc)
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Pitfalls Of New Tools

Learning Curve

Costs - $ and man hours
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Get Current (You Personally)
Get at least a basic understanding of the advancements/changes to the
following

CFML/ColdFusion Server

SQL Server (whichever flavor you use)

Key Web Developer Competencies
− HTML
− CSS
− JS
Author's Note: If you don't know these last three, you aren't a web developer
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Revisiting The Crossroads
Are you still certain that refactoring
is the most effective solution?
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Let's
Talk
Code!
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Map Your App
Understand the built-in application framework

Server.cfc
− OnServerStart()

Application.cfc
− Application, Session and Request Event Handlers
− Application level error handling
Map out core event handling in each of the three key areas
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Pitfalls Of Mapping Your App

Will require extensive application review

Will require extensive code changes

Costs – Many Man Hours

Will require extensive regression testing
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Cover Yourself

SQL Injection
− Cfqueryparam
− Cfprocparam

ColdFusion Lockdown Guide

Application Firewall (FuseGuard?)
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Pitfalls Of Covering Yourself

Will require extensive code changes

Will likely require server access

Costs - $ and Many Man Hours

Will require extensive regression testing
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Scope It Out!

Explicitly declare ALL of them

Do so in small, testable, digestable chunks
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Pitfalls Of Scoping

Will require extensive code changes

Costs – Many Man Hours

Will require extensive regression testing
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Understanding
Scope
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Persistent Scopes

Server

Application

Session

Request

(Client)
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Pass Along Scopes

URL

Form

Arguments

Attributes

(Request)
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Pass Along Pitfalls
Think
Security
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Custom Tag Scopes

Attributes

Variables

ThisTag

Caller

(Request)
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
CFC Scopes

This

Variables

Arguments

Local
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Pitfalls of Tag and CFC Scopes
Pick Your Bits
Use The Right Scope
For The Job
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Other Scopes

CGI

Cookie

Thread

Built-In Unscoped Scopes
− Query
− CFFile
− CFCatch
− Etc
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Retrieving Data

Profile

Analyze

Refactor

ORM? Or Not ORM?

Caching
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Dynamic or Static

Cached Content

Generated Content
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Beyond The
Code
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Tune In

RAM Allocation

Garbage Collection Settings

Request Tuning

Queue Timeout

Network Infrastructure and Interface I/O

Pure Processing Power
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
The Road Ahead

Stay On Course

Consider Frameworks

Process
− Develop One
− Document It
− Stick To It

PLAN!
Cutter * Twitter: cutterbl * http://cutterscrossing.com
Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century
Read On
http://www.cutterscrossing.com/index.cfm/Legacy-Code
Cutter

Site: http://cutterscrossing.com

Email: web.admin@cutterscrossing.com

Twitter: cutterbl

Dont throwthatout

  • 1.
    Don't Throw ThatOut! Bringing Legacy ColdFusion Code In To This Century by Cutter
  • 2.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century What's The Problem?  There are thousands of outdated applications  Millions of dollars and man hours went in to building these apps  Many never, or very infrequently, updated
  • 3.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century The Consequences  Poor Performance  Major Security Issues  Hard to Maintain  Difficult To Extend  Publicity Nightmare
  • 4.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Your Crossroads  Toss it for a COTS app  Toss it for a FOSS app  Write a new app in ColdFusion  Write a new app in “X”  Keep it, and modernize
  • 5.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Key Considerations  Availability of third party applications  Customizability of those third party apps  Learning Curve/Skill Set  Existing Data  Current Investment  LOE  Resources
  • 6.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century This Discussion Here we discuss modernizing that existing application. Leveraging that previous investment and institutional knowledge with modern practices to continue to capitalize on what's already been created.
  • 7.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Key Requirements  A Plan  Patience  A Will To Succeed
  • 8.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Get Current  Modern OS  Modern Web Server  Modern Database Server  Modern Application Server (ColdFusion + Tomcat)  Hardware (?)  Virtual Machines (?)
  • 9.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Pitfalls Of Getting Current  Will require code changes  Might require SQL changes (and more code changes)  Costs - $ and man power  Will require regression testing
  • 10.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Some Suggested Tools  Version Control (Git, Subversion, etc)  Modern Editor/IDE (ColdFusion Builder, Brackets, Sublime Text, etc)  Redgate SQL Toolbelt  Application Firewall (FuseGuard?)  Profiling Tools (FusionReactor, SeeFusion, etc)
  • 11.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Pitfalls Of New Tools  Learning Curve  Costs - $ and man hours
  • 12.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Get Current (You Personally) Get at least a basic understanding of the advancements/changes to the following  CFML/ColdFusion Server  SQL Server (whichever flavor you use)  Key Web Developer Competencies − HTML − CSS − JS Author's Note: If you don't know these last three, you aren't a web developer
  • 13.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Revisiting The Crossroads Are you still certain that refactoring is the most effective solution?
  • 14.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Let's Talk Code!
  • 15.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Map Your App Understand the built-in application framework  Server.cfc − OnServerStart()  Application.cfc − Application, Session and Request Event Handlers − Application level error handling Map out core event handling in each of the three key areas
  • 16.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Pitfalls Of Mapping Your App  Will require extensive application review  Will require extensive code changes  Costs – Many Man Hours  Will require extensive regression testing
  • 17.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Cover Yourself  SQL Injection − Cfqueryparam − Cfprocparam  ColdFusion Lockdown Guide  Application Firewall (FuseGuard?)
  • 18.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Pitfalls Of Covering Yourself  Will require extensive code changes  Will likely require server access  Costs - $ and Many Man Hours  Will require extensive regression testing
  • 19.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Scope It Out!  Explicitly declare ALL of them  Do so in small, testable, digestable chunks
  • 20.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Pitfalls Of Scoping  Will require extensive code changes  Costs – Many Man Hours  Will require extensive regression testing
  • 21.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Understanding Scope
  • 22.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Persistent Scopes  Server  Application  Session  Request  (Client)
  • 23.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Pass Along Scopes  URL  Form  Arguments  Attributes  (Request)
  • 24.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Pass Along Pitfalls Think Security
  • 25.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Custom Tag Scopes  Attributes  Variables  ThisTag  Caller  (Request)
  • 26.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century CFC Scopes  This  Variables  Arguments  Local
  • 27.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Pitfalls of Tag and CFC Scopes Pick Your Bits Use The Right Scope For The Job
  • 28.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Other Scopes  CGI  Cookie  Thread  Built-In Unscoped Scopes − Query − CFFile − CFCatch − Etc
  • 29.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Retrieving Data  Profile  Analyze  Refactor  ORM? Or Not ORM?  Caching
  • 30.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Dynamic or Static  Cached Content  Generated Content
  • 31.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Beyond The Code
  • 32.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Tune In  RAM Allocation  Garbage Collection Settings  Request Tuning  Queue Timeout  Network Infrastructure and Interface I/O  Pure Processing Power
  • 33.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century The Road Ahead  Stay On Course  Consider Frameworks  Process − Develop One − Document It − Stick To It  PLAN!
  • 34.
    Cutter * Twitter:cutterbl * http://cutterscrossing.com Don't Throw That Out! Bringing Legacy ColdFusion Code In To This Century Read On http://www.cutterscrossing.com/index.cfm/Legacy-Code Cutter  Site: http://cutterscrossing.com  Email: web.admin@cutterscrossing.com  Twitter: cutterbl