Relief is a framework built on top of Google's Closure tools. Its purpose is to enable quick iteration on a project by providing infrastructure and architectural compoents such as a navigation manager and RPC service.

You can find the source code and documentation at

Wednesday, July 6, 2011

How I Found Relief

In early 2010, I re-discovered my love of web development, and picked up my dusty HTML/CSS/Javascript skills and began writing a fairly ambitious web app. Then, I discovered the Closure Tools. I quickly scrapped what I had and started over. Closure was great! A month or so and a few books later, I truly started understanding all the nuances of the language that I hadn't learned 5 years prior, when I had last done any real web development. Again, I started over and really made some good headway.

Later on, I had an idea for another app that I thought might be useful, so I began to write it. In the process, I ended up copying, pasting, and modifying a lot of the code from that previous one into this project. Then I started a third project. Anyone who's programmed for very long knows how this goes: "Hey, these things would probably be a great basis for a framework." So my third project turned into Relief. I spent a lot of time trying to generalize a few core components: Navigation, RPC, and Authentication/Authorization. In the end, I had what I believed to be a good mix of true boiler plate eradication and an API that would allow users to extend the functionality of these components in really powerful ways.

Relief is written in true Closure style. Type checking and JSDoc are woven throughout the source code. Each component's API defines specific classes and interfaces where developers can plug in their extension points while not having to worry about making another XHR request, listening for ONHASHCHANGE events, or parsing cookies for authentication details when they want to know the user's first name.

It's true that Relief is verbose compared to the JQuery style of doing things, just as Closure is. However, I believe there is true power in this verbosity. With the RPC Service, yes, you have to write a Command class, but you automatically get all the infrastructure for making the request, handling the response, detecting failures, and real in-app caching for free.

Try it. I think you might like it. If there are points you think could be better, by all means let me know. I'd love to hear from you.

No comments:

Post a Comment