Development General

Data Access Layers

At my previous company we created a “data access layer” above all data access layers.  One guy mainly built and maintained our templates for generating code.  Another guy build complicated views for retrieving and updating data which applied business logic, etc.  The database became a repository for metadata about the system.  From then on, the data access layer took over and produced marvels. 

It was quite an amazing system, but like any amazing system it had its down-sides.  You really needed to be an expert to work with it, logic was many layers deep and it needed to load a lot of metadata before the system would start to work.  Basically there was a lot of overhead to get stuff done.

When I started at my current job I’d realised the benefits of automating data access, but foolishly tried to build my own data access layer.  For code to stand between the developer and a database, there’s a lot it must do before it starts to become an integral part of the system.  Unfortunately writing one from scratch, and writing it well is just too much trouble for most people (myself included).  The requirements are many, but most notably it needs to do two things:

  1. It needs to make the developers life easier
  2. It needs to impose standards

Unfortunately those often end up at odds, and even worse often rule one is lost completely.  Slightly more forgivable, rule two often is just really hard to maintain because each organisation has different standards so having one system that works everywhere is most likely unachievable.

So what’s a developer to do? Recently we decided to revisit our chosen tool for generating our data access layer.  We did some research, gathered the names of the most “popular” ORM tools and set about testing each one.  We have a fairly large legacy of code that we need to work with, so there’s a lot of customisation we need to make it work well and have the code look reasonably neat/legible.

We looked at Subsonic, NHibernate, Entity Framework, Linq to SQL, LLBLGen Pro, NetTiers, PLinqo and a few others.  It boiled down to cost vs customisability vs time and effort to setup.  Cost wise we were down to Subsonic, NHibernate, Entity Framework, Linq to SQL, Plinqo and NetTiers.  We dropped NetTiers because it hasn’t been updated in about a year, and dropped Plinqo because it was basically just a wrapper around Linq to SQL (plus we’d need to buy more licenses of CodeSmith).  So we were down to Subsonic, NHibernate, EF, and Linq to SQL. 

The first framework we tried was Subsonic, took 5 minutes to setup, a quick tutorial video and we were off (I read some documentation too).  Within 30 minutes I’d generated a data access layer, and within an hour I was customising the templates to do little things I wanted them to do.  It was simple, quick and efficient.

NHibernate was an eye opener.  Many config files, odd documentation, no easy “do x, y and z and you’ll have a DAL”.  I resorted to using a copy of CodeSmith with some NHibernate templates to generate the classes and config files for me and even then it was just too complicated.  I know it can do miracles, but we just need something simple and this much config is just too much trouble.

EF was easier than NHibernate, but still had its downfalls.  It offers the world, which means it has extra complications, models, etc.  There wasn’t an easy way to simply add a table to the database and have it generate the code for us in the custom ways we want it to.  The only real benefit it gave us was complicated ORM functionality that we didn’t need.

Linq to SQL is great, but again not much customisation, and really Subsonic and other frameworks provide better features.

So in the end it our decision was clear … Subsonic was the easiest.  Even before we’d made the final decision we had some of our developers asking “can we use Subsonic in project X?” 

The only down side so far to Subsonic is that submitting changes to their code/templates requires you to use Git, which so far is proving to be a real pain in the ass. I guess you can’t have everything you want in life, but at least I have a nice ORM now.



Being a guy and a geek, I tend to be rather gadget prone which can be quite frustrating when working on a limited budget. So when the 5 new pay tv licensees were announced about 3 years ago I rejoiced in the promises of lower cost pay tv and waited, and waited, and waited.

From the start ODM were one of the better sounding choices and they continued to be the leader of the pack until they finally were the first to launch their service publicly at the start of this month.

In the first day it was clear that they had hit a great price point with their offering. In the first few hours of that day they were sold out of their entire month’s stock of 50 000 decoders. At this point in the story opinions differ greatly… Either they are the most useless company in the world, or they have done a great job of dealing with a very sudden and very unexpected influx of customers. I am in the second camp and hopefully this post will explain why.

In only a few days they almost doubled their call centre staff. A few days later it grew again, and a week later it doubled yet again. In just over a week they also increased the number of installers significantly and they brought in extra stock in a few days to help relieve demand.

Systems intended to work with 10 000 subscribers suddenly had to work with 50 000 and I can’t think of many companies who would have handled this better.

All that aside, I prepared myself by looking on forums for information and expecting bad service due to an overwhelmed call centre and overly busy installers.

Last Sunday I decided to get TopTV and it was surprisingly easy. I called 4 stores, found one with stock near me, bought the decoder, came home and called the call centre. A short 15 minutes later and I was signed up and had details for three installers near me.

On Monday I called an installer and 4 hours later I had the dish and decoder installed by a friendly and efficient guy. Another 15 minute call and the decoder activation had begun.

The experience so far has sounded ideal, but it has not been without its problems. Activation of the decoder failed initially and it took a day to sort out. I didn’t get the promised sms to rate the installer’s work and I had to call in to find out how much I owed them. Three failures, but none of them really important.

When it comes to the decoder and service, I have had very few problems. The Electronic Program Guide (EPG) has been improving but has a long way to go before I would call it fully functional. My main gripes are that about 5 channels have no epg information at all, one is 2 hours out if sync and there are no episode numbers on the shows or years of production on the movies.

For now, however the detail has been enough to find whatever I would like to watch quite easily and considering that there are virtually no adverts on any of the channels at the moment I am quite happy with the compromise we currently have.

On the whole I have found it to be good value for money, with lots of potential to become amazing.

Geek food General

Children of Chaos

I have had this book on my bookshelf since 1997(or maybe 1998), but it has sat there unread for a number of reasons over the years but finally it seems my brain has been prepared enough to take it in.

If you didn’t get the blog post title, the book is Children of Chaos by Douglas Rushkoff.

I keep thinking that he is talking about YouTube or Twitter, things from post 2005, but then he starts talking about the new fangled browser Netscape, recently evolved out of Mosaic, and it hits home the fact that he is talking about our online world today as a “prophecy” of where he sees us heading based on the cultural shifts around him in the mid 90’s – 15 years ago!

There are bits of what he talks about that are only now starting to become reality in south Africa in the past few weeks thanks to the recent uncapped broadband offers at reasonable prices.  Video content generated by individuals not corporations (like YouTube or more specifically examples like our local ZA Tech Show Live Stream).

I am filled with great hope for a far more connected community, and greater freedoms and expressions of a non-traditional media.  He pre-empts some of the thoughts in the Cluetrain Manifesto (1999/2000), the blogging “revolution”, and the demise of traditional media (which has only really hitting the “front page news” in the past few years.

A lot of the concepts expressed in the book can come across as socialist, anarchic and anti-establishment dreams for the future but if you look beyond those labels you will find an expression of the struggle for meaning, relevance and the value of an individual within an increasingly global and politically correct society.

There might be a lot that is disagreeable in the book (depending on your personal beliefs) but the fact that his vision of where we would be heading from 1996 forward has such a lot of similarity with what has happened in the past 15 years shows that, whatever disagreements you might have with his philosophies, he has a good understanding of our culture and the forces that drove us forwards in the past 15 years.

Give it a read, you might be pleasantly surprised.


Xbox 360 Media Streaming and how TVersity rocks

Let me start at the begining here.  I’ve always loved podcasts, and video podcasts so I have a fair bit of odd format video on my PC.  Add to that videos from digital cameras of my own, my wife’s, and friends and family and you end up with a large problem.  Person A has encoded as WMV, B uses DivX, C uses XVid, D has made an FLV, and E has some odd concoction from elsewhere.

On my PC I usually resort to VLC to play back videos that are tough to play via anything more standard.  But this doesn’t help me play that video on my TV 2 rooms away from my PC.  This is where the XBox comes in.

Since Windows Media Player 11 (apparently), you can share your video and music library on your PC with your XBox.  While that’s pretty darned awesome, it has one catch: The XBox does all the decoding of the video format.  So if it’s in anything even remotely non standard, it fails badly.

Recently we upgraded to nice new PC’s with Windows 7 on them, and so entered Windows Media Center which became the bane and joy of my life.  With this, I could stream my media to the XBox and the Media Center would do the work of decoding the odd formats and encode them in a format that the XBox could use.

Awesome! Problem solved!  … But life isn’t that nice.  For all it’s wonders, the Windows Media Center interface just keeps on hanging.  It seems to improve if I remove certain of the more troublesome videos from my library, but that doesn’t really help if I want to watch those videos.  I’ve resorted to using Windows Media player to push the trouble video’s down to the XBox as a “Media Center Extender”, which means running from the TV and the PC to queue up a video and then running back again to watch it before I miss the start.

Another down side was that only one PC could be associated with the XBox’s Media Center interface at one time.  So either my wife’s PC or my PC could stream, but not both.  We needed to pool our media, or go through a complicated process to swap the XBox Media Center from the one PC to the other.  (Neither was a really good option)

Enter TVersity. [Queue angel lights overhead, and heavenly music]

TVersity does exactly what Windows Media Center does, just without the Media Center interface, and with way more video transcoding abilities. (e.g. TVersity handles .flv files quite well, while Media Center doesn’t handle them at all)

It wasn’t quite as simple as download, install, and revel in the beauty of a working system though.  So here’s the deal for getting it to work:

  1. Download TVersity
  2. Install TVersity
  3. Search the start menu for “Allow a Program through Windows Firewall” and run it
  4. Find TVersity Media Server in the list, and ensure that “Home/Work (Private)” is ticked (it wasn’t on mine, and without this your XBox won’t see TVersity)
  5. From there it’s a matter of tweaking TVersity to your needs. I went to “Settings | Transcoder | Windows Media Encoder (for Xbox and Windows Mobile Devices)” and changed it to use “Windows Media Video 9”, which improved the video quality quite nicely.

That’s it.  Now on the XBox you can go to “Video Library” and you should see your PC’s Tversity server running nicely.


ARG’s, Innovation and Evocation

I’ve always been particularly intrigued by ARG’s (Alternative Reality Games), and having just watched Jane McGonigal’s TED talk on “Gaming can make a better world”, I checked out her new game “Evoke

For those who don’t know, she’s done I Love Bees, World Without Oil, and The Lost Ring to name just a few of her ARG’s.  This new one seems to be all about learning to innovate, motivate and solve problems.

I’m trying out Evoke and this post is part of my first mission.  It’s all about social innovation.  Learning to innovate and to engage in “social networking”.  Even though it’s a game, they have some great resources for budding entrepreneurs who might need some guidance on what kind of products to build or how to target your product correctly.

Their first link is to “Innovation in Africa tips”, which (despite the odd language structure in the title) has some great advice.  Like the following point from a post of Ethan Zuckerman entitled “Innovating from constraint”:

Don’t fight culture (If people cook by stirring their stews, they’re not going to use a solar oven, no matter what you do to market it. Make them a better stove instead.)

Just this one bit of advice would save developers thousands of hours of time that they otherwise would have wasted.  Just recently we’ve spent an age designing a report based on what we thought were the requirements from the client.  Only to find out it’s completely un-usable because all of our “great ideas” are just distracting from the key things that the client wanted.

Sometimes (strange as this might sound) the customer really is right.  And even if they’re wrong, a silly solution that gets used, is infinitely better than a perfect solution that nobody ever touches.  It’s great to be reminded of these truths that we forget, it’s unfortunately sad that we forgot them in the first place.


Devs 4 Devs

I was at the Devs4Devs event today.  It’s one of those events that really is a great change to the norm in local developer events.  Having a time limit of 20-30 minutes per talk is an effective way to make the speakers focus and get through the meat of a topic.

In my experience it seems to be used for two main purposes:
1. Training new talented speakers
2. Sharing knowledge

On both of those fronts I think it’s highly successful.  It seemed like today the “new” speakers were first, followed by the more seasoned guys which gave a nice opportunity to see what skills the more “seasoned” guys had that the “newer” guys didn’t.  My list would be:

  1. Introduce yourself
  2. Let people know where you’re taking them on the talk (think “agenda”, but less formal)
  3. Slides – Don’t use too many slides, Less is more (one word and a picture is better than 40 words on a slide), use animations sparingly (moving at pace requires focus on what you’re saying, not your slide)
  4. Demos – don’t type your own code (either copy/paste, use snippets, or comment out the code), practice, practice practice (know your code), explain enough but not too much (remember the audience probably isn’t as great as you are at your topic)
  5. Engage the audience – find questions to ask (not too many), make the demo’s have an aspect of realism (how will this technology/idea/topic make their life easier – don’t just demo it, say it explicitly), offer to give the source you demoed to people on a USB stick or put it on a website before the talk and hand out the URL.
  6. Leave your contact details, point people to online resources that helped you learn. (Demo’s and talks are all fine and well, but when your audience gets back to their PC they’ll have forgotten 3/4 of what you’ve said – hopefully they’ll remember one of the resources you pointed them to)

The talks that left the biggest impression on me were probably the MVVM Pattern talk and the Sketch Flow talk. (VS 2010 was great, and has inspired me to use the product, but the others inspired me to go out and create something)

Thanks to all the speakers for some great topics and to Microsoft for hosting the event.  I’m looking forward to the next one.


Android App Review – Layar

App Name Layar Layar
Price Free
App Availability Android Market or the Developer version at

This is one of the apps with really cool possibilities.  You can overlay any geographic information on the augmented reality display.  There are layers for Wikipedia, Qype, Google’s “Local Search”, Flickr, Hotels, Mazda dealerships, Brightkite, Twitter, and even International Architecture.

As an application, it’s really easy to use and well designed.  My only problem was not knowing how to find new Layers.  Which was eventually resolved when I realised that from the “Layers” view, you can search for them in the Search tab.

As a concept, I think we’re only starting to scratch the surface.  Imagine a bus service, where you can search see what busses are arriving from where, and at at what time.  Or a movie service where you can search and see where around you a certain movie is showing.  Then click on the location and book your ticket.

Festivals, sporting, music, and cultural events could be greatly augmented by technologies like this.  You have a load of people who aren’t usually in an area, and applications that help you find a place to eat, or see where spontaneous events are happening “real time” will be great tools to organise people and, for businesses, being visible on those applications would stand a chance to get a load of customers.

I’m quite excited to see where “Augmented Reality” applications are going to end up and if they’re as open (developers can use the Layar API to provide their own layers for the application) and well built as Layar, I think there’s going to be some awesome innovation.


Android Market App Review #1

Big news this week was that the Android Market arrived in South Africa.  Only a quick flash of the devices ROM using the officially supplied file, or a quick trip into any Leaf store, and it was done. (See: MyBroadband article)  I’ve downloaded a few apps and wanted to review a few of them quickly.

Android Market

AndroidMarket Apple has the App Store, we have the Android Market.  I’ve not seen much of the App store (my wife has one, but I haven’t used it much).  You won’t go far wrong using the apps that are highlighted across the top bar.  Searching for applications are easy, and the categories seem to be really well maintained.

Applications download easily and are quickly kept up to date (I’ve had a number of updates in the few days that I’ve had the Market.  You can see applications that are installed, and applications that need updating by going to the “My Downloads” section.


Barcode Scanner

BarcodeScannerThe second application everyone MUST have is the barcode scanner.  You can use it for scanning many kinds of codes.  Many sites display these barcodes instead of links to applications (I will be using them too at the end of this article).  You can then use the scanner to read them and you’ll get directed to the Android Market. It can be used for Contact details, notes, and as plain old numbers.



Twitroid When it comes to Twitter Apps (free ones), Twidroid is the best.   The UI is pretty simple, and they keep it up to date.  It does DM’s, RT’s, can attach pics, and browse through your followers and people you follow.



SkyMap I’d heard about this application before Android was available in South Africa.  As an amateur astronomer I always struggle to know what exactly “that bright star over there” is. With Sky Map, you simply point your phone at the sky as if you were taking a photo of the star, and Sky Map will show you what stars are there.  If you’re looking for a star or planet, you can search for it, and Sky Map will show you where it is. Google’s site for Sky Map has a nice demo.


Task Killer

TaskKiller Android usually does a great job of managing your processes.  As soon as it figures out that an application needs more memory, it closes applications that aren’t currently in focus.   As a developer, it’s a really annoying habit of the OS because you have to build your applications to take this into account.  Unfortunately when you have a bunch of apps that run in the background, your battery life can start to run out quickly.  Task killer shows you what applications are running and you can close them easily.


Useful Switchers

UsefulSwitchers Turning on/off various features ends up being a long process unless you have Useful Switchers.  Another battery saving tool, this lets you quickly turn on or off services that usually would drain battery life.  So with one click you can turn on/off bluetooth, gps, wi-fi, and even swap into “Flight mode”.  It has a “flashlight” and the ability to change the brightness of the display (really handy at night).



PlacesDirectory What Skymap does for stars, Places does for things closer to the earth – just without the super cool graphics.  Do you want to find the nearest restaurant?  Go see a movie?  With Places you can search for establishments around you and it will direct you there. There’s a few other apps that can do this too, some cooler than this, but this is another one of those apps that I’ve heard about for ages and had been waiting to play with.  One thing that it’s lacking is the ability to add new content, but I’m sure it will grow in future.  It’s South African content is ok, but not great.   If you’re travelling abroad or in a different city, this could be really useful.


Android devices to get Flash 10 beta in October!

Just read a tweet from @DevDroid linking to a post by TalkAndroid entitled “Adobe Flash Player 10 For Android Due In October”.  I haven’t listened to the entire talk from Adobe but here’s the quote from their slideshow:

Flash Player 10 for smartphone-class devices to be made available in beta at MAX conference in October  []

According to TalkAndroid, the Adobe CEO Shantanu Naraye said:

Google’s Android, Nokia’s Symbian OS, Windows Mobile and the new Palm Web OS will be the first devices to support web browsing with the new Flash player [via Talk Android]

So, still no word on iPhone getting Flash.  It makes me really glad that I chose to purchase a phone based on an open platform.


Getting Android Apps without the Android Market

A “smartphone” without applications isn’t a SMART phone, its just a phone.  I know I’ve complained about the lack of the Android Market in South Africa.  Apparently the guy at Google in South Africa who’s responsible for the Android Market has said that it’s coming soon. (I didn’t get a response to my email to him asking him for a comment, but that’s what I’ve been told by another local Android fan)

My favourite so far is Handango, but here’s my list of markets.  Worst of the pack (so bad I didn’t include them, were and – no “on device” experience, and a lot of really bad applications.)

Handango – starstarstarstar

Handango has been around for years.  I’ve used them for apps on my old Palm pilot, Windows Mobile phone and now on my Android phone.  Their Android selection isn’t huge, but they have some fun games, apps, and tools.  If you go to from your device you’ll be prompted to install “InHand” – their Android application for browsing through their store and downloading apps.  They even have some EA games in their catalogue.

Rating: 4/5 – Good, but really not as good as Android Market – no way to be informed of updates to an application that you’ve downloaded already.

MobiHand – starstarstar

I hadn’t heard of them until I started looking for alternative App stores. MobiHand seem to have a pretty extensive collection of applications for many devices.  They have a really well trimmed down mobile site at which you can use easily from your Android device.  My only complaint about the online store on the Android devices is that when the list of apps is too long and they start to split them into pages, the links to swap from one page to another are so incredibly small that it’s virtually impossible to click them without zooming in 3 or 4 times.

Rating: 3/5 – It’s good, has a start in the “on phone” experience for browsing for apps, but it’s not a happy experience and could use a few more apps.

Handmark – starstar

Yet another new store to me, Handmark seem to have made a really clean site.  Their software selection seems a little less impressive than both MobiHand and Handango.  That could be because both their mobile and full website seem quite tough to use to find applications.   It looks good, but just seems to require too many clicks to get there.  However, they seem to be the only app store that is selling some of the great EA games like The Sims 3, Spore, Sim City and a bunch of others.

Rating: 2/5 – Not a great search or “on device” experience, but the EA games are a big plus.

Google Search – star

Thanks to Google, I found my a great app for Geocaching, which had just been released for Android.  It’s called CacheMate.   I also found GeoBeagle, which is a free app.  That’s how I found Twitli – a really nice Twitter application.

Rating: 1/5 – You can get some nice things here, but it’s a lot of work.

Open Market – star

I’ve written about this before – you can get to it at Open Market.  It’s great, but is missing a load of apps. Doesn’t do paid apps, and I still haven’t heard back from them about the app I wrote and submitted to them a few days ago.  Until it gets more fully fledged, it’s not going to be a real contender, but you can download it on your phone at

Rating: 1/5 – because it’s just South African, has no paid apps, doesn’t let you register as an app developer or downloader.