Join Now

Hi, I'm Paul, but you can also call me Todd and I won't get upset.

Useful design patterns

Paul.Todd | 30 January, 2008 23:09

I came across a really useful link to a jpg/pdf that show most of the GOF's design patterns.

For those of you that do'nt know, design patterns are really useful abstractions that help you write better code.

When I am designing software I always try to think about how I can express my design in a design pattern as it makes it easier for people to understand

http://www.mcdonaldland.info/2007/11/28/40/ 

The thing I like about this is that its PDF so I can make a dead tree edition for my wall! 

Symbian have also got a link for common design patterns including a section you request what design patterns you would like to see

http://developer.symbian.com/wiki/display/academy/Common+Design+Patterns+for+Symbian+OS

 Finally Gabor blogged about it a while back, but the wiki has agood article on it as well.

Nokia Aquires TrollTech

Paul.Todd | 28 January, 2008 12:06

Nokia have announced they have bought TrollTech.

TrollTech are the guys that have been making the Qtopia UI tools and widgets for various phones and desktops (primarily Linux)

This is great news as I am a great fan of this for UI's as they are easy to use and develop with in C++!

 

More news on TollTech's website

http://trolltech.com/28012008/28012008

 

Some unrelated links

Paul.Todd | 27 January, 2008 19:39

I just got bitten by the facebook bug and found out there is agroup for Symbian developers

http://www.facebook.com/group.php?gid=6322721335 

One of the Champions, Marcus Groeber posted an interesting link in the forums which shows the Type Approval Codes for all the Nokia devices. The TAC is the first 8 digits of the IMEI number

http://www.dnv.com/certification/product_certification/randtte/nokia/nokia.asp 

 

Generating XML

Paul.Todd | 25 January, 2008 00:02

Last year I decided to overhaul one of our internal modules.

This module used hand coded XML for its output along with all the attendant problems - no support for utf8 or for escaping.

 

In the end wrote a little class node class to build a tree and a helper class to dump the tree onto a stream such as a file or blob of memory.

 

Its easiest to think of the xml as having one root element node and the there are two sets of child nodes under the element, the first one is the attribute node set and the second is the child element nodes.

The "clever" thing  about this tree implementation is that it allows you to chain calls together so that is makes it easier to build a tree as the supplied example shows.

The XMLGenerator class will take the root node (or any node) and then write that node and all its child nodes to the supplied stream.

The downside of this approach is that it is recursive and is also memory expensive in that all the nodes are stored in memory rather than being writton out as required.

This will be the topic for a further article 

 

Download the example code using this link 

 

 
 
Powered by LifeType