You Are Here:

Community: Blogs

Who am I?

mopius

Thinking about what mobile phones can do except messaging and voice calls is one of my main interests. At the department of Mobile Computing at the University of Applied Sciences in Hagenberg (Austria), I can work on those ideas every day by collaborating with students, researching and - well - thinking.

 

Calendar

« March 2009 »
Mo Tu We Th Fr Sa Su
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
 

Andreas Jakl's Forum Nokia Blog

Fundamental changes in native Symbian OS development

mopius | 27 March, 2009 11:41

Just announced rather silently in the Symbian Developer Newsletter, one of the biggest changes in the world of Symbian OS development is on its way. It's all about the letter L, which represents the new idiom of L-classes. According to the documentation PDF: "The L prefix denotes that these classes may be Liberal when it comes to Leaving, while being Leave-safe themselves."

When working with Symbian OS and of course especially when teaching it, the biggest issue have always been the descriptors. While they are a nice concept and a good example of polymorphism, even the simplest string modifications often required looking up some code examples or documentation. Now, the new LString class can finally take care of automatically resizing its buffer (on the heap) and memory cleanup. Additionally, the LString is also derived from TDesC, making it possible to use it with all the standard Symbian OS APIs.

Other changes include the possibiliy to put everything from the two-phase construction into a single C++ constructor, by using macros and special templates. Makes the code easier to read and shorter, and is therefore also a welcome change. Memory management (plus cleanup stack) usage has also been simplified through the use of new class templates (LCleanedupX and LManagedX), which provide automatic resource management.

We'll see how these new additions work out in real life, but at least on paper, they do sound promising and make it easier for newcomers to start developing with Symbian OS. The only problem is that those new concepts are added to many other already existing idioms, increasing the total amount of information you have to know when you really want to do a lot - and it'll not be possible to get entirely rid of old descriptor classes like the HBufC, as they're still used by many system APIs. Also, that these resource management tasks are done automatically usually means less efficiency compared to the manual way that has always been in Symbian OS - one of the reasons why the OS is so fast, even on low spec hardware. Most probably, you'd use native Symbian OS C++ code for the more low-level and highest performance code (and do resource management manually), and prefer Qt or Widgets instead for other applications in the future.

Another interesting sidenote: if you take a look at the new header files, you'll see that they are already released under the "Symbian Foundation License v1.0" (even though the source code is not included yet) and that they are contributed by Nokia. In case I didn't miss anything, this is most probably the first public third party contribution to the Symbian Foundation. Let's hope we'll see more of those welcome additions in the future - even though it means that I'll have to rewrite many parts of the Symbian OS course slides when there's time...

Read more about the L-classes at the Symbian Developer Network, especially at the pdf linked to at the end of the article.

RSSComments

Indeed, who are these L-classes really for?

Sorcery-ltd | 27/03/2009, 19:55

Sorcery-ltd

I agree completely with:
"Most probably, you'd use native Symbian OS C++ code for the more low-level and highest performance code (and do resource management manually), and prefer Qt or Widgets instead for other applications in the future."
The use of templates in the L-classes makes them generate more code than you would write doing it "the old way", so I'd assume most of the core OS development will not use them. Then, if you want to escape the complexity of Symbian C++, these classes only get you a very small part of the way there, plus they add complexity overall, since you can get rid of all the old idioms either. Qt would be a much nicer option, or why not just some standard C++ interfaced to native Symbian C++ if you're not writing a UI?

Personally I doubt this is a fundamental change in native Symbian OS development - Qt certainly is though!

Mark

Re: Fundamental changes in native Symbian OS development

wizard.hac | 29/03/2009, 14:23

Andreas Sir, I agree with Mark - the changes wouldn't incorporate into the native OS. Even if they had many advantages (which they don't) who would change the code at so many places? Optimization is required when necessary - I don't feel it is necessary.

Qt- Well, new guys learning Qt wouldn't be wise enough to judge what to study and use- they would just learn what is in the channel and adapt.

As said- there is a lot in the pipeline.
http://hacwiz.blogspot.com/2009/03/theres-lots-more-in-pipeline-quotes.html

Usefulness

mopius | 29/03/2009, 14:44

mopius

Yes, I also think that not too many of those new possibilities will be used in the core OS.

The question is whether Qt will be adopted by all licensees of the Symbian Foundation in the future - e.g., SonyEricsson and Samsung. If it's a Nokia-only solution or if other phones don't have all the mobile extensions, native Symbian OS C++ development might still remain the only way for some applications that want to target a broader phone manufacturer segment.

So, if developing applications using native C++ as a third party, for most situations I'd still prefer the ease of use of the new LString compared to the traditional descriptor classes - even if there's a little code overhead involved. The other changes are maybe not so fundamental for somebody who knows how to write two phase construction and how to use the cleanup stack, but could still be very helpful for newcomers.

The main question is the trade-off. Sure, if you know how, you could write perfectly efficient and error free code in native Symbian OS C++. However, I doubt that most solutions are written that way (remembering some of the source code I saw at Siemens Mobile). So: is it better to have a very efficient system and many developers not using it correctly, or a little bit overhead but less programming errors in real code? I think for third party developers who are not 100% specialized on Symbian OS, the second alternative is better.

You must login to post comments. Login
 

Rate This

 
 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fblogsE2eforumE2enokiaE2ecomhttpE3aE2fE2fblogsE2eforumE2enokiaE2ecomE2findeE78E2ephpE3fopE3dViewArticleE26blogIdE3d1412E26articleIdE3d475X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZBlogContentQ qdcZtypeQUqfntypeZBlogE45ntryQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZcppQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZBlogContentQ qfnZtypeQUqfntypeZBlogE45ntryQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxs60X qfnZuserE5ftagQSxsymbianE2dcE2bE2bX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZBlogContentQ qrdfZtypeQUqfntypeZBlogE45ntryQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ