Pathfinder Blog
Archive: June 2008

Writing reusable jQuery modules: Make everything a plugin

I recently asserted that open-source plugins are sometimes more trouble than they're worth. Nevertheless, I've found one unexpected benefit of jQuery's plugin mechanism: its ability to keep me focused on reusable components rather than one-off, procedural routines.

Because jQuery doesn't ship with any general-purpose way of simulating classical inheritance, it's easy to fall into the trap of writing procedural code with no eye toward re-use. When your first pass at solving a given problem often takes only a few lines of code, it seems like too much overhead to wrap those lines in any sort of object.

But then you decide to layer on some effects ... or there's a new requirement to retain state across sessions by calling on a cookies plugin ... or you end up with a new use case that would require a subclass of your existing code - if it had been written as a class in the first place. By this point it becomes obvious that your behavior layer is poorly organized, hard to maintain, and inexorably tied to a specific use case. That's when you roll up your shirtsleeves and start refactoring.

Continue reading »

Topics: , ,

More Named Scope Awesomeness

http://www.flickr.com/photos/unloveable/2423303716/

I'm back writing about named scopes and still including silly scope visual pun pictures.

Named Scopes and Find Methods

First off, I wanted to mention something that I haven't seen talked about much in other discussions of named scopes -- integrating your names scopes with traditional ActiveRecord finder methods.

This is possible, but only in a limited kind of way. If you have a chain of named scopes, you can add a regular finder method at the end of the chain, and only at the end of the chain.

In other words, you can augment the contains scope introduced in last week's post with a regular find method like this:

>> Person.contains(:first_name, "el").find_all_by_last_name("Smith")
   Person Load (0.000763)   SELECT * FROM `people` WHERE (`people`.`last_name` = 'Smith') AND (lower(first_name) LIKE '%el%')

Continue reading »

Topics:

Google Health and the Changing Landscape of Healthcare Analytics

Google is at it again. Entire industries have sprung up around their search engine, adwords/adsense universe, and now they are set to do the same thing with healthcare data.

One of the major barriers to entry for companies offering services around processing healthcare data has been access to data. Who has the data? Typically the insurance companies. At least they have it in the kind of quantities that makes doing serious data analysis worthwhile. Managed care organizations are in second place, but from there you get to piddling amounts quickly. As you move from the heavily consolidated payer end of the industry to the heavily fragmented provider end, the comprehensive data view of the patient is balkanized to the point of uselessness.

This data problem even effects the valuation of companies. I've seen healthcare analytics companies that provide services to hospitals and clinics valued at less than $10 million, while another company that provides the exact same services to insurance firms is valued at ten times that price. Here, as in all things, follow the money.
Continue reading »

Download my album for money?

Couldn't be simpler

As a happy transient fom the world of record stores to downloading my tunes happily from emusic, Loronix, moistworks and other fee based or file sharing sites, I am interested in how the music world is balancing art with commerce. With iTtunes being my least favorite way to get music, yet for convenience, it has surpassed 5 billion downloads, the pricing structure still seems broken. Radiohead made everyones news with releasing their record as a "how much would you like to pay" model. My problem with this was how difficult, confusing and somewhat rinky-dink the download/pay experience was handled. It actually made me not want to pay. Now comes the same idea done right - the 'mashup' artist Girl Talk, who put out one of my favorite records last year, has a pay what you like model done right.

The first page offers a clear value proposition, name your price - but if you pay 5 bucks you can get lossless versions. Pay 10 and get a 'real' cd whenever they create it. Then process the transaction using paypal, so no messy credit card transactions. Download at the same time so paying is not tied to actually getting the files (you can still bail on paying) However, being a fan I settled on $2.50, a tip so to speak. How about you, does the straightforwardness and ease of use make you want to pay at least something? Or to be profound - does ease of use translate into profits? I'm banking on yes, since the site was being hit so hard that it won't even load the cover picture, and it is my profession as well. I would love to see statistics on how this works out for Greg, but being a 'pirate' music site, we may never know what the ratio of payers to moochers is, which is a shame.

Topics: ,

jQuery + Rails + Agile: PlantCollections database project now live

After just three weeks of frantic work, my team today released the first public version of PlantCollections, a joint venture of the Chicago Botanic Garden and 29 academic and corporate partners.

Our app serves as the consumer-facing front end for a Google Base collection of plant specimen data compiled by scientists and gardeners all over the world. This project represents my first experience with Ruby on Rails and Pathfinder's first experience progressively enhancing a Rails app with jQuery. Although this is still little more than a prototype, with lots of additional functionality to come, we're pleased that this first release is already out in the wild. Go, agile, go!

To learn more about PlantCollections and our involvement in the project, check out the press release. Otherwise, just head straight to the application itself.

Topics: , ,

You CAN Develop with Loosely Defined Requirements, Sort Of.

We just opened up a beta site at www.plantcollections.org.

I'm the Business Analyst on the project. Wonderful idea, connect all the Plant Kingdom databases into a single repository and let anyone who wants it, access the data.

The initial requirements were, essentially, let me export the data I want based on any field in any view and allow me to download it in an Excel spreadsheet where I'll manipulate it to get what I really want. And I need this yesterday.
Continue reading »

Selling colleagues on progressive enhancement

Achieving progressive enhancement at the view layer takes a lot of coordinated effort between server- and client-side developers. A lone UI developer can't make it happen without assistance and buy-in from the rest of the team. I'm not talking about selling the client or the business team. I'm talking about selling one's fellow developers.

I used to work for a giant company (Orbitz) with a large team of front-end developers and total organizational buy-in about accessibility and web standards. It took Orbitz years to get there, but once it did, progressive enhancement was the gospel.
Continue reading »

Named Scopes Are Awesome

named_scope.jpg

My favorite new Rails 2.1 feature is named scopes (previously available as the has_finder plugin. Scopes have already completely changed the way I write complex find logic in my ActiveRecord models.

The basic idea is simple. ActiveRecord has grown a new class method named_scope, which lets you map a set of find criteria to a name:


named_scope :active, :conditions => {:is_active => true}

At which point active is available to all instances of that ActiveRecord class, user.active.

(About the picture -- it's a periscope. With a name. Get it? Okay, you try and come up with a picture that symbolizes named scopes, especially since I just did a name tag bit a couple of weeks ago...)

Continue reading »

Topics:

At Last, We Give Away Books

book_cover.jpg

Last week, I announced the second try and do-over for our giveaway of two, yes, two copies of the book Professional Ruby on Rails, also available in many places where finer books are sold.

We had a resounding 98 comments to the blog post requesting the free book, and as promised, I'm heading over to random.org to get two random integers between 1 and 98.

Can I have a drum roll, please.... please?

Our two random numbers are 69 and 80. Meaning the winners are:

Richard Finegan

Shane

Here's the screenshot from random.org, suitable for framing.

random_winners.jpg

Congratulations to the winners. You should be receiving an email shortly with instructions on claiming your prize.

Thanks to all who entered, I hope you will be inspired to check the book out.

Topics:

GWT Showcase - BRMS for JBoss Rules

JBoss Rules (the former "Drools," though it's sad to see that cringe-inducing name making a comeback) is a Business Rules Engine (BRE). Those are the logic engines that allow you to execute a large set of "if-then" rules against a large set of facts (the most common algorithm to achieve this kind of performance is called RETE, from the ancient Greek for "net"). For more on BRE's and how to use them, have a look at our Business Rules blog.

One of the things that has differentiated commercial BRE's like Blaze Advisor and ILOG JRules from the Open Source JBoss Rules is the tools. The commercial BRE's were part of a suite of development and management tools -- IDE's, "natural" language support, Business Rules Management Systems (BRMS) -- that made their use in a corporate IT "ecosystem" much easier.

With version 4 of JBoss Rules, you now get a powerful workbench plugin for Eclipse, support for Domain Specific Languages (DSL) that mimick natural language, and a web-based BRMS. With it you can deploy, roll back, and report on your rules.

The BRMS has a nice Ajax interface and is in fact written in GWT. This is a natural for a Java-based system like JBoss Rules. If the developers who use and develop JBoss Rules can also tinker with the BRMS interface (GWT==Java in the browser), the odds are better that the BRMS will evolve apace with the core system.

Compare this with a framework like Echo2/3 where there is only a small cadre of developers who develop the JavaScript piece of what is essentially a Java centric framework, and consequently the development has lagged relative to other frameworks. So, good decision for JBoss Rules and probably a good decision if you are adding a web interface to your own Java system.

jQuery plugins: Who needs ‘em?

I've pimped a lot of jQuery plugins, both here and in my articles for IBM developerWorks. On each occasion, I've praised the plugin model for its ability to keep core libraries small while still offering a sanctioned way to share reusable components with the open-source community.

I'm not taking any of that back. But after a few weeks of rapidly iterating on user-interface features for a new client, I've come to a different conclusion: I'd rather spend time building my own custom UI component than wrangling my code to work with somebody else's plugin. When I write my own custom widgets and event handlers, I can accomplish the following:

Continue reading »

Chicago Front-End Web Developers group forms on LinkedIn

LinkedIn logo

LinkedIn's Groups feature hasn't quite reached maturity yet, but my friend and occasional colleague Zack Frazier hasn't let that get in his way. Zack recently launched the Chicago Front-End Web Developers group as a way to help UI specialists network and connect.

According to their site, the LinkedIn folks are apparently hard at work making Groups more useful:

The groups directory is not currently open. We are working on creating a searchable directory for all groups. If there are groups you wish to join, you may click on the group logo from the profile of a group member and request to join.

LinkedIn groups

In the meantime, you can join Chicago Front-End Web Developers using this direct link. Joining allows you to put your loyalties on display to prospective contacts (see screenshot).

UI folks, stand and be counted!

Fresh paint or new drywall? The cost of changing IA or design mid-project

We software engineers - and our clients - tend to think of visual design as a coat of paint. The arrangement of elements on a screen seems like a purely decorative concern, something that can be applied to the bare walls of an otherwise functional application at the very end of the development process. Anybody who's ever spent much time coding at the view layer knows differently. If effective visual design planning doesn't occur early in a project, there's often a hidden cost. Reskinning an application is more like installing new drywall than applying fresh paint.

The PR wizards who launched the web standards movement have propagated the idea that if you just mark up your content and code semantically, then it's a trivial concern to alter its appearance. This is true up to a point, but most sites have a large number of person-hours invested in their stylesheets, images and other purely "decorative" assets. Because browser vendors haven't consistently implemented existing web standards, even the most well-meaning programmers must litter their code with hacks, filters and nested containers to achieve visual fidelity. The hooks for achieving a given look-and-feel often penetrate deep into the view-layer code. Altering that look-and-feel often requires changes to those hooks, which adds risk to a project and almost always breaks lots of tests.

Continue reading »

RailsConf 2008: A Belated Look Back

rails_conf.jpg

This is about a week late, but I was out of the office, and blah, blah, blah...

This was my first RailsConf, and I had a great time along with a couple thousand of my fellow Rails buddies. The general feeling was positive, people seemed pleased to be there and excited about the future of the Rails platform.

Overall, the three themes of the conference were:

  • Deployment Beyond Mongrel: Lots of discussion of new VMs, new server technologies and the like. Cloud technologies were very popular.

  • Git, git, git: Not only was everybody curious about how the core Rails team felt about the move to GitHub, all the newest projects were on GitHub, and there were a couple of well-attended sessions on Git.

  • $ $ $: There were several sessions about running a small Rails business or making money off your side project. One of these (Dan Benjamin's) was so well attended, that the convention center kicked half the group out because we were a fire hazard.

Some further thoughts:

Continue reading »

Topics:

Free Book Redux

book_cover.jpg

A couple of weeks ago, I tried to give away some copies of my book Professional Ruby On Rails. I managed to give a way five copies of the book at RailsConf itself, and also planned to give away copies to commenters on this blog.

I'm taking a second shot at the book giveaway on the blog -- most people who commented on the post didn't have any obvious way to for me to contact them if they way. Such an overwhelming number of people didn't leave contact information that I decided I must have been unclear and the fairest thing to do would be try again.

UPDATE: I now realize that many of you probably entered your email in the web form where it says "this will never be published" -- I didn't see that information for the comments the first time around, but I think that the setup has been changed and I am seeing them now -- that's a perfectly valid way to enter. However, since I didn't see that information for the first batch of entries, I still think the fairest thing to do is start over.

So here goes. I'm going to try to be more explicit with the rules.

  1. I am giving away two books.
  2. To enter, leave a comment to this blog post. The comment must make it clear how I can reach you via email (a URL to your blog is fine if your email address is easily findable there). Entering your email on the comment form should be okay.
  3. Next Friday, June 20th, I will go to random.org and start generating random numbers. The first two matching comments that have email addresses that I can use will win.

Thanks to everybody who left a comment the first time around -- I'm sorry to make you do this again.

Topics:

About Pathfinder

  • We design and build extraordinary applications for companies looking to make the next great idea a reality.
  • learn more

Topics

WordPress

Comments about this site: info@pathf.com