Building a Flex/Rails App - Part I 1

Posted by daniel

I want to build a webapp to track my run progress for my marathon training.  So, being a geek, I thought what better way to track my time than to build a webapp.  Because I've started working with Flex at work, I decided that I wanted to build a Flex UI running on top of a REST based Rails webapp because I want to gain some experience with both of those technologies.  I'm going to give a little back by documenting the process.   I don't know if this will help anyone else, but I certainly hope so.

I'm also going to be pulling data off of a ipod nano with the nike+ipod kit and possibly my Garmin Forerunner 305 for my actual miles.

Architecture

These are the architectural requirements for the project.  Pretty simple really.

Requirements
  • Ruby on Rails 1.2

Table model
  • user - simple user table that has login/pwd for user sessions
  • runs - table that has individual run data - time, distance, pace, expected distance
  • device - optional information for device that supplied run data (like ipod)
  • session - it's better to use an active_record_session store than a file store in my opinion because it's much easier to support.

Rails plugins

Why REST and not WebORB?

So if you are like me and new to these technologies, you want to know what exactly is WebOrb... does it have anything to do with spiders? (no) From the WebOrb for Rails site:

“WebORB for Rails is server-side technology enabling connectivity between Flex and Flash Remoting clients and Ruby on Rails applications. WebORB for Rails can be installed as a plugin into any Rails application to expose Ruby classes as remote services. The product provides a complete implementation of the Adobe’s AMF0 and AMF3 messaging protocols and thus supports any Flash Remoting or Flex client.

Flex Builder projects can be configured to use Flex Data Services and point to a WebORB for Rails installation, however, the current release supports only the RPC featureset of the Flex Data Services technology. “

Another explanation for weborb from this Google Groups discussion states:

What WebORB allows you to do is to transfer Rails objects directly from
the server to the client, using a protocol called AMF, which is a binary
protocol (unlike REST, which is XML / text based...)

So, after a little research, I'm sticking with REST.  I don't have any need for passing large, complex objects like byte arrays or for using [RemoteObject] to send typed classes to Flex (although I am doing that at work.)

Flex UI

I'll save this information for Part II to be continued...

My Latest Obsession - OpenID

Posted by daniel

There has been a lot of buzz recently about OpenID. In the last couple weeks, we’ve seen announcements from Microsoft about adding OpenID support to their CardSpace identification technology and AOL adding OpenID support for all of their user accounts.

So, what is OpenID? From openidenabled.com
OpenID is a URL based identity system. An OpenID identity is simply a URL, and all the OpenID specification does is provide a way to securely prove that you own that URL.

Unlike most identity systems, OpenID is completely decentralized. The end-user may choose whichever server they are most comfortable with, and may even run their own if they choose.

What this means to me is that sites that support OpenID save you the hassle of managing your identity on every site that you visit. Wouldn’t it be great if you could keep all of your personal information in one place (or more) with one password to remember. When you wanted to change information, you only have to do it once. OpenID is an attempt to address this concern.

My next step is to add OpenID support to taskhack using the new Rails plugin.
add OpenID to a Rails app
The No Shit Guide To Supporting OpenID In Your Applications—Dan Webb does a great job explaining how to set up a Rails app using the ruby-openid gem

update 02/28
I have added OpenID support to taskhack. I used code from East Media:
Consumer Plugin for OpenID

About Mephisto

Posted by admin

Mephisto is a blogging engine (small CMS system) built on Ruby on Rails by two of the Rails greats - Rick Olson and Justin Palmer. I really wanted something other than Wordpress to maintain this site. I debated between installing a Radiant CMS or mephisto and decided that mephisto offers all that I need.
More info:
Mephisto Wiki

why is this here?

Posted by admin

This new part of nycnortons.com has a specific purpose. This is my development site where I can write about tech stuff, science, etc. I really needed somewhere to do a brain dump when I’m working on personal projects. And this is it. It won’t be fancy or even well written, but it may have some interesting information.