Archive for March, 2008

Facebook

Posted by thedigitalartist under Uncategorized

In this morning’s meeting, we did a quick estimate on what environments the widgets we’re designing should live in, and determined that Facebook would be the primary target for launch, with the ability to add on more environments being key for the future.

In order to support multiple environments, the part of the widget that generates the embed tags people will use to put the widget on their blog/page/community will be very important. It needs to be able to send login and password information for instance to community APIs (like facebook) as part of the widget embedding process. Therefore we have a certain order of operations that should apply, something like this;

1. Set the base tag (all tags will have some things in common, such as the markup language)

2. Login (this will be optional to some tags, others will not need this step)

3. Assemble Tag (use the information returned by the Login step, combine it with the base tag from step one)

4. Return Tag (return the tag information to the object that asked for it)

Any time I see an order of operations like that, I immediately think “Template Pattern”. A template defines the order of elements in an algorithm, but delegates responsibility for the implementation of those elements to sub-classes.

In addition, a pattern very close to Template is the Factory pattern (many templates make use of a factory method in the subclass for producing objects unique to the sublcass of the template)

So firing up EA, I came up with an Abstract Factory that makes use of a Template for producing Embed Tags for the widgets. It looks like this;

EmbedTagFactory

As you can see, we now have an “abstract” class that defines the order of operations (template), but the details of that can be overridden by subclasses, that are the actual factories producing embed tags. It’s nice, clean, and very functional. The product produced by the factory is the Embed Tag itself (which is basically a string with some validataion built in).

-tim.

Enterprise Architect

Posted by thedigitalartist under Uncategorized

I’m not one to jump into coding without a plan.  Rather I like to to think things through thoroughly, look for patterns, do my architecture and flesh out the requirements of the project.  Now is the time to note any assumptions I’ve made and look for holes in the UI of the project.  More often than not, I’ll do this on paper with a good old pencil, however, there are some other options as well.

One of them is to use a UML modelling tool.  UML stands for Unified Modelling Language (yes, yet another language).  UML is a way of visually charting the flow of a project, and UML can be applied to everything from use/case scenarios, to proceedure, to project management, and of course your class structure.  It’s the last one that interests me the most.  UML can be applied to any object-oriented programming language, and recent UML tools will have support for a variety of them.

A good UML tool can not only help plan the code of the project, but can also generate some good stub code to get you started.   Unfortunately, given Actionscript’s status as a newcomer to the object-oriented scene there are not yet a lot of options in UML modelling tools.  There is, however, Enterprise Architect by Sparx Systems.  I wish there were more options, but if you want a decent commercial solution, EA is pretty much all there is.  And it works…sort of.

I have a few beefs with EA.  Number one, it is not cheap at $300 for the pro edition (lesser versions can not generate code).  Secondly, you can’t actually buy the software, you can only lease it for a year.  That one really grinds my gears.  It is not mac compatible, which is a problem when I’m dealing with Mac environments.  In fact, I don’t think I’ve ever come across a software that was more .net-centric.  After purchasing, I tried to download using firefox and got a bum file.  I didn’t notice the file was 12k and tried to install, getting a blank command screen for a fraction of a second.  Consulting the help files online I noticed “some users have problems downloading”.  So I tried downloading with Explorer and it worked just fine.  For shame.  The worst part is, I now have a 12k file sitting on my desktop that refuses to be deleted or even moved,  as the system thinks it is in use!  Now that makes me angry.

The help files for EA, both with the software and online, are pitiful for a beginner.  Also the templates for Actionscript are totally flawed, and it took me some fooling around to get them right.  Even so, there seems to be no way to get EA to generate constructor functions, you have to remember to add them manually.  And when you are writing functions that override methods of a superclass, the IDE recognizes it and asks you which methods to override (cool) but it then fails to add the ‘override’ keyword in the generated code (so not cool).

I wouldn’t go through all this pain if there was an alternative.  But as I say there isn’t, at least not yet (I’m keeping an eye open for Saffron though).  And yes, I know gmodeller but I’m really not down for a web app in this case.

At any rate, as the only game in town, using EA is still far better than just sitting down and banging out code without a plan.  You just have to be aware of it’s caveats, grind your teeth, and deal with them.

Getting Started

Posted by thedigitalartist under Uncategorized

I’ve started on with the amazing team at Teehan and Lax devising a widget system for one of their clients.

The widgets should live in the following environments:

  • html page
  • AIM
  • Facebook
  • MySpace
  • Hi5
  • Friendster
  • FreeWebs
  • Piczo
  • Xanga
  • Netvibes
  • iGoogle
  • Live.com
  • Pageflakes
  • Blogger
  • Typepad
  • Air
  • VistaSidebar
  • MacDashboard
  • Yahoo Widgets

The challenge with many of these environments is that they require a login and password in order to retrieve information necessary to the embed tag. Not so for a simple html page embed.

Therefore, in order to test all of these environments, I’m going to need to actually set up accounts on all of them, with valid email address.