Presented at 360|Flex 2012 in Denver, Colorado.
Posts Tagged ‘architecture’
As we create software is seems like we come in contact with the same patterns over and over. Usually, we end up re-writing them over and over as well. Take an array of user objects, each with a
username property. We need an array of all the usernames from all the objects. So, like many times before, we create a new array to populate, create a for loop, snag the object at the current index, grab the username and push it into the array.
To me, that’s boring. It’s mundane. Underscore makes it fun again. With Underscore, we just use pluck():
var usernames = _.pluck(users, 'username');
Ah…concise, fast, and boilerplate is gone. Want to find all objects within an array that pass a specific test? Use the
filter() function. Just want a reference to the first one that passes the test? Use the
find() function. Want to retrieve the union of two arrays, that is, retrieve a single array of all unique objects contained within multiple other arrays? Try the
union() function. Merge properties of multiple objects into a single object? Use
Once you grasp the power of Underscore you’ll find yourself being more productive with less code while having more fun. Some have called it the bowtie for jQuery’s tux. I concur. Continue reading »
Never build large apps
The secret to building large apps is NEVER build large apps. Break up your applications into small pieces. Then, assemble those testable, bite-sized pieces into your big application.
This post is intended to be the first of a series. I want to be clear about what it entails and its intended audience.
For the past several years I’ve been an architect in enterprise-level RIAs. This is a fancy way of saying I oversee the design and construction of apps that are web-based but have a lot of the same characteristics as desktop applications. Some of the applications I work on are in fact desktop applications but heavily communicate with the web. The line becomes very blurry, but the main point is–I deal with applications which in my world are quite different than what is often considered a “website” even though they both live within a browser.
UPDATE: Since the writing of this post, I’ve converted to and fully endorse Robotlegs as my MVC framework of choice. I invite you to check it out.
For those who don’t know, Nimbus is a Flex MVC framework (or micro-architecture for the technically-inclined). Sponsored by Rain, we develop it primarily for use on our applications but make it available for public use and encourage the community to contribute.
Nimbus pulls core concepts from Cairngorm but is meant to cut out a lot of the plumbing developers groan about when they hear “Cairngorm.” It’s light, but it’s not fluffy. Baked in are those rare and tasty flavor morsels you thought only existed in those Funfetti cupcakes your grandmother bakes with love on your birthday. Continue reading »