Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
lesson_1-20_9_3.doc
Скачиваний:
55
Добавлен:
07.02.2015
Размер:
2.23 Mб
Скачать

Lesson 11

Text A. What is Object-Oriented Software?

Text B. Object-Oriented Languages.

Word-building. The re- prefix.

Word-building (5)

Ex.1 a) Read the following words and pay attention to the prefix re-. Analyze the meaning of this prefix.

  1. retry повторить попытку

  2. retransmit повторно передавать, ретранслировать

  3. rename переименовать, дать новое имя

  4. rewrite перезаписывать

  5. reinstall заново/повторно инсталлировать/устанавливать

b) Choose the right variant, put down the rule into your copybooks:

Префикс имеет значение:

а) возобновления или повторения действия

б) противоположного действия

c) Translate into Russian:

Restart, reuse, replace, reload, reinsert, reconstruct, reassign, reconnect, renew, retest.

Ex.2 Translate into English:

  1. объектно-ориентированное программирование

  2. сообщение

  3. последовательность

  4. скрытие

  5. наследование

  6. подкласс

  7. повторное использование

  8. поведение

  9. переменная

  10. рабочий документ, программа

  11. создавать

  12. выполнять

  13. экземпляр, пример

  14. определять

  15. отвечать, реагировать

Ex.3 Read and translate into Russian:

What is object-oriented software?

Objects

Object-oriented software is all about objects. An object is a "black box" which receives and sends messages. A black box contains code (sequences of computer instructions) and data (information which the instructions operate on).

All communication to the object is done via ([´vaıƏ] – через, по, посредством) messages. Messages define the interface to the object. Everything an object can do is represented by its message interface. Providing access to an object only through its messages, and keeping the details private is called information hiding. An equivalent is encapsulation.

Classes

How are objects defined? An object is defined via its class, which determines everything about an object. Objects are individual instances of a class. In object-oriented programming a class is a definition of the method and variable in a particular kind of object. A method is simply the action that a message carries out. It is the code, which is executed when the message is sent to a particular object. A method can be reused in multiple objects.

Arguments are often provided as part of a message.

Inheritance

If there is already a class which can respond to a group of different messages, what if you wanted to make a new, similar class which adds some more messages? Why have to re-write the entire class?

All you need to do is to create a subclass (or derived ([dı´raıvd] - производный) class, in C++ terminology) of the original class. This new class inherits all the existing messages, and all the behavior of the original class. The original class is called the parent class, or superclass, of the new class.

Inheritance also supports reuse. You don't have to start from scratch when you write a new program. You can simply reuse an existing set of classes that have behaviors similar to what you need in the new program.

Ex.4 Answer the following questions:

  1. What does “a black box” contain?

  2. What is a code?

  3. What is an equivalent to encapsulation?

  4. How are objects defined?

  5. What is executed when the message is sent to a particular object?

  6. How is a subclass in C++ terminology called?

  7. What does the new class inherit?

Ex.5 Translate into English:

  1. Объект получает и отправляет сообщения.

  2. Объект содержит код и данные.

  3. Связь с объектом выполняется через сообщения.

  4. Сообщения определяют интерфейс к объекту.

  5. Новый класс наследует все существующие сообщения.

  6. Метод может быть использован во многих объектах.

  7. Все что вам нужно это создать подкласс из начального (оригинального) класса.

Ex.6 Point out the sentences in the Active and Passive Voices.

Ex.7 Read and memorize the following words:

  1. environment [ın´vaıƏrƏnmƏnt] – окружение, среда, конфигурация

  2. “look and feel” – внешний вид и ощущение

  3. client [´klaıƏnt] – клиент

  4. applet [´æplıt] – небольшая программа, приложение

  5. (to) interact [ˏıntƏr´ækt] – взаимодействовать

  6. possible [´pɔsƏbl]– возможный, вероятный

  7. flexibility [ˏ fleksƏ´bılıtı] – гибкость

  8. binding [´baındıŋ]привязка, связка

  9. efficient [ı´fıʃnt] – эффективный, действительный

  10. pure [pjuƏ] - чистый

Ex.8 Read and translate into Russian:

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]