You are on page 1of 5

GIN222

Applied programming for engineers


Object Oriented Programming
• The study in a previous course shows that a
computer program is made of elementary
statements (assignment, comparison or repeat)
and subprograms (calculating the square root,
data display), known as functions or methods.
• These instructions are generally enough to fit any
problem.
• Using them wisely, it is possible to write
computer programs in a simple but very useful
way.
Object Oriented Programming
• As part of the major software development,
programmers also wish to set their own
guidelines, tailored to the problem they treat.
• For this, the programming languages provide the
ability to create functions specific, different from
predefined functions through the language.
• Programmers also wish to tackle specific type of
objects different from the traditional objects
already defined in the language such as Strings
and Arrays.
• Thus resulting in the need to create proper
classes.
Object Oriented Programming
• Defining a class is to build a structured data
type.
• To define a type, just write a class, which, by
definition, consists of data and methods.
Object Oriented Programming
• The construction of a class is performed according to the following two
principles:
– Definition of data with variable declaration statements and / or objects. These
variables are primitive, as we used to (int, char, etc.) or objects predefined or
not (String, etc.). These data describe the characteristic information of the
object. They are also commonly called field or attributes.
– Construction methods defined by the programmer. These are the methods to
manipulate the data. They are built as simple functions, composed a header
and instructions. These methods are all treatments and behaviors of the
object to be described.

• By defining new types, we determine the specific characteristics of objects


that are desired to be programmed. An object type corresponds to all data
processed by the program, grouped by theme.

You might also like