Главная » Просмотр файлов » Issott_Common Design Patterns for Symbian OS-The Foundations of Smartphone Software_0470516356

Issott_Common Design Patterns for Symbian OS-The Foundations of Smartphone Software_0470516356 (779879), страница 54

Файл №779879 Issott_Common Design Patterns for Symbian OS-The Foundations of Smartphone Software_0470516356 (Symbian Books) 54 страницаIssott_Common Design Patterns for Symbian OS-The Foundations of Smartphone Software_0470516356 (779879) страница 542018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 54)

This means a piece of malware couldprevent them from being loaded. This is seen as a reasonable risk to takeas those plug-ins are not essential to the working of the subsystem. Also,the denial-of-service risk can be relatively easily fixed by uninstalling themalware from any infected devices.Plug-insThe developer of a data provider plug-in has to provide two registrationfiles:• a file that specifies which cradle process should be used to loadthe plug-in, which is put into the Sync Agent’s Import directorywhen the plug-in is installed• a standard ECom resource file that allows a cradle process to load theplug-in via ECom.For example, here is the registration file for the Bookmarks DataProvider:// bookmarkdataproviderhs.rss#include <DataProviderInfo.rh>RESOURCE SYNCML_DATA_PROVIDER test{id = 0x10009ECD; // Data Provider Identifier284SECURITYversion = 1;display_name = "Bookmarks";default_datastore_name ="bookmarks.dat";supports_multiple_datastores = 0;server_name = "SmlHostServer1";server_image_name = "smlhostserver1";mime_types ={MIME_TYPE { mime="text/x-f1-bookmark"; version="1.0";}};}Other Known Uses• Device Management AgentsDevice management agents in the Device Provisioning subsystemalso use this pattern to store remotely manageable device data.

Thispattern is used to allow third parties to supply some of the plug-ins.Originally Buckle (see page 252) was used to support device management adaptor plug-ins that model various types of device data, such asemail accounts. However, a subsequent requirement to permit thirdparties to provide plug-ins meant that the existing need for plug-ins tohave the NetworkControl capability would have incurred significantcosts in time and money for this group of plug-in providers. Sinceongoing communication was needed between the framework and theplug-ins, this pattern was chosen as the way to extend the subsystemto satisfy the new requirement.• Content Access Framework (CAF)CAF provides services that enable agents to publish content in ageneric manner that is easy for applications to use.

Users of CAF canaccess content in the same way regardless of whether the content isplain text, located in a server’s private directory, or DRM protected.Those agents that don’t require any capabilities can be loaded asin Buckle (see page 252). Since this isn’t possible for DRM content,the architecture allows selected agents to be provided using thispattern.Variants and Extensions• Combined Buckle and CradleOne variant of this pattern is where a framework chooses to load plugins either via Buckle (see page 252) or via Cradle (see page 273). Thismeans that the framework loads plug-ins as DLLs into the framework process when a plug-in’s capabilities are compatible withthose of the framework. Plug-ins are only loaded by the frameworkCRADLE285through a cradle process when the capabilities of the plug-in andthe framework process are incompatible.

This means the overheadof creating a new process for a plug-in is avoided unless absolutelynecessary.• Buckle Converted into CradleHere a framework simply loads plug-ins via Buckle (see page 252).However, if a plug-in finds that the limitations imposed by just runningat the capabilities of the framework process prevent its operation thenit may choose to supply an ECom plug-in that satisfies the framework,create a separate process and then forward all calls to this new processto be executed there instead.

The framework is unaware that this isbeing done.References• Proxy [Gamma et al., 1994], Buckle (see page 252) and Client–Server(see page 182) are normally used when implementing this pattern.• Buckle (see page 252) is an alternative way of providing an extensionpoint that is a simpler but less flexible solution to this problem.• Quarantine (see page 260) is an alternative way of providing anextension point which doesn’t require the plug-in to be signed withthe same capabilities as the framework when you require little or nocommunication between the framework and its plug-ins.• Secure Agent (see page 240) can be seen as the inverse of this patternin that we are separating out the less trusted components into theirown processes.• See Chapter 3 for patterns describing how you can improve executionperformance or RAM usage by changing when you load and unloadplug-ins.• Information on using Message Queues can be found in the SymbianDeveloper Library under Symbian OS guide Base Using UserLibrary (E32) Message Queue Using Message Queue.• See the following document for more information on resource files:Symbian Developer Library Symbian OS guide System Libraries Using BAFL Resource Files.8Optimizing Execution TimeThis chapter is all about making the device appear faster to the enduser.

This is a separate idea from optimizing your component as thatcan also include reducing resource usage or drawing less power. Thischapter is based on the recognition that it is pretty much impossible tocreate an optimal system in which every concern you might have hasbeen addressed and its negative aspects minimized. You have to maketrade-offs to optimize those attributes of your component that are mostimportant. The patterns described in this chapter make the assumptionthat optimizing execution time is your top priority. Of course you will stillbe bound by factors such as limitations on the resources you use but theyare assumed to be of secondary importance. So for instance, you mightchoose to introduce a cache1 so that a frequently executed task can bedone more quickly at the cost of increased RAM usage.Another characteristic of optimizations is that they often only workin particular situations such as for a specific CPU architecture, a particular usage pattern or where there is high bandwidth available.

Thiscan make them fragile as, if the situation changes, the approach takenmay not be the best choice, and in fact might make the task slower!Optimizations also introduce complexity as they tend to rely on specialcases and therefore are likely to increase your maintenance costs. Hencea general recommendation is that you should resist the urge to optimizea component until you can prove that it is worth the effort to develop andthe impacts it will have on your component.

Indeed Donald Knuth said‘‘We should forget about small efficiencies, say about 97% of the time:premature optimization is the root of all evil.’’ [Knuth, 1974].However, if you have measured your execution time and found it tobe wanting, one way to optimize it is to simply do less work by gettingrid of any wasted CPU cycles or by cutting back on some part of youractivity. As an example of the latter, you might optimize the time taken todisplay an email inbox containing thousands of messages by only reading1 en.wikipedia.org/wiki/Cache .288OPTIMIZING EXECUTION TIMEfrom disk the messages that need to be shown in the view rather than allof them. There are a number of profiling tools that help you identify thiskind of waste.Once you’ve eliminated the more obvious waste, you need to startlooking at other approaches.

One tactic you might find useful is to ‘fake’a decrease in execution time by simply re-arranging how you execute atask so that only those things that are essential to providing what the clientor end user wants are done up front and then everything else is done as abackground task. For instance, when an entry is deleted from a database,you don’t need to compact it and clean up immediately so you couldchoose to mark the database field as empty and schedule a backgroundactivity to do the compaction after the client thinks his request has beencompleted. It’s this latter strategy that Episodes (see page 289) focuseson by describing how a task can be cut up into episodes so that thecritical ones required by the client are done first and their task reportedas completed before all the non-critical tasks are performed.The other pattern in this chapter, Data Press (see page 309), looks atthe domain of middleware components that act as conduits for streams ofdata.

Характеристики

Тип файла
PDF-файл
Размер
2,96 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6353
Авторов
на СтудИзбе
311
Средний доход
с одного платного файла
Обучение Подробнее