Subversion Development Models - Local vs. Remote Development
On the heels of my last Subversion post, ColdFusion Version Control with Subversion, here's another...
I recently setup a new Subversion development environment for ColdFusion and thought I would share the two models I considered, what the differences were, and why I ultimately chose the one I did. I actually set both of these models up completely and had them both working, so I went through the entire (slightly painful) process twice.
My development environment consists of the following:
- Subversion (SVN server)
- SVN Book (RTFM)
- CFMX7 Developer Edition (CFMX Server)
- CFEclipse (IDE)
- Subclipse (Eclipse Plugin)
- JavaSVN (Eclipse Plugin for SVN+SSH)
Note: Installing a database server locally is not always required. If you have a constant connection to a development database server you can configure CFMX to remotely access that server from your local machine, eliminating a local administration task.In this setup you will checkout the entire codebase from SVN and work on it locally on your own machine. You might work on it for an hour or for a week before checking the code back into SVN, but you edit code and test it out locally on your own machine, running it through the local CFMX Developer Edition that resides on your machine. Once you're finished editing code and are ready to check the batch of changes back into the SVN repository, you first do an "svn update". This update will download and merge any new changes anyone else has made in the repository since your initial code checkout. If anyone made changes, test your merged code again locally, make changes if needed, and then do an "svn checkin" to upload your new code back into the repository. At this point your code is back in the repository along with everyone else's changes but isn't in a place you can browse with a web browser. After checkin, you may want to look at your code it in some central location, perhaps for testing/QA, or maybe just to make sure it really works on the server. Testing centrally also helps if you are doing development locally on Windows, but using Linux on the server (as I am doing). Fortunately, automatically exporting your code to a web accessible location is easy to do with SVN Hooks. With a SVN Hook, you are essentially writing a short script that is triggered every time anyone does a commit on the repository. To use such a hook, you will want to read these detailed instructions on how to create an SVN Export Script. Pros
- Since developers are each developing locally, they are essentially each in their own sandbox and won't step on each other's toes during development.
- Developers are free to carry their work away from the office. If you checkout code to a laptop with it's own complete local development environment, you can do development anywhere you want, disconnected from the office.
- Local development forces developers to consider Design Patterns that will work across multiple servers and platforms, making code more transportable in the long run.
- There is some amount of overhead for each developer to install and maintain a local development environment. However, I would suggest that a developer not able to maintain their own development environment may need to be looking for another line of work.
- Integrating database changes to a central database can be difficult if there is not a well established plan/system to deal with datamodel changes.
- Depending on the nature of your code, some changes may need to be made to existing applications to allow them to run on any domain/ip/directory structure. (many codebases contain lines such as cfif CGI.HTTP_HOST eq 'my.server.com')
- From a security standpoint you are allowing and encouraging people to bring code home with them. This may or may not present a security risk for your organization.
- Everyone gets their own sandbox to play in, no-one steps on each others toes.
- No-one has to maintain their own personal environment, though the central server does have to be maintained, and each instance does have setting which have to be maintained.
- Security - code never leaves the facility in this model so it's slightly more secure.
- Overhead of setting up and managing many instances.
- You can't effectively use this development model over a wan, though you can checkout code locally (not via WAN) and take it home with you.

# Posted By Dan G. Switzer, II | September 22, 2005 11:54 AM
I have investigated and rejected version control systems in the past because of the nature of our complex/convoluted application/environment. Even though programmers tend to be primarily responsible for separate apps within an overall structure, there is extensive shared header logic and most importantly at least 40 data sources. The number of data sources and complex site configuration makes it impractical to set up an individual environment for each programmer. The reason we have so many data sources is that we talk to Oracle, SQL Server and DB2. For the apps that talk to DB2, each get's its own data source with a unique user name so that we can reconcile mainframe expenses to applications. Right now we have separate Dev, Test and Production environments, but no version control.
The Remote Development/Integration method you describe would be my goal, but I'd rather just have everybody working on the same server instance. Is it possible to check code out to a shared development environment/file structure so I don't have to create an instance for each developer?
# Posted By Spike Henning | June 22, 2006 10:47 AM
# Posted By Paul | January 4, 2009 8:00 PM