ClickAider
You are currently browsing the Bogle’s Blog weblog archives.

Skinny controllers, fat models and Cocoa

Skinny controller, fat model is a good design principle not just for Rails, but for client apps in MVC frameworks like Cocoa.

I think it’s not uncommon, though, for client apps to have fairly anemic models, to the detriment of reusability. For example, I recently worked with an open source module that was in general very well written, but which made it challenging to reuse to underlying parsing logic.

Why this tendency for skinny models? In part, this might because client apps are UI-centric and this ends up being reflected in the design of the code. Even Apple’s naming conventions (e.g. DetailViewController) emphasize the controller and view at the expense of the model.

The lack of a full-fledged read-eval-print loop in Objective C (akin to the Rails console) also makes it inconvenient for developers to exercise fat models. MacRuby has potential to provide an interactive console for Objective C models, and could perhaps be integrated with Xcode to allow me to bring up a console on any app.

Browsing iPhoto from a Blu-Ray player using iPhotoFS

Below are some (terribly blurry) pictures of me browsing my iPhoto albums on a network Blu-Ray player.

I just installed and ran the latest version of iPhotoFS, clicked the “Shared folder” checkbox on the Get Info box for the iPhotoFS device, and browsed to the shared folder on the Blu-Ray player. There are top level folders to browse by album, roll, or date.

iPhotoFS alpha on Google Code

iPhotoFS is a read-only filesystem for iPhoto collections, built on top of MacFUSE. I wrote iPhotoFS to let me easily copy my iPhoto Library to my PC while retaining its structure. There are subfolders for photos organized by roll, album, or month.

It allows you to easily interfact with your iPhoto collection using the Finder and command line utilities like `find` and `rsync`. You can even browse collections on other machines by viewing the share volume.

Download iPhotoFS on Google Code, it’s open source under an Apache license.