You are on page 1of 13

MIS326

INTRODUCTION

Spring 910 1

MIS326 Basic Concepts of Object Orientation

 Object
 Abstraction
 Class
 Attribute
 Operation
 Generalization
 Polymorphism
 Component
 ....
Spring 910 2
MIS326 What is an Object ?
 In the real world:
– any person or thing that you
interact with in any way
 In the computer world:
– Abstraction of the real world
object (thing)
• a representation of a specific
entity in the real world
• may be tangible (physical entity)
or intangible

Spring 910 3

MIS326 Abstraction
 Mental process of selecting some object characteristics
and properties to model and excluding others that are
not relevant
– abstraction is always for some purpose
– many different abstractions of the same thing are
possible
– all abstractions are incomplete descriptions of reality
 We do not need completeness, just adequacy!

Spring 910 4
MIS326 Abstraction

Spring 910 5

MIS326 Question ?
If you had to draw a map of ISTANBUL to explain to
someone how to get to HISARKAMPUS BUILDING
from Airport, what is the one most important thing
you would include?
1) roads.
2) land topology (e.g., contours showing elevation
above sea level.
3) historical sites to see (e.g., Topkapı Palace).
4) the types and places of vegetation (i.e., trees and
other types of plants).
5) location of hospitals.
6) bus routes.

Spring 910 6
MIS326 Question ?
If you had to draw a map of the area İSTANBUL to
explain to someone how high the HİSARKAMPUS
Building is above sea level, what is the one most
important thing you would include?
1) roads.
2) land topology (e.g., contours showing elevation
above sea level.
3) historical sites to see
4) the types and places of vegetation (i.e., trees and
other types of plants).
5) bus routes.

Spring 910 7

MIS326 Object
 An entity with a well-defined boundary and identity that
encapsulates state and behavior
 Identity
 State
 Behaviour

Spring 910 8
MIS326 Object
 Identity
Attribute Value
Attribute

 State

 Behaviour

Operation
Spring 910 9

MIS326 What is Encapsulation?


 The localization of features into
a single black box abstraction
– Hides their implementation
behind a public interface
(from clients)
– Clients depend on interface

Spring 910 10
MIS326 Encapsulation
 Process of packaging attributes and operations
– self-contained modules
 Information Hiding
– Object attributes are hidden
from the outside

 Interface
 Implementation

Spring 910 11

MIS326 Interfaces
 An interface is simply a description of the functionality
defined by an object
 The behaviour provided by an object is defined by the
object’s interface
 An interface typically contains a list of available
operations, as well as a description of the data
passed in and out of these operations
– Not data items (Attributes)

Spring 910 12
MIS326 An Example

interface Account
owner, balance

withdraw() Implementation of withdraw()

deposit() Implementation of deposit()

retrieveBalance() Implementation of retrieveBalance()

Spring 910 13

MIS326 An Visual Idea

Interface

Implementation

Data

Spring 910 14
MIS326 Messages
Objects communicate by responding to stimuli that invoke
their operations : Message passing
Objects perform operations in response to messages.

Spring 910 15

MIS326 Messages
 Messages are how objects interact
 Messages typically involve an object making an
invocation of another object’s operation
 Messages contain the following information:
– A handle (or reference) of the object whose
operation is to be called
– The name of the operation
– A number of arguments to be passed to/from the
operation
• This could include input parameters, output parameters, or
parameters that are used for input and output

Spring 910 16
MIS326 Many Objects

Spring 910 17

MIS326 Object Oriented Software


Attributes

Methods
Attributes

Methods Attributes

Methods

Attributes

Methods
Spring 910 18
MIS326 Class
 A Class is an Object Template, or
an Object Factory
 Generalized description that
describes a collection of similar
objects
 share the same operations,
attributes.
 Instantiation
 ability to create multiple
objects ( instances ) of a
class

Spring 910 19

MIS326
Generalization
 a relationship between a class and one or more refined
versions

generalization
Vehicle
superclass subclass

vehicle-type

Van Car Truck

superclass discriminator
car-size

Compact Midsize Fullsize

subclass
specialization

Spring 910 20
MIS326 Generalization — Inheritance
Account
Subclass may AccountNumber
Amount
– add new properties
Balance()
(attributes, operations)
– override methods Deposit()
Withdraw()
Single
inheritance
Checking Savings
serviceCharge interestRate
withdraw payInterest

Multiple Checking
Savings
inheritance

Spring 910 21

MIS326 What is Polymorphism?


 The ability to hide many different implementations
behind a single interface

Manufactor A
Manufactor A Manufactor C

Spring 910 22
MIS326 What Is A Component?
 A non-trivial, nearly independent, and replaceable part
of a system that fulfills a clear function in the context of
a well-defined architecture

Design Model Implementation Model

<<subsystem>> Component
Component Name Name
Component Component
Interface Interface

Spring 910 23

MIS326 The History of Object Technology


 Major object technology milestones

Simula C ++ The UML

1967 Late 1980s 1996

1972 1991 2005+

Smalltalk Java C#

Spring 910 24
MIS326 Review
 Instance
 Inheritance
 Encapsulation
 Abstraction
 Polymorphism
 Object
 Operation
 Generalization
 Message
 Class
 Subclass

Spring 910 25

You might also like