zen & the art of oriented / objects college of alameda copyright © 2006 patrick mcdermott...

6
Zen & The Art of Oriented / Objects College of Alameda Copyright © 2006 Patrick McDermott [email protected] tip of the hat to: el, Eugen, R.F.C. Hull (translator from German), the Art of Archery, rk: Vintage Books (0-375-70509-0), 1953, 1989 der Kunst des Bogenschiessens, 1948) René Magritte (1898-1967) The Prince of Objects Le Prince des objets 1927

Upload: molly-barton

Post on 16-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Zen & The Art of Oriented / Objects College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu With a tip of the hat to: Herrigel, Eugen,

Zen & The Artof Oriented / Objects

College of AlamedaCopyright © 2006 Patrick McDermott

[email protected]

With a tip of the hat to:Herrigel, Eugen, R.F.C. Hull (translator from German),Zen in the Art of Archery,New York: Vintage Books (0-375-70509-0), 1953, 1989(Zen in der Kunst des Bogenschiessens, 1948)

René Magritte (1898-1967)The Prince of ObjectsLe Prince des objets1927

Page 2: Zen & The Art of Oriented / Objects College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu With a tip of the hat to: Herrigel, Eugen,

Data Processing

ProcessData

Tear down this Wall!!!

Name is “Pat”Balance is $110Payment is $50

Take Pat’s Balance;Subtract the Payment;Make that the Balance;

Page 3: Zen & The Art of Oriented / Objects College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu With a tip of the hat to: Herrigel, Eugen,

Classes & Objects

OBJECT: A discrete entity with a well-defined boundary and identity that encapsulates state and behavior; an instanceof a class. Rumbaugh [3 Amigos], Reference, p. 360.

CLASS: The descriptor for a set of objectsthat share the same attributes, operations, methods, relationships and behavior. A classrepresents a concept within the system being Modeled. Rumbaugh [3 Amigos], Reference, p. 185.

Separate the Essence from the Instance.

Page 4: Zen & The Art of Oriented / Objects College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu With a tip of the hat to: Herrigel, Eugen,

Class

A class is a category of Things. An object is one of those things. A instantiation of a class.

EncapsulationInheritance $$

PolymorphismNameAddressTelephoneCreditRating Taxonomy is a taxing task:

Is a Grad student an employee? Is Pluto a Planet? Is Bill Gates human?

Page 5: Zen & The Art of Oriented / Objects College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu With a tip of the hat to: Herrigel, Eugen,

“Class” is perhapsBest defined by Examples…

• Tangible• Intangible• Conceptual

– Cost Center, Account

• People• Places• Things• Events• Roles• Organizations

• Collections of Objects

• Interface– Form or Dialog

• Infrastructure– Date, Money,

Address• Persistence:

Database• Control• Reference Lists• Other Systems• Process

– Currency Format?

Page 6: Zen & The Art of Oriented / Objects College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu With a tip of the hat to: Herrigel, Eugen,

They’re Everywhere!There must be a Class if

… there’s a form… there’s a file… there’s a number… there are multiple copies… It’s Important• NOTE--

– Sections and boxes on Forms– The name might not be obvious

Responsibilities• Obligation or Contract• Personification Helps

Know Things– Invoice: Know the Customer

Do Things– Invoice: Compute Total

Get Organized– Abstraction