Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1
Objectives: Introduction to Object Orientation
Understand the basic principles of object orientation
Define the basic concepts and terms of object orientation
Discuss the strengths of object orientation
2
Introduction to Object Orientation Topics
Basic Principles of Object Orientation
Basic Concepts of Object Orientation
3
Basic Principles of Object Orientation
Object Orientation
Encapsulation
Abstraction
Modularity
Hierarchy
4
What is Abstraction?
Salesperson
Customer
Product
5
What is Encapsulation?
Hide implementation from clients
Clients depend on interface
6
What is Modularity?
The breaking up of something complex into manageable
pieces
Order
Entry
Order Processing
System Order
Fulfillment
Billing
7
What is Hierarchy?
Levels of abstraction
Increasing Asset
abstraction
9
Basic Concepts of Object Orientation
Object
Class
Attribute
Operation
Component
Generalization
Polymorphism
10
What is an Object?
Behavior
State
English 101
Unique identity
Intro to OO 180
Geology 110
Algebra 110
Music History 200
11
What is a Class?
An object is defined by a class
English 101
Intro to OO 180
Geology 110
Algebra 110
Music History 200
12
What is an Attribute?
Object
Class
13
What is an Operation?
CourseOffering
Class
addStudent
deleteStudent
getStartTime
Operation getEndTime
14
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
15
What is Generalization?
One class inherits from another
GroundVehicle
owner Person
ancestor weight
licenseNumber 0..* 1
register( )
generalization
16
What is Polymorphism?
The ability to hide many different implementations behind a
single interface
Manufactor A
Manufactor A Manufactor C
17
Strengths of Object Orientation
A single paradigm
Single language used by users, analysts, designers,
implementers
Facilitates architectural and code reuse
Models more closely reflect the real world
More accurately describe corporate data and processes
Decomposed based on natural partitioning
Easier to understand and maintain
Stability
A small change in requirements does not mean massive
changes in the system under development
18
A Simple Sales Order Example
Order
Product
Ship via
19
Class Diagram for the Sales Example
Sale
20
Effect of Requirements Change
Suppose the requirements
for shipping by a truck
change ... Sale
22
Review: Introduction to Object Orientation
What are the four basic principles of object orientation?
Provide a brief description of each.
What is an Object and what is a Class? What is the
difference between them?
What is an Attribute?
What is an Operation?
What is generalization?
What is polymorphism?
Describe the strengths of object orientation.
23
REFERENCES
OOAD Using the UML - Introduction to Object Orientation, v 4.0
Copyright 1994-1998 Rational Software, all rights reserved
24