Archive

Archive for March, 2009

Ext JS and Adobe AIR

March 24th, 2009 No comments

As we’ve been exploring ways to take Bespin to the desktop, we’ve looked closely at some of the single-site browser technologies and their individual APIs to work out which platform we favor. As we went through this exercise, Adobe AIR really impressed us with the richness of its JavaScript APIs which wrap native APIs (as well as the accompanying documentation).

There’s no other competing JavaScript API that we’ve seen that comes close to this level of comprehensiveness (please correct us in the comments in we’re wrong).

We weren’t able to use AIR as its implementation of <canvas> is a bit old, but we’re excited to play with it as soon as we can.

Ext JS and Pixel Bender Explorer

 

bender

 

We’re not the only ones who have been playing with AIR. Aaron Conran from the Ext JS crew blogged about Pixel Bender Explorer , an AIR app they wrote to demonstrate how to integrate Ext JS with AIR’s Pixel Bender technology that lets you apply pretty amazing effects to interfaces.

Pixel Bender can spruce up an Ext.air application by adding custom animations to wow your users. However, you should be cautious about the over-use of these filters throughout your application. For a good example of how effective these filters and animations can be to provide proper user feedback you should check Adobe’s signature sample BlackBookSafe. Each time an animation occurs it is clear why it happened, not a surprise to the user and adds character to the application. When using these animations you should strive for the same goal, not to surprise your user, but to impress them.

Categories: Designing, Programming Tags: ,

Big News from Cappuccino: Aristo and Atlas

March 24th, 2009 No comments

atlas

As it turns out, the Cappuccino team has been busy hacking away on some very impressive stuff. Today at the Future of Web Apps Miami, they announced Aristo and Atlas.

Aristo

Cappuccino worked with the popular design firm Sofa to create Aristo, a new open-source look-and-feel that will be freely available, including the source PSD files complete with all layers intact. Anyone may use the look in their own projects. I didn’t get a close look at the theme, but it seemed quite nice.

Atlas

Atlas continues Cappuccino’s efforts to essentially port Apple’s Cocoa stack to the Web. Atlas itself looks like a mash-up of Flex Builder and Interface Builder, all running in a browser, but continues to hew very closely to Interface Builder’s approach. For example, just as with Interface Builder, you can bind properties on components to other components or to code through visual drag-and-drop operations (complete with the same blue connector line).

What’s more, Atlas introduces the equivalent of Interface Builder’s “nib” file (though I forget what their version is called).

In a live demo, Francisco Tolmasky built an RSS reader using an entirely visual approach. Francisco made it clear that he doesn’t think code will go away, but instead, he feels the amount of code required to create a web application will dramatically decrease.

They also released a screencast:

 

Multi-platform Support, including iPhone JavaScript Wrappers

Atlas also supports targeting multiple platforms, letting you create different interface files that bind to the same back-end code. They’ve even bridged native APIs and exposed them to the JavaScript environment and provide a PhoneGap-like way to run such applications as native iPhone applications. Wow.

It’s hard to overstate how impressive the Atlas demo was; the release should be coming at some point in summer 2009.

Great job guys!

Cufón – custom font embedding with Canvas/VML

March 23rd, 2009 No comments

Probably the most requested CSS feature of designers is being able to use custom fonts on web sites. Right now the only real way of doing that cross-browser is relying on Flash, either by building the whole page in it or by using the “Scalable Inman Flash Replacement” or short SIFR script. This does the job for most people but Simo Kinnunen wanted to avoid having to use proprietary software and go for canvas instead to reach the same goal.

 

cufon 

The goals for Cufón were:

    * Absolutely no plugins required – Everything needed to display Cufón is already available by default in your visitor’s browser. Rather than requiring flash to make the switch, Cufón relies simply on javascript alone.
    * Compatibility – Cufón runs on IE6, 7, 8, Firefox and the latest version of Safari. On other unsupported browsers (IE5-, Safari 2) it will fail gracefully.
    * Ease of use – Little or no configuration required.
    * Speed – Cufón is quick. It loads almost instantly with no ‘flicker’ that you would normally experience with sIFR.

Technically Cufón is a web interface to fontforge and creates an SVG font on the fly from your source font using a JavaScript renderer.

Chris Jennings has more details on it and there’s a handy online generator for converting your fonts.

Visually this is pretty cool, however now we need to give it the same rigorous poking we gave SIFR over the years: what does it do in terms of accessibility, usability (copy and pasting text), scaling of text and most importantly overall page performance?

The other problem of course is copyright of font faces, and this is a much harder issue to tackle. Another solution with the same approach, typeface.js had issues with that in the past and this will not be different.

Categories: Programming Tags: , ,

Why You Want To Be A Craftsman Instead Of A Cowboy

March 22nd, 2009 No comments

There has been a bit of a code war going on or at least a some what heated debate on code quality and programming principles.

I’m not going to rehash everything but I will sum up the two sides and throw my opinion into the ring. Why does my opinion matter? I’m not so sure that it does but you can be the judge of that. What I do think is different about my opinion than the opinions that I have heard/read so far is that I can’t place myself in either camp. I am not a coding cowboy that just cares that “it works” and I am not a bureaucratic standards Nazi either. I’ll talk a bit more about why I am ducking for cover in no man’s land in this battle of opinions.

The Coding Cowboys Say

Jeff Atwood and Joel Spolsky sure hit a sore spot when they suggested that learning programming principles just wasn’t worth it and just getting it done was more important.

Jeff likened principles and guidelines to the Ferengi and their 285 Rules of Acquisition saying that every situation in programming cannot be governed by a set of rules and there isn’t a one size fits all pattern to solve everything.

Joel refers to the SOLID principles as “extremely bureaucratic programming that came from the mind of somebody that has not written a lot of code.”

The Craftsmen Say

Jeff and Joel’s comments sparked a lot of rebuttals from the ALT.Net community. It is understandable since those comments attack the very foundation of TDD and DDD. I am not going to bore you with a list of everyone that chimed in but I want to highlight a post that I think sums up this position in a clear and nice way.

Justin Etheredge made a great post is response to the criticisms. I have been reading Justin’s blog for a while and I like the way he views software. He likens software development to carpentry and woodworking, both are a learned craft. You don’t get good a carpentry by throwing things together and ignoring building codes. Patterns and principles are like building codes.

My View On The Whole Thing

I was a bit surprised at first to hear Jeff and Joel’s comments because they are some smart guys that have produced some successful software. I highly doubt, regardless of how it came across, they intended to imply that you should ignore all guidelines and just string together your code. Unfortunately, the comments of their posts make it all too clear that this is exactly the way a lot of programmers took it. What’s worse is bad programmers will use this as a defense for their resistance to improving their skills.

Like I said, currently I am somewhere in no man’s land. For too long I had the mindset that would take Jeff and Joel’s comments and use them as an excuse to ignore patterns and principles. From the beginning of my education in software development, no importance was placed on “good design.” My college training only focuses on teaching the syntax and considering that “knowing” the language.

After a few years of living in denial, I had to accept that their was far more for me to learn and I began my journey out of the cowboy coding camp and started striving to develop software in a TDD manner. I still have a lot to learn but facts cannot be ignored. Since making an effort to improve my craft I have seen a significant drop in the amount of bugs found in new software I am producing and the bugs that are found are smaller and much similar to solve. So that is my take on the whole thing and I hope that this at least peaks someone’s interest to dig a little deeper in regard to becoming a craftsmen and taking pride in the code they produce.

C# Design Patterns – The Facade Pattern

March 22nd, 2009 No comments

Today I am back with another design pattern. In this post we’ll be exploring the Facade pattern.

What Is The Facade Pattern

The facade pattern is a higher level interface that simplifies and brings together multiple interfaces of a subsystem. What this means is if you want to do something but that requires interacting with multiple subsystems you can create a facade that same only a few methods that handle all the interaction with the subsystem.

Our Application Requirements

In our city dog registration application lets assume there are a few things that need to be done when a new dog is registered. First the new dog and it’s owners must be entered into the system. Next the registration fee must be processed. Finally, we want the system to send the owners the welcome email.

This is a very simple example but this action requires 3 separate systems to do something in order to complete this one task of registering a new dog.

Using The Facade Pattern

For the sake of simplicity and not cluttering this post with too much code, I am not going to provide code for the sub systems, just the facade.

public class RegistrationManager : IRegister { private IAccountingService _accounting; private IMessageService _messaging; private IRepository = _repository;

public RegistrationManager(IAccountService accounting, IMessagingService messaging, IRepository repository) { _accounting = accounting; _messaging = messaging; _repository = repository; }

public void RegisterDog(IDog dog) { _repository.AddDog(dog); _accounting.ProcessPayment(dog.PaymentOrder); _messaging.SendWelcome(dog.Owners.Find(x => x.PrimaryContact)) } }

As you can see this is a very simple example but it illustrates the concept of the pattern. We have taken 3 tasks, each belonging to a different sub system, and combined them into 1 task in a facade class, in this case the RegistrationManager class.

The RegisterDog method adds the new dog to the repository, sends the payment order to the accounting system, and sends a welcome message to the dogs owners that are flagged as primary contacts.

Summing It Up

I hope this post helps you understand the Facade pattern and I hope you are continuing to learn and have fun with this series.

Be sure to grab the RSS feed or follow me on Twitter to stay up to date and not miss any posts.

The C# Design Patterns Series

Part 1 – An Overview

Part 2 – The Decorator Pattern

Part 3 – The Abstract Factory Pattern

Part 4 – The Observer Pattern

Part 5 – The Facade Pattern

Why Being A Freelance Consultant Makes Sense

March 22nd, 2009 No comments

It can be depressing reading the news these days. Everyday, it seems, more companies are announcing layoffs and more people are out of work. IBM even annocunced recently that they are offering to move laidoff workers to India, China, and Brazil to fill market demands. AKA they laid you off to outsource your job to cheaper countries. The moved workers will expect to receive salaries comparable with that of local workers. Ouch!

With the idea of job security pretty much non-existant, what can you do to help insulate yourself from these tough economic times?

Now is a perfect time to work for yourself as a freelance consultant. Yes it is! Here is why.

3 Reasons You Should Consider Becoming A Freelance Consultant

1. Even though companies are laying people off, the jobs still need to get done. Big companies may outsource to other countries but small to medium businesses will likely look to local consultants to fill the gaps they can’t afford to fill with full-time employees.

2. Your costs are relatively low. The costs to strike out on your own are pretty low. You can arm yourself with free and open source software to fill almost all your operational needs. I will do a post later on starting up a business using open source and free software. Health care will likely be your biggest expense.

3. Your time is your own. Imagine walking to the hardware store, eating lunch with your significant other, or playing soccer with your kids in the middle of the day! Well, as a freelancer you can do that. You set your work hours and you decide how much you need/want to work.

If you have been recently laid off or are frustrated with or feel trapped in your current job maybe making the jump to being a freelance consultant is something you should consider.

This is an area that I’ll expand on in future posts so make sure you grab the RSS feed or follow me on Twitter.

How Does Getting Free Stuff Sound?

March 22nd, 2009 No comments

Lately I have been enjoying the Design Pattern series and my posts on becoming a bad developer and decreasing performance have been popular. I entend to expand on these areas meaning you will see more posts on programming principles and best practices some of which will take the more sarcastic and negative side to make the point. In addition to these I plan to try out a new kind of post. This will not be that frequent but I think it will be useful to you.

The Proposal

Occasionally I am going to review a book or service that is relevant to programming, running a website, running your own business, or technology in general. You can take a look at the list of products I will be choosing from here. There will also be a few hanging around on the right side bar as well.

How To Get It Free

The best part of these reviews is that you will easily be able to get these books and services for free. That’s right. These will not be paid reviews so they are my honest opinions. I will have personally used these products so I won’t promote anything that is crap and that I wouldn’t use myself.

In the interest of full disclosure, I do get paid for qualified leads. Meaning, if you decide you want to give the service or book a try, you fill out a small form before you receive the product. If you qualify, I get paid a couple bucks.

I hope that you will find these reviews useful.

Build Applications with The Guardian Open Platform

March 22nd, 2009 No comments

The Guardian Open Platform is the suite of services that make it possible for us to build applications with the Guardian. They have opened up their platform so that everyone can benefit from the journalism, the brand, and the technologies that power guardian.co.uk. The Open Platform currently includes two products, the Content API and the Data Store.

1. The Content API is a mechanism for getting Guardian content. You can query their content database for articles and get them back in formats that are geared toward integration with other internet applications. The Content API is a free service including commercial applications. However, there are some limits and restrictions.

2. The Data Store is a collection of important and high quality data sets curated by Guardian journalists. You can find useful data there, download it, and integrate it with other internet applications. The Data Store has a range of different uses for different types of partners. They will include relevant terms and conditions along with each service.

The Guardian Open Platform is a useful environment for anyone who creates for the internet. They will offer more services in the future such as an ad network and an application platform.

 

open-platform

Allow Users to Switch Page Layouts with jQuery & CSS

March 22nd, 2009 No comments

Soh Tanaka has shown us a quick and simple way to allow your users to switch page layouts by using CSS and jQuery on “Easy Display Switch with CSS and jQuery“. The technique is quite simple but the result is very nice and useful.

Today’s web users expect web pages to be increasingly more interactive. To this end, the ability to change page layouts provides your users with a more immersive experience and allows them to consume information more easily, either with a quick gallery view, or a detailed summary view.

 

jquery-switch

Categories: Programming Tags: , ,

Multiple File Upload Plugin with jQuery and Flash

March 22nd, 2009 No comments

 

Uploadify is a jQuery multiple file upload plugin which allows you to change any element with an ID on your page into a single or multiple file upload tool. The plugin uses a mix of JQuery, Flash, and a backend upload script of your choice to send files from your local computer to your website server. It has been tested on IE7, FireFox 3, Safari 3 and Opera 9.

 

flash-upload