Wednesday, May 04, 2005

A Different Approach to Explaining Descriptors

Every Symbian OS programming book has a chapter on descriptors, which is usually fairly near the start. They are all quite similar and will show the class hierarchy, a few diagrams with boxes and pointers, and more often than not will give some comparison with an equivalent C string type for each descriptor type. Then there will be a few examples of how to use them, which will all work.

You will read this not-too-interesting chapter while trying to keep awake; you’ll look at the examples and it will all make sense so you’ll think you can use descriptors. You may still have a few worries in your mind, like “Why doesn’t Ptr() return a TPtr?”, but you move on. Then you do some development for real, which inevitably involves descriptors, and bang. It all goes wrong. You can’t decide which descriptor type to use and, when you think you’ve got it, the darned things won’t compile, or work without crashing or simply work at all. But don’t worry, this happens to many new Symbian OS developers, if not all of them. We’re here to help by taking a new approach to explaining descriptors.


FAQs Facts, Fax
The blog will consist of frequently asked questions. It’s difficult to take in information from a long, dry and dull chapter on descriptors. FAQs are different. They are much more interesting to read and present one piece of information at a time.

Good examples, bad examples
Symbian OS books always give examples that work (or that should work but for bugs introduced during publication). We are usually left to discover how to misuse descriptors at our leisure. Then we have to figure out why they are not working. This is hardly leisure. So this article will give lots of misuse examples too. We’ve made all our mistakes public so you don’t have to make them too.

Repetition
We say the same things again and again in different ways. We repeat ourselves. This is intentional. Some of these things are so important that you must understand them in order to use descriptors successfully. If repeating and re-describing helps your understanding, it's worth the effort.

Did we mention that we repeat ourselves?

Comments:
Jo,

Thanks for this resource and I will be referencing it extensively! I have a personal project that I'm currently working on that uses a ton of descriptors (http://www.db75.com/blog/archives/000095.html). I have your blog bookmarked for when I stumble across any road blocks.

Thanks again,
Denniis
 
Ah, excellent resource. We will show you our mistakes so you do not have to suffer them at 'leisure'. I like that thinking, bookmarked your page.

Is this an 'anti-pattern' for descriptor useage?

Conrad B
 
wow this is an excellent article regarding symbian i have read so far with such a clear explenation .. thank x a lot ...
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?

Google
WWW Descriptors FAQ