39
How to find objects How to find objects

How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

Embed Size (px)

Citation preview

Page 1: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

How to find objectsHow to find objects

Page 2: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.1. The Importance of This Step. 9.1. The Importance of This Step.

Jacobson’s Three TypesJacobson’s Three Types Entity Objects Entity Objects - things in the users’ real world- things in the users’ real world

ConcreteConcrete objects - Employee, Product, Tool, etc.objects - Employee, Product, Tool, etc.

ConceptualConceptual objects - Corporation, strategy, objects - Corporation, strategy, membership, approval, etc. membership, approval, etc.

Event and State Event and State objects - Purchase, delivery, objects - Purchase, delivery, arrival, ownership, status, etc. arrival, ownership, status, etc.

Interface ObjectsInterface Objects - - To encapsulate the details of To encapsulate the details of GUIs, GUIs, communication protocols, and the like.communication protocols, and the like.

Control ObjectsControl Objects - - To carry complex methods that don’t have a class they To carry complex methods that don’t have a class they obviously belong in.obviously belong in.

Page 3: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

The KRB Seven-Step Method The KRB Seven-Step Method

Step Step Candidate ClassesCandidate Classes Several ways to find Several ways to find nounsnouns that might turn out to be names of that might turn out to be names of

classes that matter to your project.classes that matter to your project.

Step Step Define Classes Define Classes Here we check for the meaning the Here we check for the meaning the usersusers attach to each noun, and attach to each noun, and

decide whether it is important decide whether it is important for this project.for this project.

Step Step Establish Associations Establish Associations Checking how these things interact gives us a picture of the Checking how these things interact gives us a picture of the

pathways that exist throughout the datapathways that exist throughout the data

Step Step Expand Many-to-Many Associations Expand Many-to-Many Associations An essential step that generates much discussion and An essential step that generates much discussion and

more classes.more classes.

Page 4: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method 9.2. The KRB Seven-Step Method OverviewOverviewStep Step Attributes Attributes

We list out all the data fields the users need to keep We list out all the data fields the users need to keep aboutabout each each thingthing (i.e., (i.e., aboutabout each type of entity).each type of entity).

Step Step NormalizationNormalization A technical consideration, with a different relevance in the A technical consideration, with a different relevance in the

object paradigm. This step is done behind closed doors object paradigm. This step is done behind closed doors without the users.without the users.

Step Step Operations (i.e., Behavior)Operations (i.e., Behavior) This is the additional step that distinguishes objects from This is the additional step that distinguishes objects from

entities and earlier models. This part is the subject of entities and earlier models. This part is the subject of Chapters 10 and 11.Chapters 10 and 11.

Page 5: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Candidate ClassesCandidate Classes

Definition:Definition:

Candidate Classes:Candidate Classes:

NounsNouns that are possible class names, that are possible class names, being considered for inclusion in the being considered for inclusion in the

project.project.

Just find all the names!Just find all the names!

Page 6: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

The sources of entity objectsThe sources of entity objects

1. Client Interviews1. Client Interviews2. Nouns from the Documentation2. Nouns from the Documentation3. Brainstorming3. Brainstorming

Page 7: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

The sources of interface objectsThe sources of interface objects

User Interfaces:User Interfaces: Your classes will be defined by your GUI tool.Your classes will be defined by your GUI tool.

Data Communications Interfaces:Data Communications Interfaces: If you buy a communications class library, your classeIf you buy a communications class library, your classe

s are already defined for you.s are already defined for you. The published comm protocol should be filed with or rThe published comm protocol should be filed with or r

eferred from your project documentation.eferred from your project documentation. Real-world systems to control or monitor:Real-world systems to control or monitor:

Industrial Processes, etc.Industrial Processes, etc. Define a single-instance class to represent the externDefine a single-instance class to represent the extern

al system.al system.

Page 8: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

Will mostly be discovered in the Design Phase of the Will mostly be discovered in the Design Phase of the OODLC.OODLC.

As with anything else, if the topic arises earlier during the As with anything else, if the topic arises earlier during the Analysis Phase,Analysis Phase,

Use you judgement;Use you judgement; Either do it now, orEither do it now, or Make serious notes to Make serious notes to ensureensure it gets done later. it gets done later. (Don’t (Don’t

ever miss it!)ever miss it!)

Control classesControl classes

Page 9: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Define ClassesDefine Classes

A Real-World A Real-World IdentifierIdentifier

(“How do I tell one . . . from another?”)(“How do I tell one . . . from another?”)

A A DefinitionDefinition (“What is a . . . ?”) (“What is a . . . ?”)

Sample Sample AttributesAttributes and and BehaviorsBehaviors

(“What might I need to know (“What might I need to know aboutabout a . . .?” a . . .?”

or “What can happen to a . . .?”)or “What can happen to a . . .?”)

Each Candidate Class must undergo three checks:

Page 10: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Define ClassesDefine Classes

Objects have Objects have Identity,Identity, So they are distinct from each other,So they are distinct from each other, And there is usually some way to And there is usually some way to tell them apart.tell them apart. How do we tell one How do we tell one StudentStudent from another? from another?

- Different names - Different names - won’t do, not unique.- won’t do, not unique.

-- Also, names and such are too sensitive to errors Also, names and such are too sensitive to errors Punctuation and casePunctuation and case Spelling and spacing Spelling and spacing

- Different faces - Different faces - scanning technology not yet - scanning technology not yet good enoughgood enough

Question 1: A Real-World IdentifierQuestion 1: A Real-World Identifier

Page 11: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Define ClassesDefine Classes

Student No.Student No. Customer No.Customer No. Account No.Account No. Licence No.Licence No. Serial No.Serial No. Product CodeProduct Code Category CodeCategory Code Vendor IDVendor ID Employee No.Employee No.

Question 1: A Real-World IdentifierQuestion 1: A Real-World Identifier

Some Examples of Identifiers:Some Examples of Identifiers: Building ID Street Name City Name State/Province ID Vehicle ID No. (VIN) Inventory No. Room No. Legal Description (Land) Policy No.

Page 12: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Define ClassesDefine Classes

So we try to find a unique identifier for our So we try to find a unique identifier for our Candidate Class.Candidate Class.

If we can’t, then it’s definitely not a class.If we can’t, then it’s definitely not a class. If we eventually do find one, then we move on If we eventually do find one, then we move on

to the next test,to the next test,

Question 2: The Definition . . .Question 2: The Definition . . .

Question 1: A Real-World IdentifierQuestion 1: A Real-World Identifier

Page 13: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

Employee: A person who works at XYZ Widgets.Employee: A person who works at XYZ Widgets. Sounds reasonable, but do we simply delete the records when (s)he Sounds reasonable, but do we simply delete the records when (s)he

quits? Try this:quits? Try this: Employee: A person who works, or has worked, at XYZ Widgets.Employee: A person who works, or has worked, at XYZ Widgets. Better, and this will work for most businesses.Better, and this will work for most businesses. But you may find a company that wants But you may find a company that wants prospectiveprospective employees to be kept employees to be kept

in the database! Try this:in the database! Try this:

Employee: A person who works, has worked, or may in the Employee: A person who works, has worked, or may in the future work at XYZ Widgets.future work at XYZ Widgets.

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Define ClassesDefine Classes

Question 2: The DefinitionQuestion 2: The Definition

Page 14: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Establish AssociationsEstablish Associations

Here we ask the questions:Here we ask the questions: ““What does a Student What does a Student DODO to a Course?” to a Course?” Enrols in Enrols in it, of course.it, of course. ““What does a Customer What does a Customer DODO to a Product?”to a Product?” A Customer A Customer buysbuys a Product.a Product.

““What does a Teacher What does a Teacher DODO to a Course?”to a Course?” A Teacher A Teacher teachesteaches a Course.a Course.

Page 15: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Establish AssociationsEstablish Associations

Here we ask the questions:Here we ask the questions: ““What does a Student What does a Student DODO to a Course?” to a Course?” Enrols in Enrols in it, of course.it, of course.

““What does a Customer What does a Customer DODO to a Product?”to a Product?” A Customer A Customer buysbuys a Product.a Product.

““What does a Teacher What does a Teacher DODO to a Course?”to a Course?” A Teacher A Teacher teachesteaches a Course.a Course.

Page 16: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Establish AssociationsEstablish Associations

An An associationassociation is an is an interinteractionaction between instances of two between instances of two

classes,classes,

Represented by a Represented by a verb.verb. The ones we want are those that describe The ones we want are those that describe

things that happen in the users’ business.things that happen in the users’ business. We need a sentence that goes We need a sentence that goes

““Object Object verbverb Object” Object” And makes senseAnd makes sense in the users’ world. in the users’ world.

Page 17: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Establish AssociationsEstablish Associations

There are two important parts to this There are two important parts to this sentence:sentence:

The The VerbVerb, , and and

The The MultiplicityMultiplicity..

Page 18: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

The KRB Seven-Step Method. The KRB Seven-Step Method.

Step Step Establish AssociationsEstablish Associations

Draw a line against the list of classes,Draw a line against the list of classes,

each time you check out a possibility.each time you check out a possibility.

This way you check out This way you check out each classeach class

against against every classevery class below itbelow it in the list. in the list.

Customer

Product

Vendor

Invoice

Bin

Warehouse

Page 19: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Take a look at this card-and-string database:

Page 20: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

This will allow us to do sales reports by either:This will allow us to do sales reports by either: Pulling a Customer card, and the strings will Pulling a Customer card, and the strings will

bring all the relevant Product cards,bring all the relevant Product cards, Or vice-versa.Or vice-versa. But there are problems . . .But there are problems . . .

BoJo

MoSlo

Ko

Yo

Coffee

Donuts

DictionaryThesaurus

Notebook

Pencil

Page 21: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

More realistically, we could perhaps write on the cards More realistically, we could perhaps write on the cards instead of using strings:instead of using strings:

As you can easily see As you can easily see on Jo’s card, we are on Jo’s card, we are

likely to run out of likely to run out of

room!room!

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Donuts

DonutsNotebook

CoffeeDonuts DictionaryThesaurus

Pencil

Bo

Slo

Jo

Jo

JoSloKo

Jo

Page 22: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Donuts

DonutsNotebook

CoffeeDonuts DictionaryThesaurus

Pencil

Bo

Slo

Jo

Jo

JoSloKo

Jo

And,And,The data is recorded in The data is recorded in twotwo places, places,

which is not good design,which is not good design,

since it since it willwill get getout of stepout of step

(Murphy’s Law)(Murphy’s Law)

Page 23: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Donuts

DonutsNotebook

CoffeeDonuts DictionaryThesaurus

Pencil

Bo

Slo

Jo

Jo

JoSloKo

Jo

Not only that, Not only that, but where would we write the date, but where would we write the date, quantity and selling price for each sale?quantity and selling price for each sale?

On the strings, On the strings,

perhaps?perhaps?

Page 24: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Bo Pencils

We replace each string with a card and two strings:We replace each string with a card and two strings:

Page 25: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Bo Pencils

We replace each string with a card and two strings:We replace each string with a card and two strings:

Page 26: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

This allows us This allows us to write the details to write the details on the card in the on the card in the

middlemiddleCoffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Bo Pencils

We replace each string with a card and two strings:We replace each string with a card and two strings:

Page 27: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Bo Pencils10 Monday $.49

We replace each string with a card and two strings:We replace each string with a card and two strings:

This allows us This allows us to write the details to write the details on the card in the on the card in the

middlemiddle

Page 28: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Now let’s do Now let’s do

the rest:the rest:

Now let’s do Now let’s do

the rest:the rest:

Bo

Jo

Mo

Slo

Ko

Yo

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Bo Pencils10 Monday $.49

Page 29: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Bo Pencils10 Monday $.49

Ko Donuts12 Tuesday $1.49

Slo Notebook1 Friday $2.00

Slo Donuts4 Tuesday $.49

Page 30: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Bo

Jo

Mo

Slo

Ko

Yo

Bo Pencils10 Monday $.49

Ko Donuts12 Tuesday $1.49

Slo Notebook1 Friday $2.00

Slo Donuts4 Tuesday $.49

Jo Thesaurus4 Thursday $2.49

Jo Dictionary1 Wednesday $1.19

Jo Donuts3 Tuesday $.39

Jo Coffee3 Tuesday $.59

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Page 31: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Expand Many-to-Many Expand Many-to-Many AssociationsAssociations

Customer

*NameAddressPhone No.Balance

Product

*DescriptionUnit PriceQty in Stock

Sale

*Name*DescriptionQty SoldActual Price

Check the strings - the M:M is now 2 x 1:M !!Check the strings - the M:M is now 2 x 1:M !!Check the strings - the M:M is now 2 x 1:M !!Check the strings - the M:M is now 2 x 1:M !!

Bo

Jo

Mo

Slo

Ko

YoBo Pencils

10 Monday $.49Ko Donuts

12 Tuesday $1.49Slo Notebook1 Friday $2.00Slo Donuts4 Tuesday $.49Jo Thesaurus

4 Thursday $2.49Jo Dictionary

1 Wednesday $1.19Jo Donuts3 Tuesday $.39

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Jo Coffee3 Tuesday $.59

isinvolved

in has

** **11 11

Page 32: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step

AttributesAttributes

Page 33: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step

NormalizationNormalization

Page 34: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Normalization Normalization

Let’s start with an example.Let’s start with an example.

Say you need a sales report something like this:Say you need a sales report something like this:

Customer Catalog Unit Qty Actual ExtendedNo. Name Address No. Description Price Date Sold Price Price

131 Jo Blo 13 May St 3A21 T-Shirt 12.49 03/01/98 45 10.00 450.00179 Yo Yo 271 OK Ave 1B77 Sweats 15.00 01/03/98 12 15.00 180.00212 Mu Mu 32 Saddle Rd 4X21 Pants 23.47 12/11/98 5 21.00 105.00 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 35: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Normalization Normalization

is to build a is to build a relational table relational table

that that mimics this report.mimics this report. That is, it has the That is, it has the same columns same columns as this report.as this report. In the object paradigm, the In the object paradigm, the equivalent error equivalent error

would be to create a class with would be to create a class with attributesattributes

that that match the columns match the columns on the report.on the report. But what would we call this class?But what would we call this class? The best name would probably be something like The best name would probably be something like “Sales” “Sales” or or “Sales “Sales

Analysis.”Analysis.”

But . . .But . . .

What the uninitiateduninitiated (read “amateuramateur”) database designer tends to do

Page 36: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Normalization Normalization

We have:We have:

Data that describes a Data that describes a CustomerCustomer (Cust No./Name/Address)(Cust No./Name/Address)

Data that describes a Data that describes a ProductProduct (Cat No/Description/Unit Price)(Cat No/Description/Unit Price)

And data that describes a And data that describes a SaleSale (Date/Quantity/Actual (Date/Quantity/Actual and Extended Prices)and Extended Prices)

Compare this situation with all the earlier models we have looked at,Compare this situation with all the earlier models we have looked at,

You’ll see that You’ll see that CustomerCustomer, , ProductProduct and and SaleSale should each be a should each be a sseparate class . . .eparate class . . .

The problem is that we have three kinds three kinds of data in this report.

Page 37: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Normalization Normalization

Customer

*NameAddressPhone No.Balance

Product

*DescriptionUnit PriceQty in Stock

Sale

*Name*Description*DateQty SoldActual PriceExt. Price

isinvolved

in has

Bo

Jo

Mo

Slo

Ko

YoBo Pencils

10 Monday $.49Ko Donuts

12 Tuesday $1.49Slo Notebook1 Friday $2.00Slo Donuts4 Tuesday $.49Jo Thesaurus

4 Thursday $2.49Jo Dictionary

1 Wednesday $1.19Jo Donuts3 Tuesday $.39

Coffee

Donuts

Dictionary

Thesaurus

Notebook

Pencil

Jo Coffee3 Tuesday $.59

** **11 11

Like this!Like this!

Page 38: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step

Operations Operations (i.e., Behavior) (i.e., Behavior)

Page 39: How to find objects. 9.1. The Importance of This Step. Jacobson’s Three Types Entity Objects - things in the users ’ real world Entity Objects - things

9.2. The KRB Seven-Step Method. 9.2. The KRB Seven-Step Method.

Step Step Operations (i.e., Behavior) Operations (i.e., Behavior)

1. By Inspection1. By Inspection2. Basic 2. Basic CRUDCRUD3. Use Cases3. Use Cases4. Statechart Diagram4. Statechart Diagram5. CRC Cards5. CRC Cards6. 6. CRUDCRUD Revisited Revisited

Six techniques for Six techniques for Finding OperationsFinding Operations