360 Flex Slides and Code...
Here is both the slides and code from my presentation on Using Value Objects in ColdFusion and Flex from 360Flex in San Jose.
If you have any questions, feel free to email me.
Slides:
Code:
Here is both the slides and code from my presentation on Using Value Objects in ColdFusion and Flex from 360Flex in San Jose.
If you have any questions, feel free to email me.
Slides:
Code:

Ok, so I was pulling my hair out last night trying to figure out why the value object that ColdFusion was returning was not casting to the value object on the Flex/Actionscript side.
I bet I ran the Flex debugger 100 times. Everything looked just fine. The object that was being returned from ColdFusion was typed correctly and had the correct data, but when I went to assign the object to the proper type in Flex, it would end up being null.
After a few hours of this, I decided to open a bottle of wine and call it a night. Nothing like a well rested pair of eyes to solve the problem.
After having no luck this morning, I had my friend, Kevin Kazmierczack take a look at my VO on the Flex side of things.
Before:
Kevin suggested moving the import statement above the meta data for the RemoteClass. Shazaam! It worked.
Now, I don't know if I'm just dumb and I missed this in Flex 101 and need to go back, or if this is just something you have to find out the hard way. I'm guessing it's the former, but who knows. However, swapping those two little lines of code to this made all my headaches go away:
After:
Anyone else ever run into this?
Jesus, it's been since September 27th since I wrote anything!?!
Well, I've got a few things to say so I'll just get started.
From the yesterday's news department, MAX Barcelona was amazing, aside from spending 9 hours crammed into a Northwest Airbus. It was better than MAX Chicago. It wasn't as spread out and certainly had a better feel to it.
Next, 360 Flex Atlanta, I'll be speaking on using the ColdFusion 8 Flex Gateways! A great line up of speakers and an all around great conference!
And finally, for those of you who remember my bet with Ed Sullivan, well he finally paid up. At the Union Oyster house in downtown Boston over Thanksgiving weekend!
Here's my reward and Ed in all his glory!
A yummy 2lb. Lobster

Thanks Ed!

Yes, I'm wearing my Peyton Manning jersey in Boston


We'll I'm headed for MAX tomorrow afternoon! I'm driving the new G35 up to the Hyatt at McCormick Place with the new girlfriend.
Universal Mind has an outing on Saturday for all of us and then the show gets on the road.
You'll be able to find me in numerous places. I'll be in the Community Pit as well at the Ask an Expert table, the Universal Mind booth and of course at the bar! I hear Rex Grossman might even be bar tending. That's if he can hold onto the drinks and get them to the right person cause lord knows he can't do it with a football.
I'm really excited as this is the first year I'm speaking, here's the details.
ColdFusion 8 Crash Course Skill: Beginner ColdFusion
ColdFusion 8 is the most ambitious and capable version of ColdFusion to date. Join us for a crash course on everything that is new and exciting in this latest release of ColdFusion.
* Tuesday, October 2 9:15 am - 10:15 am
* Wednesday, October 3 1:45 pm - 2:45 pm
I hope you got registered before it sold out. If not I'll be making counterfeit badges and selling them for $100. If anyone from Adobe is reading, I'm just kidding.
Hope to see you there!

Yeah, it's been up for a while on the MAX site now, but I'm speaking at MAX this year. My topic? The ColdFusion 8 Crash Course!
It on Tuesday, October 2 9:15 am - 10:15 am and Wednesday, October 3 1:45 pm - 2:45 pm.
MAX is looking like it's going to be amazing this year, so if you can come, I highly recommend it. Come stop by my session, I'm going to try to come up with something unique. What, I'm not exactly sure yet!
Speaking with Darron Schall, we've come to conclusion that there are way too many me too posts that go up on blog aggregators. ColdFusion is no exception to this.
With the probable release of Scorpio (ColdFusion 8) to public beta tonight anyone want to take a guess as to what just about every other post that is aggregated tomorrow about ColdFusion will be about.
I'm going to count how many people jump up and down about ColdFusion 8, but don't actually add anything relevant to the discussion, kind of like this post.

Yay! Free code! The only thing better than free code? Free Beer! Since I can't tap a keg on my blog, I'll give you all some free code.
I got Hal Helms' occasional newsletter in which he describes his newly created method of server-side validation.
I didn't realize there were no good examples out there in the ColdFusion community. So here's how I do it, along with the code. Whether you thinks it's good or not, well I guess that's up for debate.
I've got three parts:
(1) A CFC to handle the actual validation
(2) A custom tag to show the error messages, if any
(3) Some simple <cfscript> to set up what needs to be validated
Let's look at some code:
This is the <cfscript> that's setting up what needs to be validated. I'm using an array of structures to determine what needs validated and how. The first key in the structure, "fieldName", is the actual name of the formfield. The second, "required", is whether or not the field is required. The third, "displayName" is how you want the name of the field displayed in the event that there is a validation error. The last two, "validate" and "validateAttribute" are what you want to validate, for example, length or email would be valid attributes for "validate" and 50 would be valid for "validateAttribute".
Finally, call the "validate" method of the formValidate.cfc and you'll get back an array of structures containing the violations. If there aren't any, you'll get back an empty array. If there are errors, the array is made up of a structure that includes the offending field name and an appropriate error message.
This is still a work in progress, but it's pretty solid for now. I'm working on making "validate" and "validateAttribute" so you can pass in more than one value for each.
I've posted the .cfc and the custom tag I use to display the errors that are returned.
I'd love to have feedback, let me know what you think. And if you want to take it and improve upon it, feel free.
Here's the code: formValidation.zip

I had to laugh when I read this post over on Slugworth's, er... I mean Vince Bonfanti's blog.
"It would appear that the tables have turned somewhat. The major "new" features of CFMX 8, certainly the first ones announced by Adobe--CFIMAGE, .NET integration, CFTHREAD--are playing catch-up to BlueDragon. Has BlueDragon 7.0 caught and surpassed CFMX? I think the evidence is clear that it has."
I guess it's easy to think you're some sort of genius when your product is a knock-off of someone else's hard work. All New Atlanta needs to do is outsource their coding to China and they'll be set.
I've always wondered how New Atlanta is able to sell their product, I'm sure there's a loophole somewhere that has allowed for this.
Of course, New Atlanta is about to have another epiphany of new ideas when ColdFusion 8 is released this year.
This was just posted and it cracks me up even more!
"...the company that pioneered CFML innovations such as standard J2EE WAR/EAR deployment, image manipulation (CFIMAGE), .NET integration, and multi-threaded programming (CFTHREAD) offers their vision of the future."
Pioneered!?! Wow, the delusions just keep getting bigger. Vince you just made me shoot my Diet Coke out my nose. You can bet I'll be in the audience at CFUnited for that one.
And for those of you working hard at Adobe, keep up the good work.
Think I'm wrong? Let me know. I assure you, that unlike New Atlanta, I won't ban you or delete your comments.
I don't know what it is lately, but I've just been running into a lot of code that reminds me of the County Land Fill. And that's saying almost being a little too hard on the Land Fill. Let me tell you, that place smells pretty bad. This time, it's a little ASP and some serious abuse of the case statement.
I know, it's painful to look at that. So why do I do it? So you know you're not alone in dealing with code that would make a shit sandwich look appetizing. Unfortunately many of us are unable to just scrap this crap and are stuck working with the code. My advice, order this by the case. Anyone want in on a group order?
This has been a goal of mine for a while now. She's always been fascinated by what I do. Why? Because she's a Geek too, only her little Geekdom consists of genetics and science.
She's reading the CFWACK book by Ben Forta right now and has lots of good questions, which I'm always more than happy to answer.
It's kind of odd though to look over and see reading that monster of a ColdFusion book.
So, wish me luck, not that I'm gonna need it. (She's a smart one!)

I'm working with Kevin Kazmierczak on a Flex and ColdFusion project with Universal Mind and the need arose for us to be able to detect duplicate logins. Specifically, if a user logs in a second time without logging out of their initial session, we need to know. If the user does login twice, their ColdFusion session needs to be killed and they need to be logged out of the Flex application.
I'm going to detail the ColdFusion/Flex Data Services side of things and Kevin has written about the Flex portion on his blog.
The ColdFusion portion ended up being very simple, yet, very effective. We created an application variable called usersLoggedIn and made it a structure. This is done in the onApplicationStart method of Application.cfc.
Every time a user logs in, we store the user value object in the usersLoggedIn structure with their username as the structure key. We also added a unique session id to the user value object. We are using a UUID for this unique id.
Now, we need to be able to tell the Flex application when we detect a duplicate login. This is where we leveraged Flex Data Services. We're using the Flex Message Gateway (NOTE: ColdFusion Enterprise is required to leverage the Flex Message Gateway) to send a message to Flex clients when we detect a duplicate login.
When a user logs in, we are checking to see if they are already in the usersLoggedIn structure. If they are, we construct a message to send to the Flex clients with the users unique session id.
If you need help setting up the Flex Message Gateway, check out the Adobe docs. No need for me to reinvent the wheel.
That's all from the ColdFusion side of things, if you want to see what happens in the Flex application, head on over to Kevin's blog.