syntatic

Archive for May 2007

Google Gears Released

leave a comment »

Google gears allows online applications (like Google Reader) to have offline capability. With Reader you click a ‘go offline’ icon, which downloads your 2000 most recent unread RSS items so that you can read them without Internet connectivity. For Mac users a Firefox plugin is needed while Windows users need to install a program. In either environment, Gears allows users to stay at home in the browser, which is one of the biggest gripes with some of the other offline frameworks.

Currently, no solid well used framework for offline web applications exists. A few frameworks exist, but the arena is largely untouched. As the difference between desktop and web application continue to blur we’ll see other offline frameworks become available, but Gears looks like a solid platform since it provides offline capability regardless of the development language and browser usage. Pushing integration even more TechCrunch writes that “They (Google) are also collaborating with a host of other partners such as Opera, Mozilla, and Adobe, which will to integrate flash and Apollo into their system.” With that kind of support, I’m sure it won’t be long before we hear clients asking for Gears integration.

Gears weaves together a local server, a local database, and a worker pool all through a Javascript API. The server is Javascript and acts as a factory and container for resources. The database is SQLite, which is a “self-contained, embeddable, zero-configuration SQL database engine” that has a solid reputation for reliability. The worker pool acts like a bunch of processes and can pass data types by using JSON. If you want to know more, Google provides a quick tutorial and some documentation for developers and even a few pointers for synchronization.

Advertisements

Written by syntatic

May 31, 2007 at 3:45 am

Posted in google

Dynamic finders: modifying find_by_id for legacy tables

leave a comment »

One of my projects at Obtiva integrates heavily with a legacy database that isn’t “rails friendly”. None of the primary keys are named id so I use set_primay_key “model_id” all over the place along with some other workarounds.

I ran into an interesting problem when integrating techno weenie’s restful authentication into an existing user model. The plug-in raised an error when trying to run User.find_by_id and logged a no method error. I quickly found that, in their current state, dynamic finds aren’t aware of a primary key being set.

Since Rails advertises itself as opinionated software the behavior makes sense, however if you’re wanting to write highly portable code for say a plug-in when you might want to put a warning in the instructions. Some of your users can’t rely on a standard Model.find_by_id(1).

For the sake of time, I went ahead and modified the authentication plugin, but it would be nice if find_by_id checked for the set_primary_key and changed it to find_by_primary_key before raising an error. On that note, I think I have an idea for my first simplistic rails plug-in.

UPDATE: Instead of modifying the authentication plugin it is probably a better idea to override the find_by_id method in the User class, which would look something like this:

def find_by_id(id)
  find_by_primary_key(id)
end

Written by syntatic

May 23, 2007 at 3:25 am

New beginnings with Obtiva

with 3 comments

My decision to transition to Obtiva wasn’t an easy one. I left a very stable job at Highgate where I would head an ever growing team of developers. In many respects, after a mere two years, I achieved the prize that many developers are striving after.

I had my own office with any equipment I wanted or mentioned. My work hours rarely went beyond forty. My salary steadily increased as I acquired more skills. I was paid to learn at my own pace. But more than all that, I had an employer that cared for me as a person. I was in a family and a family is what I left.

Joining Obtiva put me back at the bottom of the food chain. Now, I’m a green Software Apprentice and it’ll be awhile before I head a team of developers. Instead of leading I’ll be learning. I’ve been demoted.

Why would choose someone that?

First, being the worst on a team of oustanding developers can’t be compensated for with environment, equipment, or money. You can’t compensate for learning next to people who have already traveled the path and know how to avoid the holes on the road ahead. Pairing with great software developers is invaluable. If you’re new to programming and have not had the opportunity to pair then you need to demand the experience.

My first day at Obtiva I talked with Gareth Reeves and he showed me the ropes of rails.vim. One of my long-term apprenticeship goals is to master one of the ‘universal’ type editors inside and out. Right now, emacs and vim are more powerful than my ability to use them. I strongly dislike being the weak one in the relationship. I knew huge productivity gains were dormant in these and Gareth gave me a quick tour of rails.vim’s power. I’m impressed and excited to grow into vim.

Second working at Obtiva, I work with rails. Obtiva offered some of they first training classes for rails development and the continue to stay on the edge. Ruby and Ruby on Rails are a breath of fresh air. My first language is Perl and it has served me well, but I’m happy to say “Goodbye semicolon you won’t be missed.” Rails makes it so web development doesn’t suck, but Ruby makes it so refactoring doesn’t suck. Drying up code is painless and the number of keys I don’t press when writing Ruby is magic. Throw ActiveRecord into the mix and programming stops feeling like programming.

After two days working alongside Dave Hoover at Obtiva’s office. I’m excited again by what I don’t know about the world of programming. More importantly, I’m shocked at how easy software development can become. Obtiva takes best practices and continuous refactoring seriously. I’m beginning to seeing how much these tools can increase your productivity per hour. I’m even more convinced that the “right process will produce the right results” (see TPS).

Writing in Perl much of my programming was about syntax, data structures, and capturing errors. Dave and Rails have a great way of transitioning programming away from the those aspects of software development. The focus of our programming is on proper model relationships and business concepts. The transition is difficult to describe and is sure to be a constant theme on this blog.

Written by syntatic

May 18, 2007 at 4:04 am

Posted in obtiva, programming