Turning technologies upside down: exchanging web and embedded approaches

I’ve posted about working in Rhomobile to develop for embedded platforms. This work has been progressing and we’re seeing the platform mature as developers are pushing its limits.

This is a platform that has code snippets that look like rails. An entire page for listing several firefighter rotations for example can be as simple as:

<h1 id=”pageTitle”>Rotations</h1>

<ul id=”rotations” title=”Rotations” selected=”true”>
<a href=”/app/Rotation/new” target=”_self”>New</a>

< % @rotations.each do |rotation| %>
<li>< %= link_to rotation.name, :action => :show, :id => rotation.object %></li>
< % end %>

Now, contrast this with working in Cappuccino, a framework that uses a javascript dialect and framework inspired by Objective C and Cocoa. This code deals with a model object:

@implementation Segment: CPObject
    CPString name @accessors;
    int order;
    Template template @accessors;
    CPMutableArray media;
    CPMutableArray images;
    int startTime @accessors; // relative to 0 seconds, i.e. start of podcast
    int duration @accessors; // duration of segment

- (id)init
    if(self = [super init]) {
        media = [CPMutableArray array];
        images = [CPMutableArray array];
        name = "";
        duration = 10*60; // 10 minute default value
        startTime = 0;
    return self;

Cappuccino is virtually alone on the technical landscape as a javascript framework that does not encourage its developers to work directly with the DOM, making the illusion even more complete.

Developers reading these code snippets would think these two worlds were completely upside down. I’m writing in html in order to render pages on a mobile device and using something like Objective C to write web code.

Both these frameworks have their limits. Rhomobile is best with applications that are driven by remote data and don’t do a great deal with media, 3d, or other advanced features. Cappuccino works best in occasions where you can have a web page that loads once, has a rich experience for the user, and does not switch to another page until you are finished working with it. It also leaves the actual back end web services implementation open to be built using rails or whatever technology is a best fit.

It is fascinating to see these kinds of technology evolve and get applied in new ways. I enjoy participating in this evolution and making useful software along the way. I hope I’m not the only one seeing this striking contrast in the way we’ve done things and the ways we can going forward.