Professional Documents
Culture Documents
INTRODUCTION
Spring 910 1
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
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
Spring 910 13
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
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
superclass discriminator
car-size
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
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
<<subsystem>> Component
Component Name Name
Component Component
Interface Interface
Spring 910 23
Smalltalk Java C#
Spring 910 24
MIS326 Review
Instance
Inheritance
Encapsulation
Abstraction
Polymorphism
Object
Operation
Generalization
Message
Class
Subclass
Spring 910 25