The Symbian OS (779886), страница 73

Файл №779886 The Symbian OS (Symbian Books) 73 страницаThe Symbian OS (779886) страница 732018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

In other words, they define abstract behavior (interfaces) only,not concrete behavior.A typical use of an M class is to define an Observer class, sothat a CCoeControl-derived control (GUI widget) also presents anMObserver-derived interface. Because MObserver is an abstract class(all of its methods are pure virtual), there is no inherited implementation, and therefore no danger of duplicated implementation code (whenyou define an MObserver-derived class, you must provide all methodimplementations yourself).Martin Tasker:The notion of implementing an interface, which incidentally I think is usedvery nicely in some of the printer driver classes for instance, seems verynatural.

So, one pattern for implementing is-a uses mixins; another patternis that you have an attribute and it turns out that the interface paradigm isactually very natural.There is a more general and interesting point about the similaritieswith Java.Martin Tasker:We ended up with a lot of the same things that Java did, and we inventedthem more or less completely independently.

We didn’t really start looking12Mixins were reputedly named for the way of specifying the flavors you wantedat Steve’s Ice Cream shop, near MIT: vanilla plus mixins. The original LispMachineimplementation was indeed called Flavors.350THE USE OF OBJECT-ORIENTED DESIGN IN SYMBIAN OSat Java until somewhat after our major design decisions were committed. Butfunnily enough we ended up using multiple inheritance in the same way, weconstrained C++ multiple inheritance and ended up using it in the same wayas Java uses inheritance interfaces.Before the mixin solution was adopted, some designs suffered fromthe injunction against multiple inheritance and had to find other ways tooffer multiple interfaces, resulting in convoluted design.The lesson is that early adoption involves multiple leaps into theunknown. Leaping into the unknown can harm your design.NamespacesNamespaces are another example of a useful C++ language featurewhich was not used because it was not standardized in early C++implementations.

(At least, namespaces were not used early on in SymbianOS.) More recently, some technology areas (networking is an example)have pioneered the use of namespaces, generating some internal debateabout what the rules for using namespaces should be.For example, in designing the networking components, namespaceshave proved useful as a mechanism for associating Symbian OS implementations of standards-based behavior (in other words, externally specified APIs) with a standard API, without polluting the global namespace,making it easier for licensees to swap out the Symbian implementation infavor of their own alternative implementations and to do so in principlesimply by changing the namespace qualifier.Freedom Through Object OrientationOne of the more intriguing aspects of the way that object orientation wasused inside Psion was to liberate the design process from the need forcentral oversight and scrutiny, below the level of API definition.

While,in some respects, this liberation meant freedom for developers to shootthemselves in the foot with complex features of C++ or just over-use offeatures (such as over-elaborate use of inheritance), in the wider senseof applying object orientation as an enabling technology to unleashtalent to solve a problem while still providing a sufficiently constrainingmechanism, it was hugely successful and partly explains how Psion wasable to create a fully-fledged modern operating system, all the way up tothe application level, in a remarkably short time with a relatively smallnumber of engineers. (In 1997, not long after the first operating systemrelease, Psion Software was still a company with barely 200 employees.)PIONEERING THE OBJECT APPROACH IN PSION351Martin Tasker:Something I think Charles Davies did extremely consistently and well, was hebasically said, ‘Look, you can design an object-oriented system and train allthose programmers that you had to recruit because this fantastic system is justtoo big for your elite team of ten, and you can design the interfaces and givethem a sandbox in which to play inside those interfaces, and they can’t hurtanybody else by just adding another function onto that library over there’,which is what you can do in C, and which is what you are strongly inclinedto do in C.I think Charles, in particular, did this; he paid minute attention to the detailsof his APIs, he used their explanatory power to motivate his people, and healmost didn’t need to look at what they produced in terms of implementationcode or test code.

He basically said, ‘If it meets the requirements of theAPI and if you feel it’s correct then I trust you that it is correct.’ Whereas Ithink that process is harder to do in a non-object-oriented system, becausethe boundaries are much harder to draw, both for the architect and for theimplementer. I think Charles used that to massively good effect. He wasoutstanding in that.David Wood was another exponent and practitioner of the principleof freedom and his approach remains to this day: hire talented people,point them at the problem, provide the minimum constraints necessaryto bound the solution space, and let them get on with it.However, this was not what initially attracted him to the benefits ofobject orientation.

Rather, it was the holy grail of reuse. Inheritance as amechanism for delivering reuse seemed to be a perfect fit for the problemdomain of constrained devices.David Wood:My first interest in object orientation was in the notion of inheritance, whichwas that you could reuse somebody else’s code but still modify it withouthaving to end up with a complete copy of it. So, the same principle of lookingfor small code size which runs through many of our early design decisionsis there, and we saw that we would otherwise have duplications of code,where there would be a system component whose behavior couldn’t be fullyparameterized just by data, so you couldn’t say, ‘well, here are all the flagsthat will completely govern the behavior of specializations of this object.’We saw that yes, you had to have a way of specializing the code as wellas specializing the data.

And that is the idea that really struck home. I knowexactly the book that I read that made that impact, it was a book by BertrandMeyer about Eiffel. So that was a very pragmatic consideration, it wasn’t at allan ideological consideration.352THE USE OF OBJECT-ORIENTED DESIGN IN SYMBIAN OSThe object-oriented design approach also seemed to offer somethingelse that was particularly necessary in GUI design: a systematic designapproach (abstraction hierarchies) capable of bringing elegance and orderto a complex problem domain and empowering designers.

Probably thefirst, large-scale example of a complete object-oriented system (eventhough it was written in C) was the original Carnegie–Mellon design andimplementation of the X-Window system for Unix.13 Abstraction hierarchies (whether called classes or not) lend themselves elegantly to solvingthe GUI design problem, while also being open to full-scale extension.David Wood:I bought into the wider philosophical view which was that if you followed anobject-oriented approach you could handle greater complexity. Because youwill have items in your code that map better to concepts in the real worldthat you’re trying to model, or map better to concepts in the user’s mind.

Soyou’ll have data and code together and you can organize them in hierarchieswhich correspond to how they are arranged in the real world, or correspondto how they are arranged in the users mind. So, going forwards, that was avery important reason to adopt object-oriented principles. It allowed a singleprogrammer to hold more in his head.Again, the efficiencies delivered were not just machine efficiencies(more effective, efficient code) but human (‘sociological’) ones too: moreproductive, effective and empowered developers.David Wood:You always fought against code bloat, and there are two ways to fight it. Thefirst way is to encourage people to practice efficiency in the small, whichwas to understand the side effects of the code they were writing and to thinkabout every line of code they wrote to make sure it wasn’t unnecessarily longand they weren’t duplicating code unnecessarily.

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

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

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

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