Вы находитесь на странице: 1из 46

eMacao-- 14

eMacao 14-- 03
03-- 1

Object-Oriented Principles

Robert P. Biuk-
Biuk-Aghai
Department of Computer and Information Science
Faculty of Science and Technology
University of Macau
robertb@umac.mo

eMacao-- 14
eMacao 14-- 03
03-- 2

Overview
Why Object-
Object-Orientation?
The Object Model
OO vs. Procedure-
Procedure -Oriented Approach
Fundamental OO Concepts
Examples
Conclusions

1
eMacao-- 14
eMacao 14-- 03
03-- 3

Why Object-Orientation?

eMacao-- 14
eMacao 14-- 03
03-- 4

Why Object-Orientation?
The software crisis

n Software is of poor quality

n Software is expensive to produce

n Software complexity is continuously increasing

2
eMacao-- 14
eMacao 14-- 03
03-- 5

Why Object-Orientation? (cont


(cont’’d.)

Specific problems:
n 30% of large software projects are cancelled before
completion
n 50% of software projects are over budget by more than
200%
n The majority of completed projects deliver 60% or less of
prescribed functionality
n Many delivered information systems are under-
under - used
because they don’
don’t meet user needs and/or expectations
n Legacy systems are a serious and growing bottleneck to
organizational evolution

Object--orientation: a possible way out of the crisis


Object

eMacao-- 14
eMacao 14-- 03
03-- 6

Key Quality Concerns


Correctness
n “The ability of software products to perform their exact
tasks, as defined by their specifications.”
specifications.” [Mey97]
Robustness
n “The ability of software systems to react appropriately to
abnormal conditions.”
conditions.” [Mey97]
Difficulties:
n Producing bug -free software
n Correcting software bugs
à Common problem: software reliability

3
eMacao-- 14
eMacao 14-- 03
03-- 7

Key Quality Concerns (cont


(cont’’d.)

Reusability
n “The ability of software elements to serve for the
construction of many different applications.”
applications. ” [Mey97]
Extendibility
n “The ease of adapting software products to changes of
specification.”” [Mey97]
specification.
Difficulties:
n Changing software is hard
n Hard to apply software outside its original intended use
à Common problem: software modularity

eMacao-- 14
eMacao 14-- 03
03-- 8

Other Quality Concerns


Compatibility
n The ease of combining software elements with others.
Portability
n The ease of transferring software products to various
hardware and software environments
Ease of use
n The ease with which people of different backgrounds can
learn to use software products
Efficiency
n The ability of a software system to place as few demands
as possible on hardware resources
Timeliness, economy and functionality

4
eMacao-- 14
eMacao 14-- 03
03-- 9

Object -Orientation
A way of thinking about a problem
n Regard the world as consisting of interacting objects
n Aim to understand objects, their properties, operations,
and interactions with other objects

A way of solving problems


n Build systems consisting of representations of objects
n Objects interact with each other

eMacao-- 14
eMacao 14-- 03
03-- 10

Objects Example

Loud-
speaker
Data
Projector

Microphone OHP

PC Chair

5
eMacao-- 14
eMacao 14-- 03
03-- 11

Strengths of Object Orientation


Describing large, complex systems as interacting
objects makes
make s them easier to understand than
otherwise
The behavio
behaviou urs of real world objects tend to be
stable over time
The different kinds of real world objects tend to be
stable (i.e., new kinds appear slowly; old kinds
disappear slowly)
Changes tend to be localized to a few objects

eMacao-- 14
eMacao 14-- 03
03-- 12

Strengths of Object Orientation (cont


(cont’’d)

A single paradigm
n Single language used by users, analysts, designers,
implementers
Facilitates architectural and code reuse
Models more closely reflect the real world
n More accurately describe corporate data and processes
n Decomposed based on natural partitioning
n Easier to understand and maintain
Stability
n A small change in requirements does not mean massive
changes in the system under development

6
eMacao-- 14
eMacao 14-- 03
03-- 13

Strengths of Object Orientation (cont


(cont’’d)

Overall benefits of OO:

Proper use of OO methods enhances key software


quality factors of a system and its constituent
components

eMacao-- 14
eMacao 14-- 03
03-- 14

OOA, OOD, OOP


Application of object-
object-orientation throughout the
software life-
life-cycle:

Evaluation
Analysis
Design
Coding
Testing
Maintenance

7
eMacao-- 14
eMacao 14-- 03
03-- 15

OOA: Object-Oriented Analysis


Definition:
n Object-oriented analysis is a method of analysis that
Object-
examines requirements from the perspective of the
classes and objects found in the vocabulary of the
problem domain. [Boo94]

Supported by OO modeling methods:


n UML
n OMT
n etc.

eMacao-- 14
eMacao 14-- 03
03-- 16

OOD: Object-Oriented Design


Definition:
n Object-oriented design is a method of design
Object-
encompassing the process of object-
object-oriented
decomposition and a notation for depicting both logical
and physical as well as static and dynamic models of the
system under design. [Boo94]

Supported by OO design methods:


n UML
n OMT
n etc.

8
eMacao-- 14
eMacao 14-- 03
03-- 17

OOP: Object-Oriented Programming


Definition:
n Object-oriented programming is a method of
Object-
implementation in which programs are organized as
cooperative collections of objects, each of which
represents an instance of some class, and whose
classes are all members of a hierarchy of classes united
via inheritance relationships.
relationships. [Boo94]
Supported by OO programming languages:
n C++
n Java
n Smalltalk
n Eiffel
n etc.

eMacao-- 14
eMacao 14-- 03
03-- 18

The Object Model

9
eMacao-- 14
eMacao 14-- 03
03-- 19

The Object Model


A “sound engineering foundation”
foundation” [Boo94]
A different way of thinking about software
(i.e. as a set of interacting objects)
Four basic principles:
1. Abstraction
2. Encapsulation Object Orientation
3. Modularity

Encapsulation
Hierarchy
Abstraction
4.

Modularity

Hierarchy
eMacao-- 14
eMacao 14-- 03
03-- 20

Abstraction
Definition:
n An abstraction denotes the essential characteristics of an
object that distinguish it from all other kinds of objects
and thus provide crisply defined conceptual boundaries,
relative to the perspective of the viewer. [Boo94]

Key concepts:
n Concentrating only on essential characteristics
à Allows complexity to be more easily managed
n Abstraction is relative to the perspective of the viewer
à Many different views of the same object are possible

10
eMacao-- 14
eMacao 14-- 03
03-- 21

Different Viewpoints of an Object

Source: Boo94
eMacao-- 14
eMacao 14-- 03
03-- 22

Examples of Abstraction
Employee

Customer

Product

11
eMacao-- 14
eMacao 14-- 03
03-- 23

Encapsulation
Definition:
n Encapsulation is the process of compartmentalizing the
elements of an abstraction that constitute its structure
and behaviour; encapsulation serves to separate the
contractual interface of an abstraction and its
implementation. [Boo94]

Key concepts:
n Packaging structure and behaviour together in one unit
à Makes objects more independent
n Objects exhibit an interface through which others can
interact with it
à Hides complexity from an object’
object’s clients

eMacao-- 14
eMacao 14-- 03
03-- 24

Encapsulation (cont
(cont’’d.)

Encapsulation separates the implementation of an


object’’s behaviour from its public interface
object
It is called “information hiding”
hiding ”, it allows an object’
object’s
behaviour to be used without knowing its
implementation (“ (“black box”
box”)
Offers two kinds of security:
n Protects object’
object’s internal state from being changed by
outside users
n Changes can be done to the behaviour implementation
without affecting other objects

12
eMacao-- 14
eMacao 14-- 03
03-- 25

Encapsulation: Hiding Object Details

Source: Boo94
eMacao-- 14
eMacao 14-- 03
03-- 26

Example of Encapsulation
Hide implementation from clients
n Clients depend only on the interface,
not the implementation

13
eMacao-- 14
eMacao 14-- 03
03-- 27

Modularity
Definition:
n Modularity is the property of a system that has been
decomposed into a set of cohesive and loosely coupled
modules. [Boo94]

Module: a collection of related classes of objects

Key concepts:
n Modules are cohesive (performing a single type of tasks)
à Makes modules more reusable
n Modules are loosely coupled (highly independent)
à Makes modules more robust and maintainable

eMacao-- 14
eMacao 14-- 03
03-- 28

Modularity (cont
(cont’’d.)

Modularity can be defined as the process of


breaking up of a complex system into small, self-
self -
contained pieces that can be managed easily

Packages and subsystems support the definition of


the modularity

14
eMacao-- 14
eMacao 14-- 03
03-- 29

Modularity: Separation into Pieces

Source: Boo94
eMacao-- 14
eMacao 14-- 03
03-- 30

Example of Modularity
The breaking up of something complex into
manageable pieces
Order
Entry

Order Processing
System Order
Fulfillment

Billing

15
eMacao-- 14
eMacao 14-- 03
03-- 31

Hierarchy
Definition:
n Hierarchy is a ranking or ordering of abstractions.
[Boo94]

Types of hierarchies:
n Class
n Aggregation
n Containment
n Inheritance
n Partition
n Specialization

eMacao-- 14
eMacao 14-- 03
03-- 32

Hierarchy of Abstractions

Source: Boo94

16
eMacao-- 14
eMacao 14-- 03
03-- 33

Example of Hierarchy
Levels of abstraction
Increasing Asset
abstraction

BankAccount Security RealEstate

Savings Checking Stock Bond

Decreasing Classes at the same level of the hierarchy


abstraction should be at the same level of abstraction

eMacao-- 14
eMacao 14-- 03
03-- 34

Object-Oriented vs.
Procedure-Oriented
Approach

17
eMacao-- 14
eMacao 14-- 03
03-- 35

What is Procedure-Oriented
Programming?
Emphasis is on doing things (algorithms)
Large programs are divided into smaller programs
(functions)
Most of the functions share global data
Data move openly around the system from function
to function
Functions transform data from one form to another
Employs top
top--down approach in program design

eMacao-- 14
eMacao 14-- 03
03-- 36

Relationship of Data & Functions in


Procedural Programming

Global Data Global Data

Function 1 Function 2 Function 1


Local Data Local Data Local Data

18
eMacao-- 14
eMacao 14-- 03
03-- 37

What is Object Oriented


Programming?
Emphasis is on data rather than procedure
Programs are divided into objects (abstracted into
classes))
classes
Data is encapsulated in the objects
Objects communicate with each other through
functions (called methods
methods))
Follows bottom
bottom--up approach in program design

eMacao-- 14
eMacao 14-- 03
03-- 38

Organization of Data & Functions in


Object -Oriented Programming

Object A Object B

Data Data

Functions Functions
Object C

Data

Functions

19
eMacao-- 14
eMacao 14-- 03
03-- 39

Fundamental OO Concepts

eMacao-- 14
eMacao 14-- 03
03-- 40

Basic Concepts of Object Orientation


Object
Class
Attribute
Operation
State
Behaviour
Identity
Relationships
Polymorphism

20
eMacao-- 14
eMacao 14-- 03
03-- 41

Object
An object represents an entity
Objects can be:
n Physical or conceptual
n Tangible or intangible
Objects are concrete
Examples of objects:
n A building

n An employee

n A form

eMacao-- 14
eMacao 14-- 03
03-- 42

Class
A class represents a type of object
A class is a definition of an object
n It defines object structure and behaviou
behaviour
A class is a template (or “blueprint
blueprint””) for producing
objects of a certain type
Every object is an instance of a class
Examples of classes:
n Building
n Employee
n Form

21
eMacao-- 14
eMacao 14-- 03
03-- 43

Class (cont
(cont’’d.)

Definition:
n A class is a set of objects that share a common structure
and a common behaviour. [Boo94]

A class is an abstraction
abstraction::
n Emphasizes relevant characteristics
n Hides other characteristics

A class is an encapsulation
encapsulation::
n A set of properties (attributes)
n A set of operations

eMacao-- 14
eMacao 14-- 03
03-- 44

Attribute (Property)
An attribute is a named property of a class that
describes the range of values that instances of the
property may hold. [Boo99
Boo99]]

An attribute has a type that defines the type of its


instances
The given set of values of the attributes defines
define s the
state of the object
Only the object itself should be able to change the
value of its attributes

22
eMacao-- 14
eMacao 14-- 03
03-- 45

Example: Attributes
public class Employee {
protected int employeeNo;
protected String surName;
protected String givenName;
protected String jobTitle;
protected int salary;
}
Attributes

eMacao-- 14
eMacao 14-- 03
03-- 46

Operation (Method)
An operation is the implementation of a service that
can be requested from any object of the class to
affect behaviou
behavio ur. [Boo99
Boo99]]

An operation can be:


n Question (does not change the value of the object)
n Command (may change the value of the object)

23
eMacao-- 14
eMacao 14-- 03
03-- 47

Example: Operations

public class Employee {


protected int employeeNo;
protected String surName;
protected String givenName;
protected String jobTitle;
protected int salary;

public void assignWork(Task t) {} Operations


public void doWork() {}
public void submitResult(Result r) {}
}

eMacao-- 14
eMacao 14-- 03
03-- 48

Object Definition
Definition:
n An object has state, behaviour, and identity; the structure
and behaviour are defined in their common class; the
terms instance and object are interchangeable. [Boo94]

Example object:
n The employee Chan Tai Man

24
eMacao-- 14
eMacao 14-- 03
03-- 49

Object State
Definition:
n The state of an object encompasses all of the (usually
static) properties of the object plus the current (usually
dynamic) values of each of these properties. [Boo94]

Properties of an object are fixed (static)

Property values of an object change (dynamic)

eMacao-- 14
eMacao 14-- 03
03-- 50

Example: Object State


Example object state for employee Chan Tai Man:
Man:
n employeeNo: 1234
n surName: "Chan"
n givenName: "Tai Man"
n jobTitle: "Tecnico 1a Classe"
n salary: 400

25
eMacao-- 14
eMacao 14-- 03
03-- 51

Behaviour
Definition:
n Behaviour is how an object acts and reacts, in terms of
its state changes and message passing.
passing. [Boo94]
Example behaviours for
employee Chan Tai Man:
Man:
n Updating value of
property salary
n Assigning work
(invoking method
assignWork()
in the corresponding
object)

eMacao-- 14
eMacao 14-- 03
03-- 52

Example: Behaviour
Example of behaviour: object state change;
salary of employee Chan Tai Man is increased

change of property value

An action that updates any of the object’s property values


causes a change of the object’s state

26
eMacao-- 14
eMacao 14-- 03
03-- 53

Identity
Definition:
n Identity is that property of an object which distinguishes
it from all other objects. [Boo94]
Distinct objects remain distinct even when all their
property values are identical
Every object has a unique object identifier
Example: two Chan Tai Mans
Mans (in Macau, Portugal)
oid = 1 oid = 2

eMacao-- 14
eMacao 14-- 03
03-- 54

Modeling Classes
Modeling more classes of the domain:

27
eMacao-- 14
eMacao 14-- 03
03-- 55

Class Relationships
Modeled classes can be related in multiple ways:
n Association
n Inheritance
n Aggregation
n Using
n Instantiation
n Metaclass

The most important and common types of


relationships:
n Association, inheritance

eMacao-- 14
eMacao 14-- 03
03-- 56

Association
Association:
n A relationship denoting a semantic connection between
two classes. [Boo94]
Associations may have different cardinality
(multiplicity)
n One-to
One- to--one
one:: one instance of the first class associated
with one instance of the second class
n One--to
One to--many
many:: one instance of the first class associated
with many instances of the second class
n Many--to
Many to-- many: many instances of the first class
associated with many instances of the second class
Associations are usually bidirectional (association
applies both ways)

28
eMacao-- 14
eMacao 14-- 03
03-- 57

Association Example
Example associations:
n Employee is head of agency / agency is headed by
employee (1:1)
n Employee works for agency / agency provides work for
employee (1:N)

eMacao-- 14
eMacao 14-- 03
03-- 58

Association Example 2
Self--association:
Self
n Agency is associated to agency (parent agency)
(0…… 1 : 0…
(0 0 … N)

Gabinete

Direcçção
Direc

Departamento

Divisão

Secçção
Sec

29
eMacao-- 14
eMacao 14-- 03
03-- 59

Inheritance
Inheritance:
n A relationship among classes, wherein one class shares
the structure or behaviour defined in one or more other
classes. [Boo94]
A subclass inherits attributes and operations from
its superclass
Inheritance represents the is
is--a relationship:
n The subclass is a specialization of the superclass
n The superclass is a generalization of the subclass
Inheritance is a key concept of object-
object-orientation
Class modeling seeks to identify inheritance
relationships between classes

eMacao-- 14
eMacao 14-- 03
03-- 60

Inheritance Example
Multiple classes with common attributes:
n surName
n givenName
à identify a common superclass

30
eMacao-- 14
eMacao 14-- 03
03-- 61

Inheritance Example (cont


(cont’’d.)

Added common superclass Person


Attributes surName, givenName moved to Person
Person,,
inherited by its subclasses

Attributes of
Employee:
• employeeNo
• jobTitle
• salary
• agency
+ inherited:
• surName
• givenName

eMacao-- 14
eMacao 14-- 03
03-- 62

Inheritance Example (cont


(cont’’d.)
public abstract class Person {
protected String surName;
protected String givenName;
}

public class Employee extends Person {


protected int employeeNo;
protected String jobTitle;
protected int salary;
protected Agency agency;
}

31
eMacao-- 14
eMacao 14-- 03
03-- 63

Abstract / Concrete Classes


A class may be abstract or concrete
Definitions of abstract class:
class:
n A class that cannot be directly instantiated. [BRJ99]
n An abstract class is written with the expectation that its
concrete subclasses will add to its structure and
behaviour. [Boo94]
Definitions of concrete class:
class:
n A class that can be directly instantiated. [BRJ99]
n A class whose implementation is complete and thus may
have instances. [Boo94]

eMacao-- 14
eMacao 14-- 03
03-- 64

Abstract / Concrete Classes Example


Abstract class: Person
n No objects of this class can be created
Concrete classes: Employee
Employee,, Citizen
Citizen,, Visitor
n Possible to create objects of these classes

32
eMacao-- 14
eMacao 14-- 03
03-- 65

Abstract / Concrete Classes Inheritance


Concrete classes Example .

Objects
Abstract class

eMacao-- 14
eMacao 14-- 03
03-- 66

Polymorphism
Polymorphism is the ability to hide many
implementations behind the same interface

Interface is the outside view of a class, consisting


of its public attributes and operations.

Example:
n All employees can apply for leave
n The process of leave application is implemented
differently for different kinds of employees (e.g. agency
heads vs. ordinary employees)

33
eMacao-- 14
eMacao 14-- 03
03-- 67

Interfaces
Definition:
n An interface is a collection of operations that are used to
specify a service of a class or a component.
component. [B RJ9
RJ999]

An interface is a contract of related services and a


set of conditions that must be true for the contract
to be faithfully executed

Interfaces formalize polymorphism, they allow us to


define polymorphism in a declarative way unrelated
to implementation

eMacao-- 14
eMacao 14-- 03
03-- 68

Examples

34
eMacao-- 14
eMacao 14-- 03
03-- 69

Example 1: Objects
Geometric shapes:
n Many different shapes, but some commonalities (area,
circumference, width, height, centre, etc.)

eMacao-- 14
eMacao 14-- 03
03-- 70

Example 1: Classes
Define different classes for different kinds of objects

Ellipse
Triangle Pentagon Hexagon Octagon

Parallelogram Trapezoid Rectangle Square


Circle

35
eMacao-- 14
eMacao 14-- 03
03-- 71

Example 1: Class Hierarchy


Organize different classes as a hierarchy
Shape

Polygon Ellipse

Triangle Quadrilateral Pentagon Hexagon Octagon Circle

Parallelogram Trapezoid

Rectangle

Square

eMacao-- 14
eMacao 14-- 03
03-- 72

Example 1: Class
Hierarchy (cont
(cont’’d.)
Put common attributes
and operations in
superclasses

Put specializations of
attributes and
operations in
subclasses
n Subclasses inherit from
superclasses

36
eMacao-- 14
eMacao 14-- 03
03-- 73

Example 1: Polymorphism
Different implementations of getArea() method:
n Circle (radius r ): p ×r 2
n Rectangle (vertexes a, b, c , d): a ×b
n Square (vertexes a , b, c, d): a2

Different implementations of getCircumference()


method:
n Circle (radius r ): 2 ×p ×r
n Rectangle (vertexes a, b, c , d): 2 ×( a + b )
n Square (vertexes a , b, c, d): 4 ×a

eMacao-- 14
eMacao 14-- 03
03-- 74

Example 1: Abstract Class Shape


public abstract class Shape
{
public abstract double getArea();
public abstract double getCircumference();
}

37
eMacao-- 14
eMacao 14-- 03
03-- 75

Example 1: Class Circle


public class Circle extends Shape
{
protected double radius;

public Circle(double radius)


{ this.radius = radius; }

public double getArea()


{ return radius * radius * Math.PI; }

public double getCircumference()


{ return radius * 2 * Math.PI; }
}

eMacao-- 14
eMacao 14-- 03
03-- 76

Example 1: Class Rectangle


public class Rectangle extends Shape
{
protected double width;
protected double height;

public Rectangle(double width, double height)


{ this.width = width; this.height = height; }

public double getArea()


{ return width * height; }

public double getCircumference()


{ return 2 * (width + height); }
}

38
eMacao-- 14
eMacao 14-- 03
03-- 77

Example 1: Class Square


public class Square extends Rectangle
{
protected double width;
protected double height;

public Square(double vertex)


{ super(vertex, vertex); }

public double getArea()


{ return width * height; }

public double getCircumference()


{ return 4 * width; }
}

eMacao-- 14
eMacao 14-- 03
03-- 78

Example 1: Discussion
Design maximizes use of inheritance & polymorphism
Properties / operations are placed in classes as
high up in the class hierarchy as possible
Subclasses:
n inherit properties / operations
n override properties / operations
n add new properties / operations
Common interface allows different classes to be
used interchangeably
Different implementations through polymorphism

39
eMacao-- 14
eMacao 14-- 03
03-- 79

Example 2: Objects
A citizen registers a complaint against a
government agency
Objects (highly simplified view):
n Citizen Lei Wai Keong
n Complaint
n Agency DSSD
n Complaint Handler Chan Tai Man

Complaint Complaint

Agency
DSSD

Citizen Complaint Handler


Lei Wai Keong Chan Tai Man

eMacao-- 14
eMacao 14-- 03
03-- 80

Example 2: Classes

40
eMacao-- 14
eMacao 14-- 03
03-- 81

Example 2: Classes (cont


(cont’’d.)

Class Agency
Agency::
n Provide operation postComplaint
postComplaint()
() to citizens
n Queues complaints with the responsible
ComplaintHandler
Class ComplaintHandler
ComplaintHandler::
n Processes complaints
n May forward complaints to other agencies
Class Complaint
Complaint::
n Allows Person to post complaint (citizen, visitor,
employee, etc.)

eMacao-- 14
eMacao 14-- 03
03-- 82

Example 2: Objects

41
eMacao-- 14
eMacao 14-- 03
03-- 83

Example 2: Class Complaint


public class Complaint
{
protected Person complainant;
protected Agency complainee;
protected String subject;
protected String description;
protected DateTime complaintDateTime;
}

eMacao-- 14
eMacao 14-- 03
03-- 84

Example 2: Class Agency


public class Agency
{
protected String name;
protected String address;
protected Employee head;
protected Agency parentAgency;

public void postComplaint(Complaint c) {}


}

42
eMacao-- 14
eMacao 14-- 03
03-- 85

Example 2: Class ComplaintHandler


public class ComplaintHandler extends Employee {
protected Queue q;

public void queueComplaint(Complaint c) {}


public void processNextComplaint() {}
public void forwardComplaint(Agency a) {}
}

eMacao-- 14
eMacao 14-- 03
03-- 86

Example 2: Interaction between Classes

Note: Diagram shows the case when the complaint


needs to be forwarded to another agency

43
eMacao-- 14
eMacao 14-- 03
03-- 87

Example 2: Discussion
Models are generic
n Independent of any particular agency
n Basis for extension to specific requirements

Classes are loosely


loosely--coupled
n Can be reused in other applications
à add other properties / operations

Classes interact through well


well--defined interfaces
n If necessary, classes can modify their implementations
(within the scope of specified interfaces) without affecting
other classes

eMacao-- 14
eMacao 14-- 03
03-- 88

Conclusions

44
eMacao-- 14
eMacao 14-- 03
03-- 89

Virtues of Object-Orientation
Encapsulation & data abstraction
n Easier to modularize code, for better development and
debugging
n Functionality is localized where it is used

Inheritance
n Improves program organization
n Fosters code reuse, sharing of libraries

eMacao-- 14
eMacao 14-- 03
03-- 90

Summary
OO methods regard the world as composed of
interacting entities
n Identify abstractions of entities à classes
n Identify relationships between entities à association,
inheritance, etc.
n Hide details of implementation from clients, allow
different implementations of interfaces à polymorphism

OO methods have the potential to result in higher


quality, more modular & reusable software

45
eMacao-- 14
eMacao 14-- 03
03-- 91

References
[Boo94] Grady Booch
Booch,, Object
Object--Oriented Analysis and Design With
Applications,, Benjamin Cummings, 1994
Applications
[BRJ99] Grady Booch
Booch,, James Rumbaugh
Rumbaugh,, Ivar Jacobson, The Unified
Modeling Language User Guide,
Guide, Addison Wesley, 1999
[Mey97] Bertrand Meyer, Object Construction, 2nd ed.,
Object--Oriented Software Construction,
Prentice Hall, 1997
[MK04] Jim McKim
McKim,, Object Oriented Programming and Design: Object
Oriented Concepts,
Concepts, 2004
[Pap01] Petraq Papajorgji
Papajorgji,, Introduction to Object Oriented Design and
Unified Modeling Language (UML),
(UML), 2001
[RBPEL91] James Rumbaugh
Rumbaugh,, Michael Blaha
Blaha,, William Premerlani
Premerlani,,
Frederick Eddy, William Lorensen
Lorensen,, Object
Object--Oriented Modeling and
Design,, Prentice Hall, 1991
Design
[Sch00] Douglas C. Schmidt,
Schmidt , Object
Object--Oriented Design and Programming,
Programming,
2000

46

Вам также может понравиться