Issott_Common Design Patterns for Symbian OS-The Foundations of Smartphone Software_0470516356 (779879), страница 79
Текст из файла (страница 79)
. .un-marshaling process182–3Unicode text 116unit-test code 23see also testingUniversal Service Directive(EU) 54upgrades, mobile devices 5URLs, conventions 13usability property of services166, 207USA Enhanced911 – WirelessService specification54USB 104–13, 115–29, 384Use 55–62, 65–72, 76–85,388user capabilities, concepts236–8user interfaces, constraints 6,45–7User::Leave . . .
38–9,40–1, 97–8, 122,154–63, 266–71,359–71User::Panic() 24–31User::WaitForAnyRequest()106–13User::WaitForNRequest()106–13User::WaitForRequest() 44–5,106–13, 138–47,199–210, 270–1,291–2ValidateInputs()244–51ValidatePacketTypeL() 313–29421Versit 177–8VID see Vendor IDView module,Model–View–Controller pattern334–45view switching, Coordinatorpattern 230–1viruses 18WaitForRequest()44–5, 106–13,138–47, 199–210,270–1, 291–2WAN 205warm communicationrelationships 205warm event signals 88web 74, 205well-known patterns,concepts 13,331–95wiki page 1, 14Window Server, ActiveObjects pattern 146,352writable static data (WSD)173, 176, 331,346–71WriteDeviceData 117,261, 268–71WriteUserData 282–3WSD see writable staticdataWSERV 146, 352WSP 384XIP 6, 27, 397–401variables, conventions 13Vendor ID (VID) 117, 181,233–85Y-Browser 258Error-Handling StrategiesFail Fast (page 17) Improve the maintainability and reliability of your software by callingPanic() to deal with programming errors as soon as they are detected.Escalate Errors (page 32) Enhance your error handling by using the Symbian OS Leavemechanism to escalate the responsibility of handling an error up to the point which hasenough context to resolve the error.Resource LifetimesImmortal (page 53) Allocate a resource as soon as possible so that, when you come touse it later, it is guaranteed to be both available and quickly accessible.Lazy Allocation (page 63) Allocate resources, just in time, when they are first needed,to improve how they are shared across the system.Lazy De-allocation (page 73) Delay the de-allocation of a resource so that an almostimmediate re-use of the resource does not incur a performance penalty.Event-Driven ProgrammingEvent Mixin (page 93) Save power and decouple your components by defining aninterface through which event signals are sent to another component in the samethread.Request Completion (page 104) Use TRequestStatus as the basis for event signalssent across thread and process boundaries.Publish and Subscribe (page 114) Securely broadcast changes to other threads orprocesses listening for such notifications as a way of saving power and decouplingcomponents.Cooperative MultitaskingActive Objects (page 133) Enable efficient multitasking within a single thread by usingthe Symbian OS active object framework.Asynchronous Controller (page 148) Encapsulate a finite state machine within an activeobject to efficiently control a modest set of related asynchronous sub-tasks.Providing ServicesClient-Thread Service (page 171) Enable the re-use of code by rapidly developing aservice that executes independently within the thread of each client.Client–Server (page 182) Synchronize and securely police access to a shared resourceor service from multiple client processes by using the Symbian OS client–server framework.Coordinator (page 211) Co-ordinate state changes across multiple interdependent components by using a staged notification procedure that maximizes flexibility.SecuritySecure Agent (page 240) Minimize security risks by separating out security-critical codeinto a separate process from non-critical code.Buckle (page 252) Load DLL plug-ins, which match your level of trust, into your ownprocess to increase the flexibility of your architecture without compromising security.Quarantine (page 260) Load plug-ins as separate processes, operating at different levelsof trust to your own, to increase the flexibility of your architecture without compromisingsecurity.Cradle (page 273) Host DLL plug-ins in separate processes, operating at different levelsof trust to your own, to securely increase the flexibility of your architecture whilstmaintaining communication with each plug-in.Optimizing Execution TimeEpisodes (page 289) Give the appearance of executing more swiftly by delaying allnon-essential operations until after the main task has been completed.Data Press (page 309) Quickly process an incoming stream of data packets, withoutallocating any further memory, by using a long-lived object to interpret each packet inturn.Mapping Well-Known Patterns onto Symbian OSModel–View–Controller (page 332) Allow an interactive application to be easilyextended, ported and tested by dividing the responsibility for managing, displaying andmanipulating data between three cooperating classes.Singleton (page 346) Ensure a class has only one instance and provide a global point ofaccess to it.Adapter (page 372) Transform calls on one interface into calls on another, incompatible,interface without changing existing components.Handle–Body (page 385) Decouple an interface from its implementation so that thetwo can vary independently..