<?xml version="1.0"?>
<rss version="2.0">
<channel>
	<title>dopefly.com: The Dopefly Tech Blog</title>
	<link>http://www.dopefly.com/techblog/</link>
	<description>Join Nathan Strutz as he shoots the breeze on techie geeky web dev stuff.</description>
	<language>en-us</language>
	<webMaster>mrnate@dopefly.com (Nathan Strutz)</webMaster>
	<pubDate>Mon, 09 Aug 2004 12:00:00 PST</pubDate>
	<lastBuildDate>Mon, 08 Jun 2009 21:06 PST</lastBuildDate>
	<ttl>30</ttl>

	
	<item>
		<title>Technical Debt</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=314</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=314</guid>
		<description><![CDATA[Technical Debt has been talked about a lot, but I have been thinking about pretty hard lately. Here's the concept: Make economic analogies for application development to help you (and especially your boss) understand code quality.<br/><br/>Let me lay it down so you can pick it up.<br/><br/>When you write code, you're making a monetary investment, be it in your own time or knowledge, there's been money spent. If it's not literal money, suspend your disbelief for a second when we pretend that your work is worth some arbitrary amount of cash. There's an amount you should spend to complete a given application, especially to do it right.<br/><br/>Now, when you take a shortcut in your programming, you save money up front. You can finish faster, but you're borrowing time, thus borrowing money. Eventually, that money has to be paid back, and you <em>will</em> pay it back.<br/><br/>Paying back technical debt means refactoring the application to undo those coding shortcuts, adding unit tests, making the application maintainable and adhering to best practices. The closer you are to the time you acquired the debt, the easier it is to pay it off. Think of credit cards; pay those off at the end of the month or else you accumulate interest.<br/><br/>Oh, and it's the interest payments that will really kill you.<br/><br/>Until you pay off that technical debt, every time you touch the application, you have to pay interest. In the past, you borrowed time from the future. Now the <a href="<br/>http://en.wikipedia.org/wiki/Cruft">cruft</a> in the code makes any subsequent task take longer. That is your interest payment. It comes off the top and you never pay it off until you remove the crufty code.<br/><br/>Code with high technical debt tends to be brittle. One change means everything breaks, so we spend our time being extra careful, or by accidentally creating a wide range of errors across the application. Interest makes programming harder, and harder is not what we need.]]></description>
		<category>Software Quality</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=314</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Tue, 25 May 2010 19:32:00 PST</pubDate>
	</item>
	
	<item>
		<title>The Single Greatest iPhone Ringtone Ever</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=313</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=313</guid>
		<description><![CDATA[It's a simple concept, really. Think about it. What sound makes you sit up a little straighter? What sound makes you want to run forever? What sound makes you want to kick a turtle more than anything else you have ever heard in your lifetime?<br/><br/>The answer is obvious. You must be thinking of the <em>invincible</em> music from the original Super Mario Bros, circa 1985. As soon as you picked up the star, nothing could stop you. Fire breathing plants and flying fish fall by your wayside as you don the seizure-inducing clothes.<br/><br/>As a ringtone, this invincible music will own your attention every time. Your eyebrows will lift. Your heart will beat a little faster. Your hands may sweat.<br/><br/>As a final insult, as if you needed it, when you don't answer it soon enough, it goes into one minute left double time music. Yes, that's invincible on speed. Your b-sprint finger cannot handle ringtones of this magnitude.<br/><br/>USE WITH CAUTION<br/><br/>Download this <a href="Nintendo-Invincible.m4r">Mario Bros Invincible iPhone Ringtone</a> now!<br/><br/>It's 500KB, m4r, just add it to iTunes, sync and change your ringtone global or per-contact settings. I made it with Adobe Soundbooth using a free wav file I found somewhere, and I converted it to m4r with <a href="http://audiko.net/">audiko.net</a>. Not responsible for damage.<br/><br/>*Update: By request, an <a href="Nintendo-Invincible.mp3">MP3 version</a> for you lucky ducks using Android phones. 400KB.]]></description>
		<category>General</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=313</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Wed, 14 Apr 2010 22:32:00 PST</pubDate>
	</item>
	
	<item>
		<title>12 ways to reuse your ColdFusion code</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=312</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=312</guid>
		<description><![CDATA[It's no doubt that <a href="http://en.wikipedia.org/wiki/Code_reuse">code reuse</a> is an important part of programming. Here's a list of ways you can do it while you're programming in ColdFusion.<br/><br/><ol>
<li><code>&lt;cfinclude template=&quot;file.cfm&quot;&gt;</code>
<br/>This is the most basic server-side include, which pulls one file into another. There is no way to send parameters to the included file (besides setting variables before the include). The included template can by dynamic using a <code>#variable#</code>. Unlike classic ASP, the file is included only when the tag executes.</li>
<br/><li><code>include &quot;file.cfm&quot;</code>
<br/>This is the cfscript version of the <code>cfinclude</code> tag and behaves similarly.</li>
<br/><li><code>&lt;cf_file attribute1=&quot;value1&quot;&gt;</code>
<br/>This is Custom Tag syntax. You can use this to send parameters at an included file. In this example, file.cfm exists either in the relative current directory, in a custom tag path specified by your Application.cfc file, or in a custom tag path specified in the CF Administrator.</li>
<br/><li><code>&lt;cfmodule [name= or template=] &gt;</code>
<br/>Similar to the custom tag model, but you can use any file with a relative path.</li>
<br/><li><code>&lt;cfimport namespace=&quot;imported&quot;&gt; ... &lt;imported:file /&gt;</code>
<br/>Specify a directory and namespace, and you can use this JSP style include. The <code>cfimport</code> tag must be applied on every template you wish to use the namespaced file set in. Imported files behave like custom tags in that they use attributes and can have a closing tag, but it can also be used for JSP tagsets.</li>
<br/><li><code>&lt;cffunction name=&quot;reusable&quot;&gt;&lt;/cffunction&gt;</code>
<br/>Defines a reusable function, method or subroutine of your application. You can type this anywhere in your application, except within another function.</li>
<br/><li><code>function reusable() {}</code>
<br/>This is the cfscript version of <code>cffunction</code>. Since CF9, it can use extra syntax to give more metadata and control like the tag-based version has.</li>
<br/><li><code>&lt;cfcomponent&gt; ... &lt;/cfcomponent&gt;</code>
<br/>This is the root element of a .cfc file. Any code within is executed immediately upon instantiation (see cfobject). The methods (functions) within are executed upon request.</li>
<br/><li><code>component { ... }</code>
<br/>This is the cfscript version of defining a CFC. This also provides the only way to write cfscript without the <code>cfscript</code> tags.</li>
<br/><li><code>&lt;cfobject &gt;</code>
<br/>Creates an instance of (a.k.a. "instantiates") an object, which could be Java, .NET, a web service, or a variety of others, but in this case, we are talking about creating an instance of a ColdFusion Component (CFC) or ColdFusion web service.</li>
<br/><li><code>createObject(&quot;component&quot;, &quot;myComponent&quot;)<br/>new myComponent()</code>
<br/>cfscript versions of <code>cfobject</code> and traditionally the easiest way to create an instance of any CFC.</li>
<br/><li><code>&lt;cfinvoke&gt;</code>
<br/>Invokes a method on an object or webservice, instantiated or not.</li>
</ol>
<br/>That's a big list!<br/>]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=312</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Thu, 08 Apr 2010 09:36:00 PST</pubDate>
	</item>
	
	<item>
		<title>Solving the problem with too many choices</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=311</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=311</guid>
		<description><![CDATA[Yesterday I talked about how we have <a href="/techblog/entry.cfm?entry=310">too many choices</a> when people get started using ColdFusion. There were some really good comments, and the consensus was that more is always better. I agree with that, for the most part. I promised I would share my idea for a solution.<br/><br/>My opinion is that <em>you have to try them all</em>. Yeah that sucks but there's a lot of truth to it. You just can't get a feeling for a tool until you try to make something with it.<br/><br/>For an IDE, spend a week with it. For any type of framework, make a little sample app - I like to make a generic list-add-delete program, which gives me enough of a feel for where things go and how you interact with them. Experimentation is essential.<br/><br/>That's my opinion, but the solution is not good enough. What can we do so people don't have to try everything, every time?<br/><br/>I hate to point out problems without offering the solution, but worse yet, I hate offering a solution without offering to do any work. So here I am, a hater. If someone starts it, I would pitch in.<br/><br/>We need a wiki that compares and contrasts all of our options. They need to be categorized (like I did above), give a short description, explain the popularity (or lack thereof), show some screenshots or code, talk about how they work compared to other options, discuss downsides and difficulties that people have (especially problems that new initiates have, all in order to overcome them), and finally, provide links to the most popular resources.<br/><br/>The best we have as of today is <a href="http://corfield.org/blog/index.cfm/do/blog.entry/entry/Which_Framework">
Sean Corfield's framework comparison</a> discussions. They're outdated now, and it was a valiant effort, but not good enough.<br/><br/>And with that, I'm going to end it abruptly, again.]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=311</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Sat, 03 Apr 2010 15:57:00 PST</pubDate>
	</item>
	
	<item>
		<title>Are there too many choices in ColdFusion?</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=310</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=310</guid>
		<description><![CDATA[Too many choices is both a way to fail and a way to succeed. The choices make it undoubtedly more difficult to choose your development path. Let's talk about some of these choices.<br/><br/>IDEs: CFEclipse or ColdFusion Builder for Eclipse lovers. Dreamweaver and HomeSite for the traditional people. And then there is the plethora of other multi-purpose-but-supports-CF notepad replacements, including but not limited to: TextMate, Notepad++ and jEdit.<br/><br/>Front Controller Frameworks. Fusebox, Mach-II, Model-Glue, ColdBox, OnTap and CFWheels, not to mention the newer minimal frameworks, FB3Lite, LiteFront and FW/1.<br/><br/>ORM tools, from Transfer to Reactor, CFWheels' built-in ORM and Hibernate via CF9's ORM.<br/><br/>Bean Factory / Dependency Injection Frameworks, including ColdSpring, ColdSpring Lite and LightWire.<br/><br/>Servers: Adobe ColdFusion 8 or 9, in demo, developer, professional or enterprise flavors. BlueDragon JX, Java or .NET in enterprise or standard and Open BlueDragon, and Railo regular, express with Jetty, express with Resin or custom.<br/><br/>And that's leaving out most of the alternatives that are <em>pure crap</em>, as well as not even thinking about entire categories of applications like CMS', Blogs, Wikis, and so on.<br/><br/>There are a lot of things a new developer has to weed through. How do you choose?<br/><br/>This is sort of an abrupt ending, so I'll try to hit this again tomorrow.]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=310</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Fri, 02 Apr 2010 10:11:00 PST</pubDate>
	</item>
	
	<item>
		<title>Front Controller Frameworks Suck</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=309</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=309</guid>
		<description><![CDATA[I always hated them for this one reason. How do you explain this URL:<br/><br/><code>www.example.com/index.cfm?fuseaction=main.default</code>
<br/><br/>What I dislike about that is...<br/><ul>
<li>It's hard for your users to remember or even type</li>
<li>It's ugly to see</li>
<li>Your web stats say everyone visited one page - index.cfm - they had different query strings, but they only visited one page</li>
<li>Your SEO is hurt. How does the googlebot know the difference in importance between the fuseaction query param over any other params? Sure, it's smart, it knows, but it can't <em>really</em> know, you know?</li>
<li>It reduces the number of results in <a href="http://www.google.com/search?q=allinurl%3A.cfm">this search</a></li>
</ul>
<br/>Really, it comes down to your users, their experience, and how they see your application. While it's not as important as your usability, design, content or uptime, it does take away from the overall quality.<br/><br/>So what can be done about this problem? Few have tried, some have succeeded. Here are the strategies that are out there.<br/><br/><ul>
<li>CFM pages everywhere.<br/>This is generally the opposite of using a framework. All of the hassle, none of the benefit.</li>
<li>URL Rewriting. As requests come to the server with an attractive URI, they are translated into whatever your application needs to load it by.<br/>This is a good strategy, and it works well. On Windows with IIS, most of the software is either expensive or buggy, and definitely not portable. On Apache, mod_rewrite is great. Either way, you cannot make a cross-platform solution, meaning URL rewriting on an open source project is a no-go.</li>
<li>Generated CFM pages everywhere.<br/>You have software that spits out static files from dynamic actions in your framework, that call back in to your framework. In our example, a /main/default.cfm page would be generated that may set the fuseaction querystring parameter and invokes the framework. This is a great solution, but I've never heard of anyone putting it to practice. Writing this software is deceptively complex.</li>
<li>The OnMissingTemplate rerouting method.<br/>You link to pages that do not exist, then have an onMissingTemplate handler in your Application.cfc file that redirects requests to your framework with the right parameters. This new URL might look like example.com/main/default.cfm, which doesn't exist, so your onMissingTemplate method fakes like it's the ugly URL and invokes the framework.</li>
</ul>
<br/>Can anyone think of another method of doing it?<br/><br/>Personally, I like the OnMissingTemplate method a lot. The distinct advantage above the URL rewriting method is that this one is portable without installing other software. Of course it doesn't work everywhere, but it almost always will.<br/><br/>In summary, make your users happier and write your next application with a better SES strategy.]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=309</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Tue, 02 Mar 2010 08:09:00 PST</pubDate>
	</item>
	
	<item>
		<title>Basic MVC is a Gateway Drug</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=308</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=308</guid>
		<description><![CDATA[My last blog entry was about <a href="/techblog/entry.cfm?entry=307">how to create the easiest ever MVC application</a>, but looking at it, you have to see where you'll just start repeating things all over the place. I mean, look at this code:<br/><br/><em>/app/controller/main.cfm</em>
<pre>&lt;cfinclude template=&quot;../model/main.cfm&quot; /&gt;<br/>&lt;cfinclude template=&quot;../view/main.cfm&quot; /&gt;</pre>
<br/>Are we going to have to do that for every controller? That's some serious boilerplate stuff that really shouldn't have to be typed every time. What a pain that would be!<br/><br/>So lets see what we can do to fix that. What we need is a generic controller that will do most of the job, most of the time, but allow us to do special work when we need it. I hate to use the &quot;F&quot; word, but I'm going to - this is a Framework. <em>Worse yet</em>, it's your standard run-of-the-mill front controller framework. I know, I hate it too, but hear me out.<br/><br/>There's a real easy, real obvious reason for doing it like that. No, I'm really not a fan, but I do it all the time, right along with everyone else. Let's see what it takes to make our MVC quasi-framework happen.<br/><br/><em>/app/controller.cfm</em>
<pre>&lt;cfparam name=&quot;action&quot; default=&quot;main&quot; /&gt;<br/>&lt;cftry&gt;<br/>&nbsp;&nbsp;&lt;cfinclude template=&quot;controller/#action#.cfm&quot;/&gt;<br/>&nbsp;&nbsp;&lt;cfcatch /&gt;<br/>&lt;/cftry&gt;<br/>&lt;cftry&gt;<br/>&nbsp;&nbsp;&lt;cfinclude template=&quot;model/#action#.cfm&quot;/&gt;<br/>&nbsp;&nbsp;&lt;cfcatch /&gt;<br/>&lt;/cftry&gt;<br/>&lt;cftry&gt;<br/>&nbsp;&nbsp;&lt;cfinclude template=&quot;view/#action#.cfm&quot;/&gt;<br/>&nbsp;&nbsp;&lt;cfcatch /&gt;<br/>&lt;/cftry&gt;</pre>
<br/>Now hitting <em>/app/controller.cfm?action=main</em> includes the main controller, model and view automatically, and if they don't exist, it just ignores them. Easily done, no redundant typing, very little pain.<br/><br/>Congrats, we've just made a framework. It's cheap, but it works.]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=308</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Wed, 24 Feb 2010 16:39:00 PST</pubDate>
	</item>
	
	<item>
		<title>Easiest Ever MVC with ColdFusion</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=307</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=307</guid>
		<description><![CDATA[Slowing down and backing up, this is a very quick introduction to making an <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> application in ColdFusion.<br/><br/>First, make yourself an appropriate directory structure. Follow along here, it's really simple.<br/><img src="mvc-simple.png" /> <br/><br/>There are <span class="st">a hundred</span> <span class="st">a thousand</span> infinite different ways to go from here. Let's try the most basic way I can think of. Your browser should always hit the controller no matter what, so let's put in an index.cfm to redirect <em>/app/</em> visitors to a default controller, <em>/app/controller/main.cfm</em>.<br/><br/><em>/app/index.cfm</em>
<pre>&lt;cflocation url="controller/main.cfm" /&gt;</pre>
<br/>Now that main.cfm controller file: <em>/app/controller/main.cfm</em>
<pre>&lt;cfinclude template="../model/main.cfm" /&gt;<br/>&lt;cfinclude template="../view/main.cfm" /&gt;</pre>
<br/>And the model: <em>/app/model/main.cfm</em>
<pre>&lt;cfset name = "Nathan" /&gt;</pre>
<br/>Finally, the view: <em>/app/view/main.cfm</em>
<pre>&lt;cfoutput&gt;Hello, #name#!&lt;/cfoutput&gt;</pre>
<br/>That is about as simple as an MVC application can be, and from there, you can begin to enjoy the <a href="http://stackoverflow.com/questions/26685/">advantages of MVC</a>.<br/><br/>You can <a href="mvc-simple.zip">download this very simple MVC app</a>.<br/>]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=307</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Wed, 17 Feb 2010 21:19:00 PST</pubDate>
	</item>
	
	<item>
		<title>Reminder: Talk about the basics (and 6 reasons to do it)</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=306</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=306</guid>
		<description><![CDATA[We tend to forget about the basics. Once we've mastered them, we move on to whatever else interests us. When beginning a learning project, we grow the most, we post the most questions, answers and blog entries, and we talk about our beginner problems the most. Later on, we stop talking about what it's like to get started, and for good reason, we're not getting started. It's out of sight, out of blog.<br/><br/>Take me, for instance. I have become so wrapped up in OO, design patterns, frameworks and extensibility, that I've nearly forgotten there are loads of new developers out there, hoping to learn something from the likes of me.<br/><br/>But big deal, why should we even talk about the basics? Well lucky for the universe, I've compiled this list, because we all love lists.<br/><br/>Talking about the basics...<br/><ol>
<li>Gives you something to blog about<br/><div class="small">I have like 2 posts for the entire year so far. I need some new subjects.</div></li>
<li>Ups your search results ranking, bringing more traffic to your web site<br/><div class="small">And who doesn't want more traffic? Not me, man, I want it all.</div></li>
<li>Increases the stability of the global knowledge on the given subject<br/><div class="small">Maybe esoteric and meta, but it's true. Sometimes old resources go dry, while new ones are usually prettier.</div></li>
<li>Increases the keyword rank<br/><div class="small">Increase the google trends ranking. Increase the general popularity of your subject. Get uninitiated people interested in a "that looks easy" kind of way.</div></li>
<li>Gets uninitiated people interested<br/><div class="small">If you have them saying "Hey, I can do that, it's easy" then you can add to the numbers of those working in your world.</div></li>
<li>Guarantees your high place in the minds of the unknowing<br/><div class="small">Readers like a hero, and you'll like people coming up to you, years later, expressing their gratitude.</div></li>
</ol>
<br/>So with that, I hereby to promise to talk about (at least a few) easier concepts, (at least a little) more often. I'll use this blog to do it. I promise to use my position as a ColdFusion software user's group manager for the benefit of newer programmers and recent and future converts.]]></description>
		<category>General</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=306</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Thu, 11 Feb 2010 20:57:00 PST</pubDate>
	</item>
	
	<item>
		<title>Like puzzle games? iPhone &amp; iPod Touch users, try Relix</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=305</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=305</guid>
		<description><![CDATA[A good friend of mine (and ColdFusion developer [see how I'm on topic {note the stylish use of nested parens}]) at work has been hitting iPhone development on his spare time to come up with this game Relix. I've been playing it tonight and am thoroughly perplexed at some of these puzzles, like level 12:<br/><br/><img src="relix-stuck-12.jpg" />
<br/><br/>It's been fun playing it, and it's only a buck, on the app store now, plus you'll be helping a fellow programmer, one of the 'little guys.'<br/><br/>This should link to it - <a href="http://itunes.apple.com/us/app/relix/id348652616?mt=8">Relix, the puzzle game for iPhone &amp; iPod Touch</a>. Oh, and do check the video, it makes starting off way easier.<br/><br/><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/skKA5PXNPvg&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/skKA5PXNPvg&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>]]></description>
		<category>General</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=305</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Mon, 04 Jan 2010 19:10:00 PST</pubDate>
	</item>
	
	<item>
		<title>Should CFML have first class properties?</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=304</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=304</guid>
		<description><![CDATA[C# was the first mainstream programming language, to my knowledge, that had full language support for properties, phasing out getters and setters (accessors and mutators). The idea is simple. Here is a property:<br/><br/><pre>
public String Name;<br/></pre>
<br/>This gives your object a public property that can be read and written. The process is similar in Java and ColdFusion, but when the time comes to add functionality to <code>Name</code>, such as calculate the value on the fly, or invalidate a cache when the value changes like I do in <a href="http://paginationcfc.riaforge.org/">Pagination.cfc</a>, you have to graduate this into a getter and setter. In C#, you just have to change the property, keeping your object's interface safe:<br/><br/><pre>
private String _Name;<br/>public String Name {<br/>   get {<br/>      // some code<br/>      return _Name;<br/>   }<br/>   set {<br/>      // some code<br/>      _Name = value;<br/>   }<br/>}<br/></pre>
<br/>Properties inherit simplicity when compared to the standard getter and setter. They give you less typing and fewer interface changes.<br/><br/>It can actually go deeper than that, with property change event listeners and more.<br/><br/>In the Java world, this properties debate has raged for years, and there are opponents and proponents, both shouting angry words at the other side (they call it the JCP). I think it will never happen, Java is a mountain: basically immobile, without an act of God. CFML is a rocket, in comparison. Allaire / Macromedia / Adobe have pushed CFML hard, keeping it current. Much more so with the latest release and the CFML Scripting enhancements.<br/><br/>Adobe ColdFusion 9, which came out a few months ago, blessed us with near magical getter and setter generation, but I wonder if that is not enough. With this feature in place, is it now too late to move the language toward properties? I suppose this becomes a question for (or <em>your</em> potential answers for) the <a href="http://www.opencfml.org/">CFML Advisory Committee</a>: how could it be implemented in CFML, the ColdFusion way?]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=304</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Thu, 03 Dec 2009 16:51:00 PST</pubDate>
	</item>
	
	<item>
		<title>Thoughts on code regeneration - patterns for customizing</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=303</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=303</guid>
		<description><![CDATA[Since Mark Mandel gave his transfer presentation to the AZCFUG last June, I've been contemplating the different ways there are to work with and customize generated code, and especially re-generated code. Here are some patterns I have recognized. Please read and add your own in the comments.<br/><br/>Generic Scaffolding<br/>Something I've said ColdFusion has needed for years, and we're still not there, standard scaffolding creates the model, view and controller on a single database table (not usually much more complicated than that). From there, you have to edit the HTML to make it match your UI, and edit everything else to do what you need it to do. It's rarely correct out of the box. When your database structure changes, you either have to regenerate and reapply your changes, or apply the DB changes to all of your layers by hand.<br/><br/>Styled Scaffolding<br/>If your UI is clean, and the scaffolded UI code (the HTML) is as well, leave the output as is and just style it with CSS. Wrap your own layout around it and you're set. This only accounts for basic changes that you would make.<br/><br/>Transformed Scaffolding<br/>To account for bigger changes, like changing form field types or turning a form into a wizard, you could try running a transformation on the scaffolded output. This works by making a tool that will change the original structure on command, for example string operations on code. It's doable, and I've done it. It works, in a pinch, but it tends to be more work than it is worth. If you end up physically injecting code into an object, there are better ways to go.<br/><br/>Extended Injected Stubs<br/>Extend the generated code with your own objects (or inline includes for HTML). Replace calls to the generated code with calls to your code. It's kind of a make-or-fake-your-own-stub strategy.<br/><br/>Pre-generated Stubs<br/>The Reactor ORM has a neat trick. Reactor generates stub classes that extended the framework's <em>real</em> generated classes. These empty stubs are placed in your playground to put in any code you want, while the tabe definition heavy lifting classes are saved inside Reactor's core file structure. Reactor can then manage the ORM while your stub files are safe. This strategy can work for you, too, except for the two big downsides that ultimately killed* Reactor: folders with potentially huge numbers of generated files and the unweildy nested object structure. CF 6 and 7 especially have trouble keeping performance with the inheritance tree, which, from memory, looks something like:<br/><pre>
reactorObject<br/> reactor.DataObject<br/>   reactor.DAO<br/>     reactor.myTableDAO<br/>       myTableDAO<br/>         myTableDAO_MSSQL<br/></pre>
* No, it's not dead, but had a little bad press and it was hurt bad enough to end up on the outside.<br/><br/><br/>injected Stubs<br/>Mark Mandel's Transfer also generates files and saves them in the internal structure of the framework, but instead of generating a stub, you can configure it to make an arbitrary object of your own the stub. Transfer then injects its generated code into your class, making your inheritance tree very one-dimensional.]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=303</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Tue, 24 Nov 2009 21:15:00 PST</pubDate>
	</item>
	
	<item>
		<title>How to get Adobe ColdFusion for FREE</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=302</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=302</guid>
		<description><![CDATA[There's always all this talk about how ColdFusion costs so much more than the competition. This has of course been <a href="http://stackoverflow.com/questions/760427/what-is-the-career-value-in-learning-coldfusion">debated</a> and <a href="http://www.forta.com/blog/index.cfm/2008/6/2/The-ColdFusion-Pricing-Debate-Revisited">debunked</a>, but still, the truth is, ColdFusion still does cost, whether we're talking about the US$1300 standard version or the US$7500 enterprise version, that's real money that you don't always have to pay. I've got two methods that will give it to you for free, and three methods that will show you how to get it for a severe discount.<br/><br/>Free #1- Visit Adobe.com, download a trial version, install it. When it asks for a serial number, tell it to install the developer version. This is literally everything that the $7500 enterprise version has, yours free forever, no license problems, no hidden fees. The only downside is it's limited to IP addresses - the local computer (for development) and 2 or 3 others for development and testing.<br/><br/>Free #2- Hang out at your local Adobe sponsored user group (CFUGs especially). Twice a year, they give out a software package from Adobe, anything they have for up to around US$2000. You can get your free copy of ColdFusion just by being lucky or entering whatever contests they have. This is actually more viable than it may seem. A few years ago, I won this. Months later, I brought my dad to the group and he won. Oh, and since you'll be there, take time to meet interesting people and learn some CFML.<br/><br/>Cheap #1- Maybe you knew this and maybe you didn't, but you really don't have to buy ColdFusion to run a web site with it. $20 or so a month will give you a great generic hosting account. Develop CF locally for free, deploy remotely for cheap, it's an easy win. Also, these hosted servers usually score the expensive enterprise version, so you can even use those cool advanced features.<br/><br/>Cheap #2- If you do go and buy your own copy of ColdFusion Server, you may not know about the changes to the EULA, or License Agreement, since ColdFusion 9. If you buy just one copy of the server software, that grants you the ability to use that license to install on development, testing and staging servers. That's like 4-for-1, a savings of US$3900!<br/><br/>Cheap #3- If you go all out and buy that US$7500 enterprise license, and there are some good reasons to do that, consider deploying to a cloud environment like Amazon EC2 or the like, because you can deploy your enterprise CF copy on 10 cloud servers. That's a savings of US$67,500! It sure does give you more incentive to try out load balancing and the new multi-server configuration tools that ship with CF9.]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=302</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Thu, 12 Nov 2009 16:40:00 PST</pubDate>
	</item>
	
	<item>
		<title>Should You Go 64 Bit?</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=301</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=301</guid>
		<description><![CDATA[In case you have trouble deciding if a 64 bit operating system is right for you, I give you <a href="http://www.dopefly.com/shouldigo64bit/">Should I Go 64 Bit?</a> which should finish the argument once and for all.<br/><br/>If you buy the upgrade to Windows 7 (which you should), you will be forced to choose - it comes with 2 DVDs, one for a 32 bit install, and one for 64 bits.<br/><br/><a href="http://www.dopefly.com/shouldigo64bit/">Should I Go 64 Bit?</a>  is the quick and dirty answer.<br/><br/>The long answer is more complicated, but I have boiled it down to your computer, if you have 2GB of memory and a 64 bit CPU, take the plunge. The only 2 caveats you may have will be software compatibility (if you have any 16 bit software, it will no longer run in Windows 7 64 bit), and hardware driver compatibility. Chances are, if your hardware is so old as to not work with Windows 7, you need to upgrade anyway, and if your software is so old, you can always virtualize.]]></description>
		<category>General</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=301</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Fri, 06 Nov 2009 17:21:00 PST</pubDate>
	</item>
	
	<item>
		<title>A few miscellaneous upkeep things</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=300</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=300</guid>
		<description><![CDATA[First up, Twitter. Follow me: <a href="http://twitter.com/nathanstrutz">@nathanstrutz</a>.<br/><br/>Second, Facebook: Friend me: <a href="http://www.facebook.com/nathan.strutz">nathan.strutz</a>.<br/><br/>I guess you could have figured that out, though, if you visited <a href="http://hi.im/nathanstrutz">Hi, I'm Nathan Strutz</a>. Hi.Im is very cool.<br/><br/>Finally, MAX. I couldn't talk Boeing into sending me to the annual Adobe MAX conference. I'm not sure I will ever get them to send me anywhere. There is a chance I could hit a conference if I'm a speaker, so I'll be coming up with some kind of presentation that people would like, and maybe try out for a few next year.<br/><br/>There is, however, the Adobe Community Summit, which is held Sunday, October 4th, right before MAX. With the price so very right (free), and the location close enough (L.A.), I'm sure I can get there.<br/><br/>This ACS day happens to run only a week after I bring the family home from 10 days in Alaska. We've got a lot of friends and family to visit, wish us luck with 4 kids on a 6 hour plane ride.<br/><br/>Anyways, if you're an Adobe ACE or UGM, and will be in L.A. in October, make sure to meet me at Community Summit day!]]></description>
		<category>General</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=300</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Tue, 15 Sep 2009 13:01:00 PST</pubDate>
	</item>
	
	<item>
		<title>August 2009 AZCFUG Meeting</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=299</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=299</guid>
		<description><![CDATA[I always forget to blog. There's a quickly growing list of things I have to update every month when we have a new Phoenix ColdFusion User's Group meeting. I did pretty good except for the blog. You see, I have to update...<br/><br/><a href="http://www.azcfug.org/">The AZCFUG Site</a> - It was so out of date, <a href="http://alan.rotherfamily.net/">Alan</a> finally replaced the text with some boilerplate stuff and links to our other sites. Some day, we'll have real content here.<br/><br/><a href="http://groups.adobe.com/groups/47494a5161/summary">AZCFUG on Adobe Groups</a> - We are using this because it's a pretty nice app, and does everything we wanted, but we hate the extra-long URL.<br/><br/><a href="http://azgroups.org/">AZGroups.org</a> - I update our schedule here via a <a href="http://www.google.com/calendar/embed?src=0tv5dsidduqjmdfgie3kif56ig%40group.calendar.google.com&ctz=America/Phoenix">shared Google Calendar</a>.<br/><br/><a href="http://twitter.com/nathanstrutz">My status on Twitter</a> - just to pimp the event.<br/><br/><a href="http://www.dopefly.com/techblog/">This Blog</a> - which I was just saying I forget about far too often.<br/><br/>Then, if it's a particularly exciting meeting, I may also advertise it on various mailing lists, etc.<br/><br/>Anyways, sorry, where was I?<br/><br/>Oh man, tonight, <a href="http://corfield.org/blog/">Sean Corfield</a> presenting <a href="http://www.getrailo.org/">Railo</a>. I'm really excited to see what's in this new version and what's coming next. It's tonight at the UAT building in Tempe, AZ. If you're not in the area, you can <a href="http://experts.na3.acrobat.com/azcfug082009/">tune in at 6:30 PM PST via Adobe Connect</a>.]]></description>
		<category>AZCFUG</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=299</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Wed, 26 Aug 2009 14:38:00 PST</pubDate>
	</item>
	
	<item>
		<title>IE6 No More applied to my web site</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=298</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=298</guid>
		<description><![CDATA[Here's just a note to mention that I put the <a href="http://www.ie6nomore.com/">IE6 No More</a> banner on my web site. It was dead simple, dropped it right into the top of my layout and it shows up on every page. If you have a web site, I recommend you do it too!<br/><br/><img src="dopefly-ie6-no-more.png" />]]></description>
		<category>Standards</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=298</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Wed, 05 Aug 2009 11:26:00 PST</pubDate>
	</item>
	
	<item>
		<title>Less CSS - how CSS should have been!</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=297</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=297</guid>
		<description><![CDATA[Has anyone else seen <a href="http://lesscss.org/">Less - Leaner CSS</a>? Let me sum it up for you. It goes like this:<br/><br/><blockquote>WHAT IS WRONG WITH THE W3C?</blockquote>
<br/>And you can take that one to the bank.<br/><br/><br/>Seriously though, Less is an app built in Ruby that lets you write CSS in a <em>reasonable</em> fashion, which it will compile into unreasonable standard CSS.<br/><br/>And what is reasonable for CSS? Where is it that the W3C has failed us so terribly? Less' feature set says it all: variables, mixins, nested rules and operations. You'll probably have to see it to believe it, but once you see it, you'll get it. Go ahead, visit the <a href="http://lesscss.org/">Less CSS</a> site, just the home page shows you everything.<br/><br/>My only problem with it is that it's Ruby. I don't have anything in particular against Ruby, I just don't want to install it or figure out how to use it to start coding with Less.<br/><br/>So where does that leave me?<br/><br/>1) Rewrite it in a language I like more<br/>2) Suck it up, use Ruby<br/>3) Recompile it with jRuby<br/>4) Run it with HotRuby (translate into Javascript)<br/><br/>Until then, I guess I will just be dreaming about it.<br/><br/>]]></description>
		<category>Standards</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=297</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Fri, 24 Jul 2009 20:37:00 PST</pubDate>
	</item>
	
	<item>
		<title>I got the iPhone</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=296</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=296</guid>
		<description><![CDATA[Last month before our AZCFUG meeting, we (the UGMs and ACEs of the Phoenix area) were hanging out with <a href="http://blog.digitalbackcountry.com/">Ryan Stewart</a> (<a href="http://www.adobe.com/go/ryanstewart">who has an adobe go link now</a>) at Four Peaks Brewery. It became quickly obvious that only <a href="http://www.brooks-bilson.com/blogs/rob/">Rob Brooks-Bilson</a> (<a href="http://en.wikipedia.org/wiki/Rob_Brooks-Bilson">who has his own wikipedia entry</a>) and myself were on dumbphones. Rob picked up his iPhone that following weekend. I held out for 2 more weeks (hey, we had a baby, cut me some slack). My wife & I had planned to upgrade to something, I was leaning towards Android, but, thanks to HTC's mediocre Android devices and my employer's fantastic corporate rates with AT&T, we switched and I got an iPhone 3GS.<br/><br/>I've had it for a couple weeks now, and I've got to say, wow. This thing is great. Really. Everyone should have one. From the seamless phone and ipod controls to the connectivity and web browsing abilities, to the apps and games available, it's been really, really fantastic.<br/><br/>One thing I like the most is that it's easily a hundred devices in one. With nothing added, it's a great phone, navigation system, media player, web browser, PIM and camera. That's just brushing the surface, and of course doesn't cover the thousands of apps you can download, many for free.<br/><br/>Case in point: This last weekend we wanted to play mini-golf with the fam. Alanda (my wife) found an indoor place in North Phoenix - 113 is hot enough to stay indoors! Using the camera and Facebook app, I dropped an adorable picture of Aubri (1 yr, our 3rd child) owning the course. From there, we wanted food. Thanks to the iPhone, we were at in-n-out burger in 5 minutes. Finally, we had to get back to Alanda's Dad's camp trailer. Thanks to the map, we saved at least 20 minutes of driving. As we wound through Fountain Hills, I showed Alanda the Zillow application. She was having so much fun as it showed her the estimated prices of all the houses we drove by, live, as the app tracked us on a map with the iPhone's GPS.<br/><br/>I was especially impressed with how I could buy the device and never need to plug it in to a computer. You can download music, podcasts, movies, apps, games, everything without even owning a PC to plug it into. You'll probably want to, but you don't have to this time. This is in contrast to how my iPod Video was simply a sattelite of the media in iTunes on my desktop.<br/><br/>Repeated conclusion: Everybody should have one. Really.]]></description>
		<category>Life Events</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=296</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Thu, 23 Jul 2009 07:53:00 PST</pubDate>
	</item>
	
	<item>
		<title>The Easy Super-Bean</title>
		<link>http://www.dopefly.com/techblog/entry.cfm?entry=295</link>
		<guid>http://www.dopefly.com/techblog/entry.cfm?entry=295</guid>
		<description><![CDATA[With CF being OO enough, beans can have a super-type, a common base that all beans share, like genetics for business objects. It's easy to make one.<br/><pre>&lt;cfcomponent extends=&quot;superbean&quot;&gt;</pre>
But what do we put in there?<br/><br/>My biggest hatred about beans is the getters and setters. It's a lot of typing. If you have snippets, that helps. If you have a bean generator, that's better. It's also a big problem if you have to change them (think: adding logging, validation, etc.), or worse re-generate after you've added custom code. So the way to fix the whole lot of these is employing ColdFusion 8's OnMissingMethod.<br/><br/>I know we've seen it before. My favorite probably comes from <a href="http://www.objectiveaction.com/Kevin/index.cfm/2009/1/27/onMissingMethod-and-Abstract-Object--Part-2">Kevin Roche's Abstract Object post</a>. That's basically what I'm playing with.<br/><br/>In my playing around, I've got a base bean with an onMissingMethod defined that will catch getters and setters. Here's an illustration:<br/><br/><img src="superbean-1.png" alt="Illustration of bean hierarchy - generic base bean with concrete type" />
<br/><br/>The _genericGet() and _genericSet() methods were added so that any extending bean can, say, overwrite just the setter for all the properties in a bean or a parent type of another bean. In fact, I would recommend that overriding coders "decorate" the _generic methods, calling the super-action before or after any custom operations.<br/><br/>Benefits of this design, other than the obvious lack of need to type getters and setters, is that the concrete bean can hold any property, plus, I can rename the getters and setters to <code>obj.Name(&quot;Nathan&quot;).name();</code> which would return <code>Nathan</code> - somewhat of a jQuery style trick. Another cool thing is that if you wanted to create your own getter or setter for a property, the _generic methods will search for your function and call that instead.<br/><br/>To illustrate:<br/><br/><pre>(in component user, extends BasicGenericBean)<br/>function getName(){return &quot;Bob&quot;}<br/><br/>(Outside, calling methods on the object)<br/>user.setName(&quot;Nathan&quot;);<br/>user.getName(); // returns Bob</pre>
<br/>Also, I added an init() constructor method that will populate the bean's properties with any arguments passed in.<br/><br/>Taking the design further, I wanted to let the developer specify what properties the bean has via the cfproperty tag.<br/><br/><pre>&lt;cfcomponent extends=&quot;GenericBean&quot;&gt;<br/>   &lt;cfproperty name=&quot;Name&quot; type=&quot;string&quot; /&gt;<br/>&lt;/cfcomponent&gt;<br/><br/>user.setName(&quot;Nathan&quot;);<br/>user.setNumberOfGoats(16); // throws error: NumberOfGoats does not exist in User.<br/></pre>
<br/>Then, I thought about adding some optional subtypes for the generic bean. What if I want to track the history of changes to the bean, so it would be easier to do a database update? What if I wanted to put the database update right in there, in a very generic way? This is completely possible.<br/><br/><img src="superbean-2.png" alt="Illustration of bean hierarchy - base bean, history tracking bean, database enabled bean, with concrete types" />
<br/><br/>So there's my design, something to play with at least, and maybe base your model on too. Download the files all together in 1 zip with some test front-ends just to see them in action. CF8+ only! <a href="superbeans.zip">Download Nathan's Super Beans</a>.<br/>]]></description>
		<category>ColdFusion</category>
		<comments>http://www.dopefly.com/techblog/entry.cfm?entry=295</comments>
		<author>mrnate@dopefly.com (MrNate)</author>
		<pubDate>Mon, 08 Jun 2009 21:54:00 PST</pubDate>
	</item>
	

</channel>
</rss>
