- •Unit 1. Computer Programming
- •Fortran
- •End user
- •Unit 2. Program Design
- •Steps in Computer Program Development
- •Evolutionary development concurrent activities
- •0A programmers
- •Unit 3. Programming Languages
- •Programming languages
- •Unit 4. Comparing Programming Languages
- •Comparing Programming Languages Technical factors
- •Political factors
- •Language vs Compiler for the Language
- •Tool Support and Documentation
- •Criteria for Comparing Programming Languages
- •Write in c
- •Unit 5. Structured Programming
- •Structured Programming
- •Algorithm Development and Pseudocode
- •Unit 6. Object Oriented Programming
- •Vocabulary
Unit 6. Object Oriented Programming
Warm-up
Task 1. Answer the following questions:
What is object oriented programming?
What are the basic features of object oriented programming?
What are object oriented languages? Give any examples.
What are they used for?
Reading
Task 2. Now read the text and decide on a suitable title for it.
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.
The object oriented programming paradigm entails the development of active program units called objects, each of which contains procedures describing how that object should respond to various stimuli. These internal procedures are called methods (or member functions in the C++ vernacular). The object oriented approach to a problem is to identify the objects involved and describe them and their associated methods as self-contained units. In turn, object oriented programming languages provide statements for expressing these ideas.
To simplify the description of objects with similar yet different characteristics, most object oriented languages allow one class to encompass the properties of another through a system as inheritance.
The existence of a variety of objects with similar yet different characteristics leads to a phenomenon reminiscent of overloading, which is the use of a single symbol, such as +, for representing different operations depending on the type of its operands. Suppose that an object oriented graphics package consists of a variety of objects, each representing a shape (circle, rectangle, triangle, etc.). A particular image consists of a collection of these objects. Each object knows its size, location, and colour as well as how to respond to messages telling it, for example, to move to a new location or to draw itself on the monitor screen. To draw an image, we merely send a ‘draw yourself’ message to each object in the image. However, the routine used to draw an object varies according to the shape of the object – drawing a squire is not the same process as drawing a circle. This customized interpretation of a message is known as polymorphism; the message is said to be polymorphic.
Another characteristic associated with object oriented programming is encapsulation, which refers to restricting access to an object’s internal properties. To say that certain features of an object are encapsulated means that only the object itself is able to access them. Features that are encapsulated are said to be private. Features that are accessible from outside the object are said to be public.
Vocabulary
to handle – to deal with or control
diverse – very different from each other and of various kinds
paradigm – a type of smth, a model
to entail – to involve sth that cannot be avoided
vernacular – the language spoken in a particular area or by a particular group, especially one that is not the official or written language
to encompass – to include a large number or range of things
reminiscent – reminding you of sb/sth
to customize – to make or change sth to suit the needs of the owner
Task 3. When you read the text to decide on a suitable title, which of the following did you do?
Did you:
read the text slowly and try to understand every word?
read quickly and try to understand the main theme?
underline or mark sentences that you thought were important?
make notes about important points?
Which of these reading strategies do you think is most appropriate for this kind of task? Which do you think is least appropriate?
Task 4. Look back at the text and find the answers to these questions:
What advantages of using object-oriented programming are mentioned in the text?
What are the three key features of OOP?
What are called ‘methods’?
What approach is adopted in OOP?
What is ‘overloading’?
What information does each object contain?
What do you need to draw an image?
Is there a difference between drawing a squire and a circle?
What feature refers to restricting access to an object’s internal properties?
What features are said to be encapsulated?
Task 5. Match the terms with the correct definition or explanation:
|
|
Language work
The Infinitive of Purpose
|
|
The Infinitive of purpose is often used in technical descriptions: We use to… to say why somebody does something (= the purpose of action): e.g. Programming is the craft of implementing one or more interrelated abstract algorithms using a particular programming language to produce a concrete computer program. We use to… to say why something exists or why somebody has/wants/needs something: |
e.g. A better approach is to accept the idea that programming languages, or processes can not “Be Object Oriented.” We use to… to say what can be done or must be done with something: e.g. In program planning, the logic to be used to solve the problem is developed. Also: money/time/opportunity/energy/courage etc. to (do something): e.g. A window manager gave the user an opportunity to do any operations with windows. |
Task 6. Look through the text again and find examples of the infinitive of purpose.
Task 7. Complete these sentences. Choose from the box.
to define the layout of a document to show the logical steps (2) to be used in many different programs to solve business problems to develop programs in conversational mode |
to keep in mind to accomplish tasks to obtain correct results to create files to write systems software |
Algorithms are sets of rules or instructions used ……
Extensible markup language is used …… that are program-independent, platform-independent and able to be used with different languages.
Flowchart is a kind of diagram used by programmers …… in a program or by systems analysts …… in the design of a system.
Several programming languages, particularly COBOL, PL/I, and RPG, are commonly used ……
Debugging is the process of correcting computer programs ……
It is important …… 3 principles when dealing specifically with programming, and programming languages.
Libraries are often supplied by the operating system or software development environment developer ……
Page-description language uses tags ……
BASIC is a general purpose high-level programming language, originally designed ……
C was originally designed …… but is now considered a general-purpose language.
Task 8. Complete these sentences using a suitable verb.
Bill Gates has a team of bodyguards ………. him.
I did not have enough time ………. the program today.
I came home by taxi. I did not have the energy ………. .
Would you like something ……….? Yes, please. A cup of coffee.
We need a box ………. these devices in.
There will be a meeting next week ………. the problem.
I wish we had enough money ………. the computer.
I saw him at the meeting but we did not have a chance ………. to each other.
They have just passed their exam in computer science. They are having a party ………. .
I cannot do all this work alone. I need somebody ………. me.
Do you have much opportunity ………. your English?
We need more time ………. a decision.
You need a lot of experience ………. this job.
A class is a template used ……… multiple objects with similar features.
Translation
Task 9. Translate the following text into English. You may use the dictionary if it is necessary.
В середине 80-х годов в программировании возникло новое направление, основанное на понятии объекта.
Реальные объекты окружающего мира обладают тремя базовыми характеристиками: они имеют набор свойств, способны разными методами изменять эти свойства и реагировать на события, возникающие как в окружающем мире, так и внутри самого объекта. Именно в таком виде в языках программирования и реализовано понятие объекта, как совокупности свойств (структур данных, характерных для этого объекта), методов их обработки (подпрограмм изменения свойств) и событий, на которые данный объект может реагировать и которые приводят, как правило, к изменению свойств объекта.
Объекты могут иметь идентичную структуру и отличаться только значениями свойств. В таких случаях в программе создается новый тип, основанный на единой структуре объекта. Он называется классом, а каждый конкретный объект, имеющий структуру этого класса, называется экземпляром класса.
Важнейшая характеристика класса – возможность создания на его основе новых классов с наследованием всех его свойств и методов и добавлением собственных. Класс, не имеющий предшественника, называется базовым.
Listening
Task 10. You are going to hear a lecture about Java, an object-oriented programming language. As you listen, choose the correct answer for each question.
What is not mentioned about Java in the recording?
architecture neural
robust
meta-markup
high-performance
As a programmer you should
give attention to data and methods
take procedures into accounts
adjust to the new paradigm
Most things in Java are
objects
the primitive numeric types
character types
Boolean types
If you are a C++ programmer, you’ll have
no difficulties with Java as the syntax is similar to C++
difficulties with Java as the behaviour is not analogous
to study the object-oriented constructs in Java thoroughly
Java is an interpreted language because its compiler generates
native machine code
byte-codes
malicious code
Java is a secure language because
users cannot download code from a random site on the Internet
users cannot run untrusted programs
it provides several layers of security control
Java is a robust language because
any untrusted code cannot be loaded
any direct access to memory is not allowed
corrupted byte-codes cannot take advantage of implementation weakness in a Java interpreter
Task 11. Read the extract from the tapescript and fill in each gap with an appropriate word.
In an object-oriented system, a class is a 1) __________ of data and methods that operate on that data. Taken together, the data and methods describe the state and 2) __________ of an object. Classes are arranged in a 3) __________, so that a subclass can 4) __________ behavior from its superclass. A class hierarchy always has a 5) __________ class; this is a class with very 6) __________ behavior.
Java comes with an 7) __________ set of classes, arranged in 8) __________, that you can use in your programs. For example, Java 9) __________ classes that create graphical user interface 10) __________ (the java.awt package), classes that 11) __________ input and output (the java.io package), and classes that support networking 12) __________ (the java.net package). The Object class (in the java.lang package) serves as the root of the Java class hierarchy.
Now listen again and compare your answers.
Speaking
Task 12. Work in pairs and discuss the following questions:
If you were a developer of software:
What kind of software package would you develop? Why?
educational software
musical software
multimedia application
an integrated package
a game
What programming language would you choose? Justify your choice.