Skip to Content
Common Design Patterns for Symbian OS: The Foundations of Smartphone Software
book

Common Design Patterns for Symbian OS: The Foundations of Smartphone Software

by Adrian A. I. Issott
December 2008
Intermediate to advanced
443 pages
10h 24m
English
Wiley
Content preview from Common Design Patterns for Symbian OS: The Foundations of Smartphone Software

5.2. Asynchronous Controller

Intent

Encapsulate a finite state machine within an active object to efficiently control a modest set of related asynchronous sub-tasks.

AKA

None known

5.2.1. Problem

5.2.1.1. Context

You have a single overall task that you wish to perform that requires a modest set of asynchronous requests, or sub-tasks, to be performed in a prescribed order.

5.2.1.2. Summary
  • You wish to keep your thread responsive to higher-priority event signals, such as those from end user events, whilst the overall task is being performed.

  • You wish to reduce your maintenance costs by encapsulating the control of which sub-task is performed next within a single class so that future changes only need to be done in this one place.

  • You wish to reduce the amount of RAM used by your software, for example by reducing the number of threads running in your process and by minimizing the code size of your solution.

  • You wish to reduce your maintenance costs by reducing the time that you spend debugging your software.

  • You wish to reduce the time that you need to spend testing your software looking for defects.

5.2.1.3. Description

If you've read Active Objects (see page 133), then your first question is going to be: 'What's the difference between a task and a sub-task?'. This is a question of granularity but the essence is that a task is something that other parts of your software are interested in completing whilst sub-tasks are the internal steps needed to achieve that end. Hence no other ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cocoa Programming for OS X: The Big Nerd Ranch Guide

Cocoa Programming for OS X: The Big Nerd Ranch Guide

Aaron Hillegass, Adam Preble, Nate Chandler

Publisher Resources

ISBN: 9780470516355Purchase book