OBJECT ORIENTED DESIGN PART III Does this never end? zombie[3] - - PowerPoint PPT Presentation

object oriented design part iii
SMART_READER_LITE
LIVE PREVIEW

OBJECT ORIENTED DESIGN PART III Does this never end? zombie[3] - - PowerPoint PPT Presentation

PROBLEM DECOMPOSITION REVISITED (AGAIN AND AGAIN): OBJECT ORIENTED DESIGN PART III Does this never end? zombie[3] zombie[1] zombie[4] zombie[5] zombie[2] zombie[0] Fundamentals of Computer Science I Outline Object Oriented Design


slide-1
SLIDE 1

PROBLEM DECOMPOSITION REVISITED (AGAIN AND AGAIN): OBJECT ORIENTED DESIGN PART III

Fundamentals of Computer Science I

zombie[0] zombie[2] zombie[5] zombie[1] zombie[3] zombie[4]

Does this never end…?

slide-2
SLIDE 2

Outline

2

  • Object Oriented Design

– Simplicity – Abstraction – Encapsulation – Modularity – Abstraction Hierarchy – Strong Data Typing – Concurrency – Object State, Behavior and Identity – Classes vs. Objects – Inheritance

slide-3
SLIDE 3

Good Design: Simplicity

3 From “Object Oriented Design with Applications” by Grady Booch

slide-4
SLIDE 4

Good Design: Abstraction

4

From “Object Oriented Design with Applications” by Grady Booch

slide-5
SLIDE 5

Good Design: Abstraction

5

From “Object Oriented Design with Applications” by Grady Booch

“An abstraction denotes the essential characteristics of an object that distinguish it from all other kinds of

  • bjects and thus provide crisply defined conceptual

boundaries, relative to the perspective of the user.”

slide-6
SLIDE 6

Good Design: Encapsulation

6

From “Object Oriented Design with Applications” by Grady Booch

“Encapsulation is the process of hiding all of the details of an object that do not contribute to its essential characteristics.”

slide-7
SLIDE 7

Good Design: Modularity

7

From “Object Oriented Design with Applications” by Grady Booch

“Modularity … creates a number of well-defined documented boundaries within the program. These boundaries, or interfaces, are invaluable in the comprehension of the program.” “Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules.”

slide-8
SLIDE 8

Good Design: Abstraction Hierarchy

8

From “Object Oriented Design with Applications” by Grady Booch

“Hierarchy is a ranking

  • r ordering of

abstractions.”

slide-9
SLIDE 9

Good Design: Strong Typing

9

From “Object Oriented Design with Applications” by Grady Booch

“Typing is the enforcement of the class of an object, such that objects of different types may not be interchanged, or at the most, they may be interchanged only in very restricted ways.”

slide-10
SLIDE 10

Good Design: Concurrency

10

From “Object Oriented Design with Applications” by Grady Booch

“Concurrency is the property that distinguishes an active object from one that is not active.”

slide-11
SLIDE 11

Good Design: State, Behavior, Identity

11

From “Object Oriented Design with Applications” by Grady Booch

“The state of an object encompasses all of the (usually static) properties of the

  • bject plus the current (usually dynamic) values of those properties.”

“Behavior is how an object acts and reacts, in terms of its state changes and message passing.” “Identity is that property of an object which distinguishes it from all other objects.”

slide-12
SLIDE 12

Good Design: Classes vs. Objects

12

From “Object Oriented Design with Applications” by Grady Booch

“A class is a set of objects that share a common structure and a common behavior.” “A single object is simply an instance of a class.”

slide-13
SLIDE 13

Good Design: Inheritance

13

From “Object Oriented Design with Applications” by Grady Booch

slide-14
SLIDE 14

Measures of Good Design

  • Coupling
  • How tightly modules or classes are tied together
  • We want to minimize this
  • Cohesion
  • How tightly a module or class is tied to itself
  • We want to maximize this
  • Sufficiency
  • Whether a class meets all the needs of its clients
  • Completeness
  • Whether a class contains all that it needs
  • Primitiveness
  • How simple is a module or class

14

slide-15
SLIDE 15

Software Development Life Cycle

15

  • 1. Requirements Analysis (Understanding the

Problem - thoroughly)

  • 2. Design (Working out the Logic)
  • 3. Implementation (Converting it to Code)
  • 4. Test/Debug
  • 5. Maintenance
slide-16
SLIDE 16

Making it more Concrete - OOD

16

  • 1. Requirements Analysis (Understanding the

Problem - thoroughly)

  • 2. Design (Working out the Logic)

1. What are the important objects? 2. For each object, what are:

1. It’s instance variables 2. It’s methods (Define the API)

  • 3. Implementation (Converting it to Code)
  • 4. Test/Debug
  • 5. Maintenance
slide-17
SLIDE 17

What are the Nouns?

  • You have been hired to automate bank operations for a

local credit union. They have told you that their business

  • perates as follows:
  • Customers can open accounts. They can make deposits and

withdrawals and can close accounts also. On some accounts interest needs to be added, and sometimes fees are deducted.

  • All employees can help customers with deposits and withdrawals.

Only some employees are authorized to open and close accounts.

17

slide-18
SLIDE 18

Summary

  • Object Oriented Design
  • Simplicity
  • Abstraction
  • Encapsulation
  • Modularity
  • Abstraction Hierarchy
  • Strong Data Typing
  • Concurrency
  • Object State, Behavior and Identity
  • Classes vs. Objects
  • Inheritance