EEI3262 Unit 1 Session 1
EEI3262 Unit 1 Session 1
SESSION 1
Overview of Object Oriented
Programming
Contents
Introduction, p1
1.1 Programming paradigms, p1
1.2 Object Oriented Paradigm, p2
1.3 Object Oriented Programming (OOP), p2
1.4 A Brief History of Object Oriented Programming, p3
1.5 Integrated Development Environments (IDEs), p4
1.6 Java, p5
1.7 Java Programming Environment, p8
Summary, p11
Learning outcomes, p11
Review questions, p12
Introduction
This session gives you an insight to Object Oriented Programming which is
one of the most powerful programming paradigms used in software
development today. This session will introduce you some popular terms
used in programming. There are many object oriented programming
languages, but in this session a major emphasis is given for Java. Therefore,
the key features of Java, Java Virtual Machine and Just-in-Time (JIT)
compiler will be further discussed in this session. In order to write software
or programs it is required to set up the necessary development platform first.
At the end of this session you will learn to set up your computer to start
write programs in Java. Let’s look at different programming paradigms exist
and the role of Object oriented programming paradigm in detail.
1
Session 1 : Overview of Object Oriented Programming
2
Session 1 : Overview of Object Oriented Programming
Search in the internet and illustrate the timeline of at least ten popular Object Oriented
Programming languages from the first to up to date.
1960 1985
3
Session 1 : Overview of Object Oriented Programming
Underline the object oriented programming languages from the given list.
1. JavaScript 6. C++ 11. Objective – C 16. TypeScript
2. Java 7. C# 12. Rust 17. VBA
3. Python 8. Smalltalk 13. Swift 18. Scala
4. Ruby 9. C 14. R 19. Lua
5. PHP 10. Visual 15. Matlab 20. Perl
Basic.NET
In this section you have learnt how different object oriented programming
languages evolved over a period. Next, we will look at the software tools
that can be used to ease the process of programming.
4
Session 1 : Overview of Object Oriented Programming
Write down an IDE that you can use to develop programs for five (5) selected Object
Oriented Programming languages from what you have already underlined in Activity
1.2.
Search internet to find appropriate IDE for the programming languages and use the
given space to write down your answers.
1.
2.
3.
4.
5.
Now you are familiar with the development platforms that you can use to
write software programs using object oriented programming languages.
Next we will further learn Java.
1.6 Java
Java is a general purpose object oriented high level programming language,
developed by Sun Microsystems. General purpose programming languages
are unlike domain specific programming languages and allow programmers
to write software in wide variety of application domain. Java software
development was initiated in 1991 and released in 1995. Java is a popular
programming language which is used everywhere in software development.
Although we consider Java as an object oriented language, Java is not
considered as a pure object oriented language because of few reasons. These
reasons will be discussed in a later course.
5
Session 1 : Overview of Object Oriented Programming
6
Session 1 : Overview of Object Oriented Programming
When Java was still a new language, it was criticized for being slow. Since
Java bytecode was executed by an interpreter; it seemed that Java bytecode
programs could never run as quickly as programs compiled into native
machine language. However, this problem has been largely overcome
using just-in-time (JIT) compilers for executing Java bytecode. JIT compiler
is further elaborated in the next section.
7
Session 1 : Overview of Object Oriented Programming
We will learn how to set up the Java development environment and how to
write a simple Java program in the next section.
compile your own Java programs. The Development Kit includes the
Runtime but also lets you compile programs. You need a JDK to use with
this course.
As explained in Session 1, Java was developed by Sun Microsystems, Inc.,
which is now a part of the Oracle corporation. Oracle makes the JDK for
Windows, Mac OS, and Linux available for free download at its Java Web
site. Many Windows computers come with a Java Runtime already installed,
but you might need to install the JDK. Some versions of Linux come with
the JDK either installed by default or on the installation media. If you need
to download and install the JDK, be sure to get the JDK for Java 7, Java 8,
or later. By the time of writing this course material JDK could be
downloaded from the given link
http://www.oracle.com/technetwork/java/javase/downloads/index.html
If the link does not work by the time you try to download the JDK, you can
use a search engine to find out where the latest version can be downloaded.
If a JDK is properly installed on your computer, you can use the command
line environment to compile and run Java programs. An IDE will also
require a JDK, but it might be included with the IDE downloaded.
9
Session 1 : Overview of Object Oriented Programming
On Windows, after installing the JDK, you need to modify the Windows
PATH environment variable to make this work. Let’s see the instructions to
set the Windows PATH environment variable to Java.
You should create a directory (that is, a folder) to hold your Java work. For example,
create a directory named javawork in your home directory. You can do this using your
computer's GUI. Another way to do it is to open a command window, cd to the directory
that you want to contain the new directory and enter the command mkdir javawork.
When you want to work on programming, open a command window and use the cd
command to change into your work directory. You can have more than one working
directory for your Java work; you can organize your files any way you like.
After doing the activity 1.5, check the video given in the URL below to
check whether you have set up the Java Development Environment
correctly. This link is available in the online component of this course.
10
Session 1 : Overview of Object Oriented Programming
Summary
A paradigm shift has happened in programming as in any other discipline.
Object Oriented Paradigm is one of the four main programming paradigms.
Imperative paradigm, functional paradigm and logical paradigm were not
discussed in this session. In object oriented paradigms, software is
considered to be developed by the smallest entity called “objects”. The
approach of developing the software by considering the objects and the
interactions between the objects is referred to as “Object Oriented
Programming”. Many programming languages are being used in different
programming paradigm. Simula is considered as the first object oriented
programming language. Simula consisted of two programming languages,
Simula I and Simula 67. There after many object oriented programming
languages are being developed and used in the industry. C++, C#, Python
and Java are few of the object oriented programming languages. Some of
them such as Java and Python are not fully object oriented. In order to
develop software, it is required to set up the development environment for
the programming language. Installing an Integrated Development
Environment or an IDE is an integral part when setting up the programming
development environment. Eclipse, Netbeans, IntelliJ IDEA and BlueJ are
few of such IDEs that can be used to write programs in Java. Java has some
key features. Having a free and open source implementation, OpenJDK
(Open Java Development Kit) is one key feature. Java allows platform
independence; therefore, the programs written in Java can be run on
multiple platforms with different operating systems. Java Virtual Machine
or JVM facilitates platform independence. When we need to run a written
program on a computer, we must convert it to machine code. Java uses an
interpreter and a compiler for this. Java allows automatic memory
management and this mechanism is referred to as garbage collection.
Because of garbage collection, the programmers should not write pieces of
codes saying from which objects to deallocate the memory.
At the end of this session you learnt to setup the Java Development
Environment, to compile a written program, to run a written program and to
check if Java is installed in your computer or not.
Learning Outcomes
Now you will be able to:
identify the four main programming paradigms
explain Object Oriented paradigm and the evolution of Object
Oriented Programming languages
list Object Oriented Programming languages and their integrated
development platforms
distinguish a compiler and an interpreter
11
Session 1 : Overview of Object Oriented Programming
Review Questions
1) When programming languages were first introduced, they were known
as low level languages. What are low level languages and compare them
with current high level languages. What are their advantages and
disadvantages?
3) Imagine you are a developer in 1960s and you have been ask to
automate an accounting department of an organization. What type of
programming you would select for this purpose? Give example of such
language.
6) Where do language like javascript, VB script, PHP, Python and etc fall
in the spectrum of programming languages.
8) What are the programming languages you can use for AI applications?
9) In your opinion where you think we will be in five years’ time in future
with respect to programming languages?
12