Thursday, November 15, 2007

Usability Rule: A feature doesn't have real existence unless it's easy to use

I know someone has probably said something like this before, but it hit me today while using Git (well, git-svn) on a project.

A feature isn't really available until it's easy to use.

I have to ship off some skinning work to a remote team, but at the same time, I'm reacting to a fundamental change in the data model that I didn't expect. I don't want to be dancing around the skinning changes, so I made a branch for myself with git.

There's nothing exciting about any of that because that's exactly what I should be doing. The difference with svn is that I'd never think to do that. I may think of it in a "lab environment" or suggest it as a solution to someone else, but I'd probably never think "Oh, I should branch this guy and avoid pain later" in the situation I related above.

It's not because svn doesn't have an answer to branching, it's that branching isn't the first answer when it should be. I probably would have just tried to dance around the remote team's changes if I wasn't using git-svn.

You could argue that branching is a complex concept, but implicit in the story is that in svn branching is harder than in git. Since branching is hard enough for me to avoid it, svn is penalizing me for doing the right thing.

Of course, you could call me dumb or lazy, and I'll accept that. But not so dumb that I won't use git-svn or just git from now on.

Wednesday, November 14, 2007

Adding some generators to RubyAMF

I'm having fun adding some generators to RubyAMF. They should help get your RubyAMF project kicked off a little fast and in the Rails style. More over at

Yer all Jeenyusis.

I just wanted everyone to know that reading this blog makes u smrt.

cash advance

Get a Cash Advance

Sunday, November 11, 2007

CFUnited Express Presentation: Offline/Online with AIR

This last Friday (11/9) I was able to stand in for Simon Horwith and speak at CFUnited Express Bay Area, a mini conference by TeraTech. I spoke on the features of AIR that enable developers to build Occasionally Connected Clients.

I had a good time and I was surprised by the diversity of the topics and the way ColdFusion development is going these days.

I worked with ColdFusion for 5 years or so 4 years ago, but spent a lot of energy trying to get some different languages under my belt, and so landed where I am today doing Flex and Rails and Java and so on. I'm happy working with what I'm working with, but it's good to see that the CF community is keeping up with the times and even enjoying some new features that make other dynamic language frameworks like Rails so fun to work with, as mentioned by speakers like Sean Corfield

Here's a link to my presentation from Friday, which has links to the code samples I showed.

Friday, November 2, 2007

Google's Looking Out for Me.

It's not often I get excited about a User Interface feature as small as this, but I found this one pretty special.

I hopped into my Gmail and staring back at me was this:

That's Google, there, telling me without me having to track it down, that I may have a problem with my experience in Gmail due to third party software.

That's awesome. That is a good user experience.

They had to first decide that there was a problem affecting a good chunk of users (which means they are tracking that sort of thing meaningfully, not just to have the data around). Then they made a help topic on how to get around the issue. They didn't stop there. Not Google. They figured out how to tell that I was running Firebug and then told *me* that there may be a problem instead of waiting for me to figure it out the hard way.

It's nice to see that kind of user experience in action in something I use every day, not just being talked about.

Monday, October 15, 2007

Delegate Factories with Prana

I've been having fun with Prana lately. Prana is an IoC container framework for Flex under development by Christophe Herreman. Prana is sort of built with Cairngorm in mind, but it could work for any configuration and injection you wanted to do at runtime.

One of the benefits I can see is for rapidly prototyping an application with little to no knowledge of the service you may need to connect to for your data needs. If you can define the data model well enough, you could build your application with Cairngorm in such a way that all you'd need to do is change one file (or type of file): the Delegate.

That's the reason for the business delegate: to keep the application isolated from the implementation of the service layer.

I've written up an example of how I'm currently using this on a project and posted it at It's a pretty lame sample, but if you right click and select "View Source", it shows how I have created a DelegateFactory that gives my commands a Delegate that conforms to a certain interface. Then, using Prana, I can configure the DelegateFactory to build whichever implementation of the Delegate I wanted, without recompiling the application.

The benefit is that I can drive the application's data from dummy xml data, but the application doesn't care where that data comes from. As long as I'm write about the way the data looks, my Commands don't need to change once I switch over to a production ready Delegate.

First, look at the DelegateFactory. Notice that it contains a string, _delegateClassName which will contain the qualified name of the class I want the DelegateFactory to make. There's some type-checking in there once that string is set to make sure that points to a class that conforms to the interface. One last thing to notice is that I need to have the class of the delegate referenced at least once in the code so that it's compiled in. That happens on the line that says

private static var compileTheseClasses:Array = [DevDelegate]

So DevDelegate is the delegate I want to use at development time. That Delegate acts like a regular delegate that calls an HTTPService to get some xml. Instead of doing that, though, it just loads xml local to the swf and sends a ResultEvent to the LoadPeopleCommand as if a result had just returned from the HTTPService.

Once last thing to notice is the applicationConfig.xml which drives Prana. It's loaded by the InitializeCommand. In that first block there:

<object id="delegateFactory" class="" factory-method="getInstance">
<property name="delegateClassName" value="" />

I tell Prana to configure my DelegateFactory with the delegate class I want to use. I can change this xml file at runtime, so as long as I make sure the Delegate is compiled in, I can change delegates whenever I need.

Of course that's just one of the uses of Prana, but I really like the ability to get up and running easily by making a development time delegate.

Wednesday, October 10, 2007

Flex needs a Custom Metadata Class

At MAX, I was really surprised to find out a sekret Flex compiler feature: You can keep custom metadata around in your Flex app. There's a tutorial with a really sweet proposed application for that feature at Christophe Coenraets' Blog.

The only thing about that example is that the entityManager needs to know to read the objects passed into its save() method for metadata. That's not a problem for that use case. BTW, you can read metadata with describeType()

What if I wanted to copy more of the JPA with Flex? Then I'd need the FPA (a mythical Flex Persistence API) to manage the instantiation of the EntityManager and pass in a reference at runtime. I'd need to inject the right EntityManager into any code that wanted it. Right now to do something like that we'd need to read every class, or intelligently read certain classes, to figure out if there were annotations to deal with.

It'd be nicer if we had a first-class Metadata class that got instantiated by the framework at runtime and knew about the class it decorated. That way it could do things like negotiating with the "FPA" to get the right EntityManager at runtime based on configuration data. It could then modify the object that had the metadata with no developer intervention. It'd look something like this, following Christophe's example:

public var entityManager:EntityManager;

That would mean that at runtime, the 'applicationPersistenceContext' persistence context, which could contain data about which database in SQLLite to use, maybe usernames and passwords or something like that... in short: configuration you don't want compiled into your code. That PersistenceContext object would know to inject the correct EntityManager into the variable 'entityManager'.

I think it'd be a great addition to the framework which would allow a lot more use of the "Dependency Injection Pattern" to help make easy to use frameworks for specific needs on top of Flex.

I've created an enhancement issue here: If you agree, make sure you vote on the issue.

Tuesday, October 9, 2007

A Haiku for Jaiku

So I don't know if Jaiku is pronounced hai-ku or yai-ku, but here's a haiku anyway:

Google bought Jaiku
I really envy those guys
With all that money

RubyAMF makes me happy

I've been excited about RubyAMF for a while, and I finally got a chance to try it out after I worked it into my MAX presentation last week.

Aaron Smith was there at MAX too, and once we met and talked I weaseled my way onto the project. Score!

Anyhow, I've got a lot to figure out about how things work, but I really love these two technologies, Flex/Actionscript and Rails, and I'm really excited about what Aaron has already accomplished getting a very easy integration path between the two.

So, hopefully I can contribute to the stability and longevity of RubyAMF, and people will love it and it will achieve world peace or something.

Tuesday, October 2, 2007

eBay Wins!!

eBay Desktop, created by EffectiveUI and product managed by Alan Lewis of eBay, has just won a MAX award! Nice work!

Wait... this just in.. we won a MAX People's Choice award too!


MAX Day Thermo

We've been hearing about Thermo for a while now, and yup, it's pretty sweet :)

Basically it's the best "design view" ever made, and it works for Flex. Designers can import Photoshop files (!!!!) and turn graphic assets into skinned Flex components using metaphors that they're used to, like layers and graphics tools.

Have a look at Aral's blog, where he's just uploaded 3 videos of the keynote today - it's a better explanation than I could give.

MAX Day One

Internet connection is a bit spotty, and I was running all over the place yesterday, so I'm a day off, sorry.

Best session yesterday was "Flash Internals" by some guys from the Flash Player team. Those guys were geek's geeks. Good information about the pieces of the player and how separate the renderer is from the part that runs the code.

My talk on Flex with Rails went fairly well except RIGHT as I was about to show the fruits of my labor during the code walkthrough, my COMPUTER... my fancy MAC BOOK PRO CRASHED. So that was pretty annoying, but I have another shot at it on Wednesday. Hopefully that one goes better, but still, I think I was able to spread some good word about Flex with Rails and why Rails has the best development experience of the available back end languages.

Got to meet Aaron Smith of RubyAMF fame, who graciously came to my talk. Got to introduce him to a appreciative crowd. We talked about a few things afterwards, a few ideas and Rails performance. Really great guy.

After that some of the EffectiveUI crew hit the streets with some of the Flex team till late. Made it hard to make the Keynote this morning. I'll have a post about Thermo soon :)

Monday, October 1, 2007

Flex and Rails resources

Thanks for coming to my talk at MAX on Flex with Rails. I really wish my computer wouldn't have crashed right before the last part of my presentation, so I'm glad you actually found this post since I never got to show it up on the big screen.

Here are some of the resources that can point you in the right place when you're starting on integrating Flex with Rails:

Pragmatic Programmers has the definitive word on Rails.
Flexible Rails was the first book to start talking about Flex with Rails and what a great match they make.

Peter Armstrong - author of Flexible Rails.
Aaron Smith - RubyAMF is an AMF implementation for Ruby
Derek Wischusen -
Daniel Wanja -
The Midnight Coders - Creators of WebOrb for Rails.

Let the MAX announcements begin...

Adobe acquired Virtual Ubiquity! Grats to the Buzzword Peeps, grats to Adobe...

Now, what other big office suite names are out there? Hm.....

Saturday, September 29, 2007

Off to MAX

Packed and ready to run to the airport for MAX to spread the good word about Flex with Rails and why the development story there is the best of all the alternatives.

EffectiveUI is going to be there in force. It's going to be off the chain, the hook, the charts, AND the wagon.

Thursday, September 27, 2007

"Rails", "Fails", and other controversial words that rhyme

I'd like to welcome a new member to the EffectiveUI team. Simon Horwith is a great addition, and he's going to be working on some great enterprise and government projects with us, as well as helping with training. I'm glad to have him around.

But, I couldn't let one of his latest blog post pass. He titled his post 'Rails Fails' for no reason that I can see. The original post about which his post was written is called '7 Reasons I switched back to PHP', and has made the rounds lately. I see nothing in that post about Rails failing qua Rails, so I can only assume that 'Rails Fails' was a title to stir the pot a little bit.

Here's my take on the original article: Derek's post boils down to two points that I can see:

  1. CD Baby had an existing data model and a lot of php code already in place.
  2. What CD Baby really needed was some solid refactoring, not a change of tools.
Rails is best when you're building from the ground up, because then you get to enjoy the benefits of the opinions of the creators instead of shoehorning a pre-defined structure into a Rails wrapper. Trying to migrate to Rails to get Rails benefits without having access to fundamentally change the processes and structure involved is scary to me. I'm not quite sure if that was what was happening with CD Baby, but it sounds like it.

It's never a good sign when someone says "All of our problems will be solved if we just change tools". That's never the case. It's a corollary to the old saw "If all you have a is a hammer, everything looks like a nail".

Derek is completely right to say that there's nothing Rails can do that PHP can't. That's the whole point to get from his article, not that Rails failed in any way. I'm glad he said at the end that if he were building a project from the ground up, he'd give Rails another go, because that's the place for it.

Rails isn't a tool to make your existing application easier to develop, nor is it just an ORM to throw on top of an existing data structure. Rails is a framework, a platform, and a set of opinions on how to apply those tools to a problem domain. No matter what the language (for the most part) those opinions can be applied to make development better in whatever environment you choose, and I think that's what Derek took away from his foray into Rails. I hope that's what everyone else takes away from it, too, and not some sort sense that Rails failed CD Baby, and could fail you too.

Thursday, September 20, 2007

My 360 Flex Video

My 360 Flex video is up now over at cruxy. The video snippet at the beginning isn't indicative of how stunning the whole video is, though, since I fumble a bit trying to figure out why the heck my Mac remote isn't working (line of sight problem). Anyhow... check it out.

The presentation was on getting more expressive user gestures into Flex applications.

I have to mention that it costs $3.60, which I think I split a third of with the A/V guy and the 360 Flex guys.

Thursday, September 6, 2007

export instead of checkout in Capistrano 2

A quick PSA: In capistrano 2 there's a change to the way you get svn to export instead of checkout during a deploy.

Old way:

set :checkout, 'export'

New way:

set :deploy_via, :export

Saturday, August 25, 2007

Flex and Rails Dates

I'm not sure how I didn't run into this before, but I had some trouble parsing and dealing with dates coming from Rails' to_xml rendering of an object in Flex.

The dates were coming back looking like this: 2007-08-29T23:18:07-06:00, which I'd never seen before. I've found out since that it's in the W3C date time format.

Luckly for me, I found that the as3corelib has just what I needed: a DateUtil.parseW3CDT and DateUtil.toW3CDTF method.

If you're passing dates back and forth between Flex and Rails, at least with xml, you may want to check the corelib out, but make sure you look at it anyway.

Wednesday, August 22, 2007


Ted Patrick has been integrating SWFObject with some other tricks to get a good Flex widget embedding solution called FXWidget. I've been using it for my AIR derby project, and it's nice. A lot cleaner.

Give it a look and watch for updates.

Monday, August 20, 2007

Help David Coletta speak at MAX

Did you have a Flex app that was optimally challenged? Did you beat it? How? David Coletta from Buzzword is interested to know how. Check it out . I can tell you from a first hand perspective, a David Coletta presentation is an experience.

Wednesday, August 15, 2007

360|Flex Day 2

Pretty tired after hanging out with some of the Adobe guys late last night. Got to meet David Zuckerman, who put refactoring in the upcoming Flex Builder 3. I had to restrain myself from hugging him. Real nice guy, too.

Buzzword. The best session I'd seen so far, in terms of really useful content about how a very complex and well architected Flex application. When I saw a demo of Buzzword at Web 2.0 I thought "Sweet, it looks better than Word, I hope I can check it out soon". They're still not done, and now I know why. They've got a very solid application and it's a lot more complicated than just a big text input area. They're focusing intently on stability and performance. They even have a testing application built in to the app which lets them record a macro of some actions and save them as a repeatable test that can be performed in a suite inside the application by QA. They do this by having each command (they have their own framework - they hadn't heard of Cairngorm when they started) know how to reproduce itself in Actionscript, and that Actionscript is run later by the test runner. Very good stuff.

Tuesday, August 14, 2007

360|Flex Slides

Here are my updated slides, as promised, on the Jest google code site:

360|Flex Day One

Good times at 360 Flex. I didn't get a chance to see too many other sessions since I was practicing my own talk and getting that in shape.

Thanks to everyone that came to my talk on alternative gestures and getting them into Flex apps. Watch this space for updated slides and the sample application.

Some of the EffectiveUI crew got together with Ted Patrick, Matt Chotin, Deepa Subramaniam and a few more of the Flex Dev team. Fun discussions about when to use Cairngorm, preferences about using inheritance. The kind of stuff drunk geeks talk about.

Monday, August 13, 2007

Kicking off 360|Flex

Last night was a great party at the 360|Flex conference in Seattle. Got to meet up with Matt Chotin, Doug McCune, and meet some of the Flex Dev team, and hang out with Ryan Stewart, and lot of very cool Flex geeks.

Last the EffectiveUI crew to see Charlie Hunter who was playing a few blocks away from the conference, but it turns out they weren't doing a second set that night. That sucks, cause Charlie's a real life guitar hero.

We recovered in style by bar hopping a bit with Ryan and Doug and a bunch of other guys, and then ended up at a dive bar debating RIAs in Enterprise and if "real product" companies care, and why they should if they don't. Hopefully Adam will talk about it because he had some good points.

Sunday, August 12, 2007

Off to 360|Flex

Bags packed, computer, flight not cancelled, all set. Off I go to 360|Flex. More tonight...

Thursday, August 9, 2007

A quick asdoc tip...

If you're going to document actionscript getter/setter pairs, put asdoc on the getter. Doesn't seem to work on the setter if there's a getter. Not sure yet if it works if there's only a setter... anyone out in TV Land know?

Wednesday, August 8, 2007

asdoc tip

So, I've been senior having a little trouble with asdoc. I needed to doc some code that requires Cairngorm, so I wrongly assumed that I could tell asdoc to add another library with this command:

asdoc -doc-sources . -library-path "path to cairngorm swc"

... but I was wrong. DEAD WRONG. ok.. just wrong. Instead, what I wanted was this:

asdoc -doc-sources . -library-path+="path to cairngorm swc"

because in the former case, I was telling asdoc to ignore the flex framework, which doesn't get you very far. I should have guessed that from using the command line compilers before, but I guess not.

Word to the wise!

Friday, July 27, 2007

has_many, finder_sql, and id

Jeez, has it been almost a month since my last post? Time flies when you're a lazy good for nothing.

Anyhow, since It took me some little while to track down this weirdness in rails, I thought I'd give back to the tribe and list the solution here too.

In Rails, you can specify model relationships with cool "macro" methods like 'has_many' and 'belongs_to'. If there is a fairly specific relationship you want to add to a model sometimes you may need to tell rails to just go ahead and use a query instead of the magic. Then you can specify 'finder_sql':

has_many :outstanding_invitations,
:class_name => 'FriendRecord',
:finder_sql => "select * from friend_records
where friend_id = #{id}
and invitation = true"

That's what I started with, but couldn't figure out why I wasn't getting what I wanted, and also getting a deprecation warning: "warning: Object#id will be deprecated; use Object#object_id". After a search I found this article, which has a good tip and the answer. The answer is that #{id} was being "expanded" once it was parsed, so by the time it got to the database it was already the object id, not the active record id. To fix, change the quotes to single quotes or use the %q quote delimiter to stop the id from being expanded.

Wednesday, June 20, 2007

Also see me at 360Flex

Come to 360 Flex! It should be great.

They were nice enough to ask me to speak, too.

I’m going to be talking about something I’ve had rattling around in my head for a while: Navigation and “power user” features in RIAs, specifically Flex RIAs. They way I use my computer is not the way I can use my RIAs, and I don’t like that. I use things like QuickSilver, and Firefox Mouse Gestures, and the command line (<3 bash)

The talk basically asks: How do you start introducing “power user” features into your Flex Apps, and how do you start to educate the general user about the productivity gains they’ll get by making use of these types of features?

I’m really excited about being able to do this talk. Plus, it means I get to go to 360 Flex. Good times.

See me at MAX

Hey all, and welcome to the brand new Hill of Beans 2.0, upgraded from 1.0 This is the first post. I hope you like it.

So, it's official! I'm confirmed as an Adobe MAX speaker, talking about the societal and physiological benefits of using Flex with Rails. The basic gist will be: unless you have some fairly complex enterprise use cases that cry for LiveCycle Data Services, or someone else is choosing your system back end and you have no say, you should be choosing Rails.

Rails values getting things done, and you'll feel how true that is to the very core of your being when you use it for the first time.

I'm excited to talk at MAX. What a great opportunity for a rookie speaker. I hope I can get some folks on board with using Rails and help get rid of this stupid stigma it seems is forming that Rails guys hate Flash. Silly. We'll fix it by getting Flex guys to love Rails and making more Rails guys that use Flex by this proven method.