Development Ties

On the last day of CFUnited 2005, a group of us were out on the patio having a final drink together. I got into a conversation with Clark Valberg about linguistics. I was a translator in latter half of my time in the military, and Clark was asking if I thought my experience with learning another language had helped me in learning to be a better developer?

I absolutely agreed. I have an aptitude for languages, and always have. It's something I've picked up, and I can generally get to a point where I can effectively communicate (at least on the simplest of terms) within a very short time. Programming isn't much different, if you think about it. When I first got into computing again, after leaving the Army, I was teaching myself ten different programming languages at the same time. I had a lot of catching up to do, being out of the game for so long, so I picked up some books, found online resources, and took to the task of getting up to speed.

Maybe that's why there are so many talented developers outside the US. In the US, we aren't required to learn another language out of necessity, whereas in most other countries of the world (not all, but most) it is very commonplace for people to speak two or more languages.

You can kind of apply this in the reverse, to some degree, as well. Those who only learn one development platform may be limiting themselves. Knowing one programming language inside and out can be a good thing, but learning others can also open a developer to new ways of approaching a challenge. I've known many developers who knew a server-side language (ColdFusion, ASP, PHP, whatever), but never bothered to learn JavaScript, or how to write well formed XHTML. To me, that's limiting. Even crippling.

What are your thoughts?

Ext Custom Data Reader for ColdFusion: More Info

I wrote an article for Packt, as a follow up to Learning Ext JS, and was surprised to find it's been on their site for a while now.

The article is a follow up on Chapter 12 on Custom Data Readers in Ext JS, replacing the reader in the chapter with the CFQueryReader, which is better tuned for reading JSON data returns of a ColdFusion Query object.

Real Error Reporting from ColdFusion 8 Server

Totally stumpled on this by accident. I wrote a statement using the NumberFormat() function, and accidentally placed my mask before the value. Being backwards this threw an unexpected error, which not only told me what I had done wrong (basically told me that the value I had passed was not a valid mask), but also gave me a chart of what the valid mask syntax would be.

Now, this is in my test environment, so robust exception info is probably selected (I haven't checked), but I'm wondering why I'm receiving such outstanding and informative error reporting for this function I barely use, but I can't even get the correct line number of a query error (which it used to do)?

Where Do You Stand?

Several months ago gas in Nashville cost almost $3 a gallon. One enterprising station owner decided to charge around $2.60 a gallon, while all of his competition was at the $2.97 range. While he did this, people were lined up to get in the station. People were pouring through his little convenience mart, to go to the bathroom, or maybe pick up on his 2 for $2 Coca Cola deals. His competitor's stations (there are 4 more within a two block radius) were nearly empty.

This station owner was a very smart man. Did he lose money? His profit margin may have been smaller, but the traffic and sales increase probably doubled his typical profit intake. He had to bring in tankers three times a day to refill his tanks, and some delivery truck was almost always there restocking something in his convenience store.

There is a lesson to be learned here by America's retailers. If you've never worked in retail management, you don't know what kind of mark-ups most retailers have on the goods you and I purchase every day. Sometimes those mark-ups are anywhere from 70 - 100% of the actual cost of goods. Bars and Restaurants even more so, where the mark-up could be as much as 600% on some items. Now, to be fair, these businesses have a lot of overhead they have to pay: salaries, utilities, licenses, security, insurance, etc. But, notice they're having trouble doing some of these things right now? No one is buying.

This is called "market correction". See, we (the American public) have allowed these companies to more or less rape us for years. Why is it that an automobile that cost $3,000 is 1977 will cost $18,000 today? Why does a gallon of milk cost almost $3.50? Why is it that a gallon of gas that sold for $1.15 in 1999...? Well, because we let them charge us that much. And right now, we're done. Not only won't we pay those rates, we can't.

The government is so heavily involved in trying to 'bailout' America (Have you read the stimulus plan?), that big business is still losing the Big Picture. You want your people to stay employed? You want to get back towards the black? You want to keep getting fat bonuses, and have the funding to continue driving innovation and expansion? OK, then charge a reasonable rate for product. What is really more important, a fat profit margin, or staying in business?

I know, there are dozens of other factors involved here. Employers think they pay too much for help. Employees don't think they get paid enough. Unions want every benefit the rest of the American public can't afford. Fuel and utility costs are rising, increasing the expenditures and affecting the bottom line. When does the cycle stop? When do we, the American public, wake up and say enough is enough? When do American businesses say "We can do better by the American people, and survive, and be profitable." and start working with the boundaries of sanity. $250 for a Wii and $40 a game? It's a f@%#ing game. $200 for an iPhone? It's a damn phone. $80 for a pair of Nike? They're shoes for God's sake, they're gonna wear out in six months if you use 'em right.

When did we become so screwed up that we would continually let ourselves be taken advantage of? When does common sense sink in and we all say "No"? (When does "Common Sense" become common again?) There is a difference between being profitable, and being Greedy.

It takes people, average Americans like you and I, to stand up and be heard. It takes forcing retailers and businesses to "get it straight." What do you want to say? What do you want to do? How do you want to live? These aren't just retorical questions, I'm looking for your feedback. Stand up and be heard.

Learning Ext JS Released, and Getting Press

It's been a busy week, with a flood of feedback coming in on the newly released Learning Ext JS. In fact, I've been so busy that I forgot to tell my own readers that it was released! Peter, Steve, and J.J. all put up posts about the book coming out, for which I am grateful. Then Aaron followed after the release, with a post on the Press Release that my employer put out about my involvement with the book. Shea and Colin both have put up entries on the book, including a breakdown of the chapters. Then Shea announced it within the Ext JS Forums, which really brought some positive response, and led to the first review on Amazon.

Learning Ext JS Book Cover (photo)But for me, the biggest thing about this rollercoaster was when my copies of the book came in on Friday. I was at work, but my wife calls, and she and my daughter are in tears after reading the book's dedication. When I came home that night, Teresa put the book in my hands and said "You did it!" It's an odd moment, standing there with this book in my hands, just staring at this cover with my name on the bottom. One of the coolest things. I IM'd about it with Ray on Saturday morning, who I had asked authoring advice of before taking on the project, and he said "The hard copy makes it real."

So, now I'm on to finishing off a huge side project. I'm "eating my own dogfood", so to speak, as it's a rather large application with a single page Ext interface, communicating with ColdFusion via Ajax. I hope everyone enjoys the book as much as Shea, Colin, and myself enjoyed writing it. Let us know what you think.

ColdFusion Query Json Custom Data Reader For ExtJS

Adobe's implementation of JSON return for ColdFusion is great, and frustrating. They use a non-standard return in that, instead of the expected name/value pairs, they return first a COLUMNS element, listing the column names only once, and then the DATA array of the record set values. The column names are listed in the order with which the data is listed in each array element. This is great, in the fact that the data packets are much smaller than the traditional return (traditional meaning, that which is returned by most other app servers), but the down side is, it isn't traditional.

John Wilson wrote a custom Data Reader for the Ext JS library, to help with parsing the ColdFusion return. However, although it created records within a Data Store, it didn't handle the column aliasing you are usually capable of when defining fields, nor did it properly cast variables as it should. I finally had a chance to run it through Firebug, and step through the process, at which point I also really had a chance to review the custom extension.

While it worked, it really wasn't using the best tool for the job. The extension extended the Ext.data.DataReader base component. The ColdFusion return basically gives you an Array of records (the DATA), and Ext JS already provides an Ext.data.ArrayReader object that extends the JsonReader. So, after some refactoring and general tinkering, I now release the CFQueryReader custom Ext data reader.

Inspired by the CFJsonReader, originally writtin by John Wilson (Daemach).

This Custom Data Reader will take the JSON return of a ColdFusion Query object, rather returned straight up, or via the ColdFusion QueryForGrid() method.

The CFQueryReader constructor takes two arguments @meta : object containing single key/value pair for the 'id' of each record, equating to the 'mapping' of the column @recordType : field mapping object

The recordType object allows you to alias the returned ColdFusion column name (which is always passed in upper case) to any 'name' you wish, as well as assign a data type, which your ExtJS app will attempt to cast whenever the value is referenced.

ColdFusion's JSON return, for a ColdFusion Query object, will appear in the following format:

view plain print about
1{"COLUMNS":["INTVENDORTYPEID","STRVENDORTYPE","INTEXPENSECATEGORIESID",
2"STREXPENSECATEGORIES"],"DATA" :[[2,"Carpet Cleaning",1,"Cleaining"],
3[1,"Cleaning Service",1,"Cleaining"]]}

The ColdFusion JSON return on any query that is first passed through ColdFusion's QueryForGrid() method will return the object in the following format:

view plain print about
1{"TOTALROWCOUNT":3, "QUERY":{"COLUMNS":["MYIDFIELD","DATA1","DATA2"],
2"DATA":[[1,"Bob","Smith"],[6,"Jim","Brown"]]}}

The Ext.data.CFQueryReader is designed to accomodate either format automatically. You would create your reader instance in much the same way as the CFJsonReader was created:

view plain print about
1var myDataModel = [
2    {name: 'myIdField', mapping: 'MYIDFIELD'},
3    {name: 'data1', mapping: 'DATA1'},
4    {name: 'data2', mapping: 'DATA2'}
5];
6
7var myCFReader = new Ext.data.CFQueryReader({id:'MYIDFIELD'},myDataModel);

Notice that the 'id' value mirrors the alias 'name' of the record's field.

The CFQueryReader is available from the below download link. Anyone having any issues just post a comment. You may also find information on the Ext JS Forum Post.

Hurdles For ColdFusion Hosting Providers

One thing that we, the ColdFusion community, have been hearing since the release of ColdFusion 8 is that hosting costs should come down. Adobe has been working hard to strike deals with hosting providers to provide hosting solutions that are as competitive as hosting for other server-side languages, such as .NET or PHP. They've been doing this by doing things like changing their EULA agreement to support multi-procs, disaster recovery backups, and VM hosting, as well as through special licensing deals. Unfortunately, outside forces are working against them in this.

>Hosting services contain a lot of other costs, that are generally hidden to the end user. One such cost is in server administration. Any developer, setting up their own development environment, will realize that the real manual labor is spent in IIS or Apache administration, DNS management, SQL configuration and the like. Most hosting companies utilize third party software to help automate a lot of these tasks, cutting maintenance time significantly. There haven't been many software control panels that support ColdFusion. Chief among these, for some time, has been Parallels Plesk Control Panel. This software is brought to you by the same folks who bring the popular VM used on Macs to virtualize Windows. It's an extremely nice piece of software, allowing a very nice interface that integrates with several key technologies used by most any hosting provider.

So you might be asking "What's the problem?" Well, the suits at Parallels have moved to a Software As A Service model, and the pricing structure has changed significantly. There were other options out there, like Ensim Pro, Helm, and H-Sphere, but Parallels bought them all up, effectively taking over the market for hosting Control Panels that support ColdFusion. Nice monopoly they have now, at least within our space.

Outside of the community banding together to write their own software, their aren't any other options currently available for a ColdFusion hosting Control Panel. There is a very nice package for Windows based systems called dotnetpanel, but they do not currently support ColdFusion. They are considering support, pending justification to build it. My friend Emmet McGovern, of Full City Media (the kind folks who host this blog, and who always have my thanks), is on a mission to give dotnetpanel that justification. He started a Forum Thread, on the dotnetpanel forum, to gather feedback from the CF community for dotnetpanel to add ColdFusion support to their Control Panel product. To anyone out there that acts as a hosting provider, and even to you CFers who've been waiting on lower cost ColdFusion hosting, I urge you to stop by their site and put in your vote.

Upcoming Book: Learning ExtJS

I've been rather quiet for quite a while now. I have a rather large side project I've been working on, written entirely with an ExtJS front-end and ColdFusion on the back-end. I'm hoping to get that into a QA phase in the next week or two. I also just celebrated my 39th birthday, my 8th wedding anniversary, my daughter is the rock star of the 1st grade (pulling straight A pluses in every category), and the holiday's are coming.

On top of everything else, I'm putting the final touches on Learning Ext JS, to go to press at the end of the week/beginning of next, and due out in December. I've stayed relatively quiet on this, as I wanted to wait until PackT, my publisher, officially released information on the book. Let me start by saying that a few years ago I never would have thought I'd be doing this much client-side development again. And I definitely wouldn't have imagined me contributing to a book about client-side development.

I began looking at ExtJS quite a while back, while contemplating how to "jazz up" and modernize some dated interfaces I was supporting. I thought that ExtJS was an exceptionally well thought out library of rich, consistant components and functionality. While I use JQuery almost exclusively for DOM queries and manipulation, I really didn't find enough consistency in the visual plugins at the time (this has improved with the latest round of the JQuery UI plugins). I began to learn of the real power of ExtJS, and became an even bigger fan when it was announced that Adobe was including it in Scorpio, the codename for ColdFusion 8, Adobe's first implementation of the ColdFusion web application platform since it's acquisition with the Macromedia merger. Sweet! A total win-win for me.

Back in June, PackT contacted me. It seems they had started to develop a book, but the primary author, Shea Frederick, had gotten bogged down in other commitments before being able to complete the project. Some Googling on their part led them to Colin Ramsay and myself, through Cutter's Crossing. So they contacted me to find out if I was interested. The timing on this was awful. I was just starting the previously mentioned side project, my daughter was on her very first summer vacation, and just a lot of things going on. But it was too good to pass up. Aside from the fame and glory (yeah, right!), I knew that there weren't any other books out there on ExtJS, and it would be an excellent book to get out there for all the people trying to learn this exciting library. After talking the pros and cons with Aaron West, and getting sign off from my family, I finally contacted the Jedi himself, Ray Camden, to get some info on the writing process. We talked about time (a lot), commitment (more), and fame (maybe a little) and fortune (nearly none). I finally went ahead and said I would do it.

So, here it is almost six months later. I took on the final three chapters of the book: working with data stores (think like browser cached data table sets), extending Ext objects to build your own custom components, and the book wrap-up, which covers all the little stuff many people miss because they aren't typically visible. Only one chapter has any server-side code (the data stores). PackT originally wanted to convert my ColdFusion examples to PHP, to conform with the rest of the book. This morning the publisher told me that they want to keep my ColdFusion examples, to show that the ExtJS library can work with any server-side technology.

So, they're taking pre-order now, just in time for the holidays. Let me know what you think.

Our 44th...

To all of my friends, family, and colleagues who voted for our new President Elect, Congratulations. It is my sincerest hope, wish, and prayer, that in the coming four years I never have to say "I told you so."

RIA Survey

Kristen Schofield is asking for help from developers, by filling out a brief survey on Rich Internet Application development. So, if you're doing RIA development with ColdFusion, Flex, JavaScript, or any other technology, please take a few minutes to fill out her survey.

Previous Entries / More Entries