Você está na página 1de 20

Object –Oriented

Programming
Introduction:
Programming Methods
1.Procedural Programming
- uses “procedures” to describe
solutions. (structured prog’g.)
2. Functional Programming
- uses “functions” to describe
solutions. (declarative prog’g.)
Programming Methods
3. Logic Programming
- describe solutions with
“an aggregate of declarations”
- composed of logic expressions
and inference mechanism of the
base – constituting logic system.
4. Object-Oriented Programming
- describe solutions with states
of objects and their behavior.
Object-Oriented Programming
- programming that focuses on
independent objects and their
relationships to other objects, rather
than using a top-down, linear
approach.
Interactions within an Object –
Oriented System

Object Object
2 3

Object Object Object


1 4 5

Objects are describe by its state and behavior (data and


programming logic)
Important Concepts :
1. Abstraction
- identifying essential properties
while simultaneously eliminating
non-essential properties.
ex. a)

Bottom-up Approach
b) Object : Student

School System:
class : student
attributes : idno, name, address,
course, year, etc.
Banking System:
class : depositor
attributes : acctno, name, address,
interest rate, etc.
Important Concepts :

2. Classes, Objects and Attributes


Class – a description of the
common characteristics of several
objects. (attributes and methods)
Objects – anything that models
“things” in the real world. It is an
instance of a class.
Attributes – are information held
by each objects.
Object Name Class Name

Object Example
Important Concepts :
Super Class
– a class at a higher level of
abstraction.
Super Class

Class A Class B Class C


Important Concepts :

3. Encapsulation – calls for


compartmentalizing the objects
or keeping everything together
by hiding the implementation
details of the behavior within a
class.
4. Information Hiding – restricting
access to the state information
or attributes of the object.
Important Concepts :
5. Generalization – relationship
between a general object and a
more specific version of it.
Employee

Name Driver
Dept DL Number
Date Hired Type of Vehicles
Expiry Dates
General
Sub Class
Important Concepts :

6. UML (Unified Modeling Language)


a standard notation for the
modeling of real-world objects when
developing an object-oriented design
methodology.
Types:
a) Functional Model – describes the
functionality of the system (Use
Case Diagram)
Important Concepts :

b) Object Model – describes the


structure of a system in terms of
objects, attributes, associations
and operations (Class Diagram)
c) Dynamic Model – describes the
internal behavior of the system
(Sequence Diagram, State-chart
Diagram, Activity Diagram)
Important Concepts :
7. Association – relationship b/w
two classes.
ex. has an
Customer Account
a)
b) w/ cardiality – involving quantity
1..*
Student Subject

0..*
1..* - one or more
0..* - zero or more
(others: 0..1, 1, n, 0..n, 1..n)
8. Message Passing
9. Polymorphism
10. Inheritance

Você também pode gostar