0% found this document useful (0 votes)
13 views

Lect01_IntroOOP-Part2

Uploaded by

Eiman Hakimy
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Lect01_IntroOOP-Part2

Uploaded by

Eiman Hakimy
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 11

Introduction to Object-oriented

programming and software


development

Lecture 1- Part 2
Based on Slides of Dr. Norazah Yusof
Object Orientation Principle
 Divide-and-conquer
 Encapsulation and Modularity
 Public Interface
 Information Hiding
 Generality
 Extensibility
 Abstraction

2
Principles of Object Orientation
 Divide-and-Conquer Principle
 The first step in designing a program is to divide
the overall program into a number of objects that
will interact with each other to solve the problem.
 Problem solving: Break problems (programs) into
small, manageable tasks.

3
Principles of Object Orientation

 Encapsulation Principle
 The next step in designing a program is to decide
for each object, what attribute it has and what
actions it will take.
 The goal is that each object is a self-contained
module with a clear responsibility and the
attributes and actions necessary to carry out its
role
 Problem solving: Each object knows how to solve
its task and has the information it needs.

4
Principles of Object Orientation
(cont)
 Interface Principle
 For object to work cooperatively and efficiently, we
have to clarify exactly how they are to interact, or
interface, with one another.
 Each object should present a clear public interface
that determines how other objects will be used.

5
Principles of Object Orientation
(cont)
 Information Hiding Principle
 To enable objects to work together cooperatively,
certain details of their individual design and
performance should be hidden from other objects.
 Each object should shield its users from
unnecessary details of how it performs its role.

6
Principles of Object Orientation
(cont)

 Generality Principle
 To make an object as generally useful as possible,
we design them not for a particular task but rather for
a particular kind of task. This principle underlies the
use of software libraries.
 Objects should be designed to be as general as
possible.
 Objects are designed to solve a kind of task rather
than a singular task.

7
Principles of Object Orientation
(cont)

 Extensibility Principle
 One of the strength of the object-oriented approach
is the ability to extend an object’s behavior to handle
new tasks.
 An object should be designed so that their
functionality can be extended to carry out more
specialized tasks.

8
Principles of Object Orientation
(cont)

 Abstraction is the ability to focus on the


important features of an object when trying to
work with large amounts of information.
 The objects we design in Java programs will
be abstractions in this sense because they
ignore many of the attributes that
characterize the real objects and focus only
on those attributes that are essential for
solving a particular problem.

9
Benefits of Object-oriented
programming
 Save development time (and cost) by reusing code
 once an object class is created it can be used
in other applications
 Easier debugging
 classes can be tested independently
 reused objects have already been tested

10
Self-test: Introduction to Object Oriented
Programming
1. What are the seven basic principles of object
orientation? Provide a brief description of
each.
2. State the benefits of object oriented
programming.

11

You might also like