Recent Web Log Entries By Ben Nadel
Creating A Lazy Loading Utility Module For RequireJS
Posted: July 25, 2012 at 1:31 PM by Ben Nadel
Yesterday, I started to look at delaying the loading of RequireJS modules until they were first requested . While I liked this approach for modules that may rarely (or never) be used within an application, I wasn't happy with what the code looked like; the lazy-loading functionality, initialization functionality, and the invocation functionality ... read more »
Comments (10) | Post Comment | Ask Ben | Permalink
Lazy Loading RequireJS Modules When They Are First Requested
Posted: July 24, 2012 at 10:48 AM by Ben Nadel
I've been loving RequireJS as a framework that helps me think about my JavaScript applications in a more modular fashion. However, in my research and development, I've always been loading all of my RequireJS modules upfront, at the start of the application. As I've begun to move some RequireJS functionality into production, I've found myself not w... read more »
Comments (5) | Post Comment | Ask Ben | Permalink
Setting ETag Headers Regardless Of File Content In ColdFusion
Posted: July 23, 2012 at 10:31 AM by Ben Nadel
Last week, at InVision , while trying to improve the overall experience of one of our application pages, I started looking into ETag header values to decrease page load times. The first post that I came across (or rather, that I came across "again") was this one by David Boyer . In it, David outlines what ETag headers do and how to apply them in... read more »
Comments (1) | Post Comment | Ask Ben | Permalink
Handling Forbidden RESTful Requests: 401 vs. 403 vs. 404
Posted: July 19, 2012 at 9:34 AM by Ben Nadel
I don't have a tremendous amount of experience building RESTful APIs; so, it's not always clear which HTTP status code in the 4xx block I should use when refusing to fulfill an incoming resource request. One tricky scenario that I've had to code against recently is the request for a properly formed, valid resource of which the authenticating user ... read more »
Comments (13) | Post Comment | Ask Ben | Permalink
Getting The MetaData For A File Upload In ColdFusion
Posted: July 18, 2012 at 9:58 AM by Ben Nadel
Yesterday, I discovered that you could call CFFile-Upload twice on the same file in a single ColdFusion request . This turns out to be an awesome feature for implementing secure upload validation. This morning, I wanted to take that idea and simply factor it out into its own user defined function (UDF) - getFileUploadMetaData(). This UDF would ta... read more »
Comments (7) | Post Comment | Ask Ben | Permalink
Calling CFFile-Upload Twice On The Same File For Security Purposes
Posted: July 17, 2012 at 10:29 AM by Ben Nadel
One of the things that I have always loved about ColdFusion's CFFile upload processing is the seamless way in which ColdFusion handles name conflicts. Simply set the "nameconflict" attribute to "makeunique" and you don't have to worry about anything else. Except maybe security. Luckily, I just discovered that ColdFusion allows us to call the CFFil... read more »
Comments (9) | Post Comment | Ask Ben | Permalink
Relative File Paths Work In A ColdFusion File System
Posted: July 16, 2012 at 9:37 AM by Ben Nadel
For years, I've been using regular expressions as a means to traverse file paths in my ColdFusion applications . By chopping-off the last directory "pattern" in a file path, I was able to move up into the parent directory: <!--- Get the current directory. ---> <cfset currentDirectory = getDirectoryFromPath( getCurrentTemplatePath() )... read more »
Comments (5) | Post Comment | Ask Ben | Permalink
Quiet: The Power Of Introverts In A World That Can't Stop Talking By Susan Cain
Posted: July 13, 2012 at 10:21 AM by Ben Nadel
A few weeks ago, I watched a TED Talk by Susan Cain, titled "The Power of Introverts." Having found the TED talk very interesting, I decided to checkout the book upon which the talk was based. Cain's book, " Quiet: The Power Of Introverts In A World That Can't Stop Talking ," was super fascinating! And, in some ways, it really opened my eyes up to... read more »
Comments (20) | Post Comment | Ask Ben | Permalink
How Do You Populate Shared Views In A Complex Layout Using MVC?
Posted: July 12, 2012 at 10:24 AM by Ben Nadel
I've been thinking about this problem for the past few days and have gotten no-where! Even after extensive Googling, I've not found anything that begins to really answer my question satisfactorily. When it comes to an application Layout, where in the Controller do you populate the data for shared Views within a Model-View-Controller (MVC) paradigm... read more »
Comments (47) | Post Comment | Ask Ben | Permalink
Writing My First Unit Tests With MXUnit And ColdFusion
Posted: July 10, 2012 at 9:31 AM by Ben Nadel
Last week, I wrote my first ever unit tests [of any kind] with Jasmine and RequireJS . It was pretty exciting! And, now that I've played around a bit on the client-side, I thought it was time to do some experimentation on the server-side. This morning, I ran my first server-side unit tests with MXUnit and ColdFusion. The setup for MXUnit was a... read more »
Comments (18) | Post Comment | Ask Ben | Permalink
Writing My First Unit Tests With Jasmine And RequireJS
Posted: July 6, 2012 at 3:47 PM by Ben Nadel
Before this morning, I had never written a Unit Test in my life. Ok, that's not 100% true - I once wrote a unit test as part of a pair-programming experiment, a few years ago, with Peter Bell . But, on my own, not once. Then, yesterday, in my blog comments, Sean Corfield finally pushed me past the tipping point. And, this morning, I downloaded ... read more »
Comments (24) | Post Comment | Ask Ben | Permalink
Domain Models Expose Behavior, Not State
Posted: July 3, 2012 at 10:14 AM by Ben Nadel
A couple of weeks ago, I read an "anti-patterns" ORM (Object-Relational Mapping) blog post by Mehdi Khalili . In the post, Khalili said something that I found very interesting (paraphrased): The Domain Model should never be in an Invalid state because it doesn't expose state - it only exposes behaviors. As part of my journey towards an understa... read more »



