Find the answers to these questions in the text.




Object Oriented Programming (OOP)

Read the words and expressions and learn them if they are new to you:

Diverse – разнообразные

Reusablecode – многократно используемый код (reusable - многоразовый)

Bundling –объединение; encapsulation – инкапсуляция

Instance – экземпляр (пример, случай)

Tofetch – получить, извлечь (из памяти)

Triangles (right, equilateral, isosceles) – треугольники (прямоугольный, равносторонний, равнобедренный)

Inheritance –наследование; toinherit – наследовать

Employees – работники; Welders – сварщики

Benefitspackage – социальныйпакет

Toeliminate – устранять

To write code from scratch – писатькодснуля

Maintenance - поддержка

Read the text:

One of the principal motivations for using OOP is to handle multimedia applications in which such diverse data types as sound and video can be packaged together into executable modules. Another is writing program code that's more intuitive and reusable; in other words, code that shortens program-development time.

Perhaps the key feature of OOP is encapsulation — bundling data and program instructions into modules called objects. The type of object is called a class. In other words, an object is an instance of a class.

Here's an example of how objects work. An icon on a display screen might be called 'Triangles'. When the user selects the Triangles icon - which is an object composed of the properties of triangles and other data and instructions - a menu might appear on the Screen offering several choices.

The choices may be (1) create a new triangle and (2) fetch a triangle already in storage. The menu, too, is an object, as are the choices on it. Each time a user selects an object, instructions inside the object are executed with whatever properties or data the object holds, to get to the next step.

For instance, when the user wants to Create a triangle, the application might execute a set of instructions that displays several types of triangles — right, equilateral, isosceles, and so on.

Many industry observers feel that the encapsulation feature of OOP is the natural tool for complex applications in which speech and moving images are integrated with text and graphics. With moving images and voice built into the objects themselves, program developers avoid the sticky problem of deciding how each separate type of data is to be integrated and synchronized into a working whole.

A second key feature of OOP is inheritance. This allows OOP developers to define one class of objects, say 'Rectangles', and a specific subclass of this class, say 'Squares' (a rectangle with equal sides). Thus, all properties Of rectangles — 'Has 4 sides' and 'Contains 4 right angles' are the two shown here — are automatically inherited by Squares. Inheritance is a useful property in rapidly processing business data. For instance,consider a business that has a class called 'Employees at the Dearborn Plant' and a specific subclass of this class, 'Welders'. If employees at the Dearborn plant are eligible for a specific benefits package, welders automatically qualify for the package. If a welder named John Smith is later relocated from Dearborn to Birmingham, Alabama, where a different benefits package is available, revision is simple. An icon -representing John Smith — such as John Smith's face — can be selected on the screen and dragged with a mouse to an icon representing the Birmingham plant. He then automatically 'inherits' the Birmingham benefit package.

A third principle behind OOP is polymorphism. This means that different objects can receive the same instructions but deal with them in different ways. For instance, consider again the triangles example. If the user right clicks the mouse on 'Right triangle', a voice clip might explain theof right triangles. However, if the mouse is right clicked on 'Equilateral triangle' the voice instead explains properties of equilateral triangles.

The combination of encapsulation, inheritance and polymorphism leads to code reusability. 'Reusable code' means that new programs can easily be copied and pasted together from old programs. All one has to do is access a library of objects and stitch them into a working whole. This eliminates the need to write code from scratch and then debug it. Code reusability makes both program developmentand program maintenance faster.

Find the answers to these questions in the text.

1 What advantages of using object-oriented programming are mentioned in the text?

2 What are the three key features of OOP?

3 What multimedia data types are referred to in the text?

4 List the different types of triangle mentioned in the text.

5 What feature avoids the problem of deciding how each separate type of data is integrated and synchronized into a working whole?

6 What specific type of rectangle is named in the text?

7 What common properties of a rectangle are mentioned in the text?

8 What features are made quicker by code reusability?

 



Поделиться:




Поиск по сайту

©2015-2024 poisk-ru.ru
Все права принадлежать их авторам. Данный сайт не претендует на авторства, а предоставляет бесплатное использование.
Дата создания страницы: 2022-10-12 Нарушение авторских прав и Нарушение персональных данных


Поиск по сайту: