108
1 Copyright 8 2002 Flying Kiwi Productions Inc. [email protected] Chapter 4 Data-Oriented Models 4.1. Data Models: The ERD 4.1. Data Models: The ERD 4.2. Paradigm Shift 4.2. Paradigm Shift 4.3. Entity-Relationship Modeling 4.3. Entity-Relationship Modeling 4.4. Object-Oriented Models 4.4. Object-Oriented Models 4.5. An Introduction to Objects 4.5. An Introduction to Objects 4.6. Object-Oriented vs Object-Based 4.6. Object-Oriented vs Object-Based 4.7. Conceptual, Logical & Physical 4.7. Conceptual, Logical & Physical Models Models 4.8. Models as Communication Tools 4.8. Models as Communication Tools

Chapter 4 Data-Oriented Models

Embed Size (px)

DESCRIPTION

Chapter 4 Data-Oriented Models. 4.1. Data Models: The ERD 4.2. Paradigm Shift 4.3. Entity-Relationship Modeling 4.4. Object-Oriented Models 4.5. An Introduction to Objects 4.6. Object-Oriented vs Object-Based 4.7. Conceptual, Logical & Physical Models - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 4 Data-Oriented Models

1Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Chapter 4 Data-Oriented Models 4.1. Data Models: The ERD4.1. Data Models: The ERD 4.2. Paradigm Shift4.2. Paradigm Shift 4.3. Entity-Relationship Modeling4.3. Entity-Relationship Modeling 4.4. Object-Oriented Models4.4. Object-Oriented Models 4.5. An Introduction to Objects4.5. An Introduction to Objects 4.6. Object-Oriented vs Object-Based4.6. Object-Oriented vs Object-Based 4.7. Conceptual, Logical & Physical Models4.7. Conceptual, Logical & Physical Models 4.8. Models as Communication Tools4.8. Models as Communication Tools

Page 2: Chapter 4 Data-Oriented Models

2Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.1. Data Models: The ERD

Research to find ways to model dataResearch to find ways to model data To give template for database designTo give template for database design Many notations were triedMany notations were tried Chen (1976) proposed theChen (1976) proposed the

Entity-Relationship Diagram Entity-Relationship Diagram (ERD)(ERD)

Mid-1970s: Databases were just coming into use

Page 3: Chapter 4 Data-Oriented Models

3Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

DATADATA andand

How it is Linked and How it is Linked and OrganizedOrganized..

It was from this that objects It was from this that objects then evolved.then evolved.

The ERD was the first systems The ERD was the first systems analysis tool to focus onanalysis tool to focus on

Page 4: Chapter 4 Data-Oriented Models

4Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-RelationshipThe Entity-Relationship Principle, Principle, andand

The Entity-RelationshipThe Entity-Relationship Notation.Notation.

These further issues were also investigated These further issues were also investigated by Chen and others:by Chen and others: E-R models for database designE-R models for database design

The The significancesignificance of the data of an enterpriseof the data of an enterprise

Data as aData as a corporate asset.corporate asset. TheThe stabilitystability of the data of an enterpriseof the data of an enterprise

4.1. Data Models: The ERD

Chen made two contributions:

Page 5: Chapter 4 Data-Oriented Models

5Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.2. Paradigm Shift

A A paradigm shift paradigm shift is a major change in the way we think is a major change in the way we think about something.about something.

True paradigm shifts are rare.True paradigm shifts are rare.

(Brooks, 1976)(Brooks, 1976)

Page 6: Chapter 4 Data-Oriented Models

6Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.2. Paradigm Shift

Chemistry:Chemistry: Alchemy Atoms.Alchemy Atoms. Astronomy: Astronomy: “Bible” “Bible” Galileo. Galileo.

““Bible” = Geocentric, as interpreted by InquisitionBible” = Geocentric, as interpreted by Inquisition

Biology:Biology: Creation Darwin.Creation Darwin.

Each of these was a major Each of these was a major change in how we viewed change in how we viewed

our world.our world.

Physics: Newton Einstein.

Page 7: Chapter 4 Data-Oriented Models

7Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.2. Paradigm Shift

aa patternpattern or mode ofor mode of thinking and believingthinking and believing

that serves to organizethat serves to organize

the way we approachthe way we approach

knowledge, learning and understandingknowledge, learning and understanding..

AA paradigm shift paradigm shift occursoccurs

when we adoptwhen we adopt

aa radically different way radically different way of organizingof organizing

all or part of our worldviewall or part of our worldview..

A paradigmparadigm is

Page 8: Chapter 4 Data-Oriented Models

8Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

While Objects are an evolution from While Objects are an evolution from Entities, the change is so dramatic and Entities, the change is so dramatic and far-reaching. . . far-reaching. . .

that it also qualifies as a truethat it also qualifies as a true paradigm paradigm shift.shift.

4.2. Paradigm Shift

Two Paradigm Shift in IT industry:Two Paradigm Shift in IT industry:

1.1. Process-orientedProcess-oriented Data-oriented Data-oriented

2.2. Data-oriented Data-oriented Object-oriented Object-oriented

Page 9: Chapter 4 Data-Oriented Models

9Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.3. Entity-Relationship Modeling

As we saw earlier, Chen made two As we saw earlier, Chen made two main contributions, the main contributions, the

ERD Principle ERD Principle andand

ERD Notation, ERD Notation, as well as as well as investigating several other issues.investigating several other issues.

Page 10: Chapter 4 Data-Oriented Models

10Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The following six points all relate to both E-R and Object The following six points all relate to both E-R and Object modeling. Now let’s examine them in this order:modeling. Now let’s examine them in this order:

The Entity-RelationshipThe Entity-Relationship Principle.Principle.

E-R models for database design.E-R models for database design.

TheThe stabilitystability of data. of data.

TheThe significancesignificance of data.of data.

Data as aData as a corporate asset.corporate asset.Entity-RelationshipEntity-Relationship Notation.Notation.

Page 11: Chapter 4 Data-Oriented Models

11Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

SalesSales Customers Products Sales Sales clerks

To manage aTo manage a sales operation, sales operation, we we need to keep data about :need to keep data about :

Page 12: Chapter 4 Data-Oriented Models

12Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

PhonePhone Customers Numbers Lines Calls Services

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

To run aTo run a phone company, phone company, we would we would need to keep data about:need to keep data about:

Page 13: Chapter 4 Data-Oriented Models

13Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..To run a booking agency booking agency we must

record information about: BookingBookingVenuesVenuesArtistsArtistsAgentsAgentsConcertsConcertsPerformancesPerformancesCustomersCustomersSeatsSeats

Page 14: Chapter 4 Data-Oriented Models

14Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

BookingBookingVenuesArtistsAgentsConcertsPerformance

sCustomersSeats

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..To run a booking agency booking agency we must record information about:

Notice there is noNotice there is no DateDate in this list.in this list.

Why Not?Why Not?

Page 15: Chapter 4 Data-Oriented Models

15Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

A date can describe manyA date can describe many thingsthings The key word here isThe key word here is

ThingsThings

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

AA datedate is data that describes ais data that describes a ConcertConcert

Page 16: Chapter 4 Data-Oriented Models

16Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Each of these lists is aEach of these lists is a list of list of thingsthings

PhonePhoneCustomersCustomersNumbersNumbersLinesLinesCallsCallsServicesServices

BookingBookingVenuesVenuesArtistsArtistsAgentsAgentsConcertsConcertsPerformancesPerformancesCustomersCustomersSeatsSeats

SalesSalesCustomersCustomersProductsProductsSales clerksSales clerks

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 17: Chapter 4 Data-Oriented Models

17Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Earlier methods emphasizedEarlier methods emphasized what the what the users need to know users need to know to do their job.to do their job.

Here we emphasize whatHere we emphasize what thingsthings the the

users need to knowusers need to know aboutabout.. The wordThe word EntityEntity means ameans a thing.thing. LaterLater we worry about what items they we worry about what items they

need to knowneed to know aboutabout each entity.each entity.

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

The E-R principle focuses on the The E-R principle focuses on the things we need to keep datathings we need to keep data aboutabout..

Page 18: Chapter 4 Data-Oriented Models

18Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

You can see it is something we You can see it is something we need to know about (i.e., keep need to know about (i.e., keep data about) to do our jobdata about) to do our job

So we define it. . .So we define it. . .

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Webster: An entity is Webster: An entity is “something “something that has separate that has separate and distinct and distinct existence”existence”

Page 19: Chapter 4 Data-Oriented Models

19Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

A A Data Entity Data Entity isis somesomethingthing that has that has separate and distinct existenceseparate and distinct existence in in the world of the users the world of the users and is of and is of interest to the users in that they interest to the users in that they need to keep dataneed to keep data aboutabout it in order it in order to do their job.to do their job.

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 20: Chapter 4 Data-Oriented Models

20Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

So these are theSo these are the entity lists entity lists for these businesses:for these businesses:

PhonePhoneCustomersCustomersNumbersNumbersLinesLinesCallsCallsServicesServices

BookingBookingVenuesVenuesArtistsArtistsAgentsAgentsConcertsConcertsPerformancesPerformancesCustomersCustomersSeatsSeats

SalesSalesCustomersCustomersProductsProductsSales clerksSales clerks

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 21: Chapter 4 Data-Oriented Models

21Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

What we need to talk about What we need to talk about mostly is the class of all mostly is the class of all Customers, or in other words theCustomers, or in other words the typetype of thing called a Customer.of thing called a Customer.

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Grammatically, the term Entity Grammatically, the term Entity refers to arefers to a single specific single specific

CustomerCustomer or or ProductProduct or or SaleSale or or CallCall or or ArtistArtist..

Page 22: Chapter 4 Data-Oriented Models

22Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

AnAn is a is a class or category class or category

expressing theexpressing the common common properties properties that allow a that allow a

number of entities to be number of entities to be treated similarly.treated similarly.

So we define:So we define:

Entity TypeEntity Type

Page 23: Chapter 4 Data-Oriented Models

23Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Entity types are always singular.Entity types are always singular. So our entity lists look like this:So our entity lists look like this:

All SingularAll Singular

PhonePhoneCustomerNumberLineCallService

BookingBookingVenueArtistAgentConcertPerformanceCustomerSeat

SalesSalesCustomerProductSales clerk

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 24: Chapter 4 Data-Oriented Models

24Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

An individualAn individual CustomerCustomer oror ProductProduct or or SaleSale oror CallCall or or ArtistArtist

is then anis then an OccurrenceOccurrenceof the Entity Type.of the Entity Type.

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 25: Chapter 4 Data-Oriented Models

25Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

I am an occurrence of the entity type I am an occurrence of the entity type “Employee”“Employee”

You are an occurrence of the entity You are an occurrence of the entity type “Student”type “Student”

We each live in an occurrence of the We each live in an occurrence of the entity type “Dwelling”entity type “Dwelling”

The last time you caught an occurrence of The last time you caught an occurrence of the entity type “Bus,” it followed an the entity type “Bus,” it followed an occurrence of the entity type “Route” while occurrence of the entity type “Route” while executing an occurrence of the entity type executing an occurrence of the entity type “Trip.”“Trip.”

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 26: Chapter 4 Data-Oriented Models

26Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

AttributesAttributes are theare the data elements data elements carried by an entity that describe it carried by an entity that describe it and record its state.and record its state.

AttributesAttributes are the things we need are the things we need

to knowto know aboutabout an Entity.an Entity.

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 27: Chapter 4 Data-Oriented Models

27Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

So how did theSo how did the CountryCountry occurrenceoccurrence CanadaCanada happen to happen to get the string valueget the string value “Canada” “Canada”

as the value for itsas the value for its NameName attribute?attribute?

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 28: Chapter 4 Data-Oriented Models

28Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

On the day of Canada’s confederation, the On the day of Canada’s confederation, the Founding Fathers placed 26 slips of paper Founding Fathers placed 26 slips of paper in a hat with the 26 letters of the in a hat with the 26 letters of the alphabet on them. “Just draw 3 letters,” alphabet on them. “Just draw 3 letters,” they said, “We want a short, crisp name they said, “We want a short, crisp name for our beautiful new country.” So the for our beautiful new country.” So the one with the hat did as directed, and one with the hat did as directed, and announced:announced:

““C, C, eheh??””

““N, N, eheh??””

““D, D, eheh??” ”

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 29: Chapter 4 Data-Oriented Models

29Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship Principle.

Associations:

So we have: So we have: Hundreds ofHundreds of CustomersCustomers

Thousands ofThousands of ProductsProducts

Dozens ofDozens of Sales ClerksSales Clerks

Do we have a business?Do we have a business?

NOT YET!NOT YET!

Page 30: Chapter 4 Data-Oriented Models

30Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Not until:Not until: A CustomerA Customer buysbuys a Producta Product

A Sales ClerkA Sales Clerk sellssells a Producta Product

A Sales ClerkA Sales Clerk sellssells to a Customerto a Customer

These are theThese are the interinteractionsactions

that occur between entities.that occur between entities.

Note each involves aNote each involves a verb.verb.

The Entity-Relationship Principle.

Associations:

Page 31: Chapter 4 Data-Oriented Models

31Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

We define:We define:

AnAn AssociationAssociation is the is the interaction of two entities and interaction of two entities and

is represented by a verb.is represented by a verb.

The Entity-Relationship Principle.

Associations:

Page 32: Chapter 4 Data-Oriented Models

32Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The purpose is to provide access The purpose is to provide access paths to the data.paths to the data.

When a sale occurs, we will link:When a sale occurs, we will link:

A CustomerA Customer

To a ProductTo a Product

To a Sales Clerk.To a Sales Clerk. Using aUsing a verbverb to describe each link.to describe each link.

The Entity-Relationship Principle.

Associations :

Page 33: Chapter 4 Data-Oriented Models

33Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Note we have not made any Note we have not made any mention of inputs or outputs,mention of inputs or outputs,

And we have touched on business And we have touched on business processes, but processes, but

only as they concern the data.only as they concern the data.

The Entity-Relationship Principle.

Associations:

Page 34: Chapter 4 Data-Oriented Models

34Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

In this way we are able to diagram In this way we are able to diagram thethe structurestructure of our user’s business of our user’s business

data,data,

independentindependent of any way that the of any way that the data may be used, data may be used,

either now or in the future. either now or in the future.

The Entity-Relationship Principle.

Associations:

Page 35: Chapter 4 Data-Oriented Models

35Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship PrinciplePrincipleSUMMARYSUMMARY

An An EntityEntity is a thing the users need to know (i.e, is a thing the users need to know (i.e, record) something about.record) something about.

AnAn Entity Type Entity Type is a group or class of entities that are is a group or class of entities that are all the same kind of thing.all the same kind of thing.

AnAn OccurrenceOccurrence of an Entity Type is a specific of an Entity Type is a specific individual thing of the kind the Entity Type individual thing of the kind the Entity Type describes.describes.

AttributesAttributes are the things we need to know about an are the things we need to know about an Entity.Entity.

AnAn AssociationAssociation is the interaction of two Entities and is the interaction of two Entities and is represented by a verb.is represented by a verb.

These interactions among the Entities (i.e., these These interactions among the Entities (i.e., these associationsassociations) show us the) show us the pathwayspathways we need to we need to follow through the database to access the data.follow through the database to access the data.

Page 36: Chapter 4 Data-Oriented Models

36Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

E-R models for database design.E-R models for database design.

There is a very significant reason There is a very significant reason why Entities, Attributes and why Entities, Attributes and

Associations are so Associations are so fundamentally important for fundamentally important for

systems development.systems development.

Page 37: Chapter 4 Data-Oriented Models

37Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

To start with, the search for data To start with, the search for data modeling methods was formodeling methods was for databasedatabase design.design.

Many notations were developed Many notations were developed and some actually tried out.and some actually tried out.

Chen’sChen’s ERDERD turned out best and turned out best and took over.took over.

It also caught on as a tool forIt also caught on as a tool for systemssystems analysis, analysis, as well as for as well as for data analysis.data analysis.

E-R models for database design.E-R models for database design.

Page 38: Chapter 4 Data-Oriented Models

38Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

For database design:For database design:

EachEach EntityEntity becomes abecomes a filefile oror tabletable..

EachEach AttributeAttribute becomes abecomes a fieldfield (i.e., a(i.e., a columncolumn))

EachEach AssociationAssociation becomes anbecomes an access pathway access pathway (i.e., a(i.e., a foreign foreign

keykey))

E-R models for database design.E-R models for database design.

Page 39: Chapter 4 Data-Oriented Models

39Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The StabilityStability of Data.

This year, our favorite Transit Company is This year, our favorite Transit Company is concerned with entity types:concerned with entity types:

Bus, Driver, Route, Trip, Bus Stop and Passenger.Bus, Driver, Route, Trip, Bus Stop and Passenger.

TenTen years from now, there will be many years from now, there will be many changes in how the company is run, and in how changes in how the company is run, and in how the people do their jobs.the people do their jobs.

ButBut they will they will stillstill have to deal with have to deal with

Buses, Drivers, Routes, Trips, Bus Stops and PassengersBuses, Drivers, Routes, Trips, Bus Stops and Passengers!! Not only that, but ten years ago they worked Not only that, but ten years ago they worked

with with

Buses, Drivers, Routes, Trips, Bus Stops and PassengersBuses, Drivers, Routes, Trips, Bus Stops and Passengers!!

Page 40: Chapter 4 Data-Oriented Models

40Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

And a college registration system must And a college registration system must deal with entity types deal with entity types

Student, Course, Subject Area, Room, Student, Course, Subject Area, Room, Instructor and EnrolmentInstructor and Enrolment

now, now,

in the future,in the future,

and in the past,and in the past,

““As it was in the beginning, is now, As it was in the beginning, is now, and forever shall be, data without and forever shall be, data without

end. . .”end. . .”

The StabilityStability of Data.

Page 41: Chapter 4 Data-Oriented Models

41Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

This tells us thatThis tells us that

Data Entities Are Stable Data Entities Are Stable Over Time.Over Time.

The StabilityStability of Data.

Page 42: Chapter 4 Data-Oriented Models

42Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

When we organize our data around When we organize our data around the entities from the real world of the entities from the real world of the user,the user,

Those entities are stable.Those entities are stable.

The StabilityStability of Data.

Page 43: Chapter 4 Data-Oriented Models

43Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

However, entities are neither static nor However, entities are neither static nor stagnant;stagnant;

There may be an occasional new entity,There may be an occasional new entity,There will often be new attributes,There will often be new attributes,But as long as we stay in the But as long as we stay in the

same business same business there will be verythere will be very

few new entities.few new entities.

The StabilityStability of Data.

Page 44: Chapter 4 Data-Oriented Models

44Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

This stability contributes This stability contributes greatly to reducing the greatly to reducing the

costs and delays in system costs and delays in system maintenance.maintenance.

The StabilityStability of Data.

Page 45: Chapter 4 Data-Oriented Models

45Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

However, However, beware new beware new businessbusiness!!

Mergers, acquisitions, takeovers and Mergers, acquisitions, takeovers and diversifications diversifications can all put your can all put your

company into company into

new businesses new businesses with a host of with a host of

new entity types.new entity types.

The StabilityStability of Data.

Page 46: Chapter 4 Data-Oriented Models

46Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Significance of Data.

The Data modeler’s Creed:The Data modeler’s Creed:

DataDatais theis the

Centre of the UniverseCentre of the Universe

Page 47: Chapter 4 Data-Oriented Models

47Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Out of the universe of all dataOut of the universe of all data Our project is concerned only with Our project is concerned only with

the subsetthe subset that belongs in the business area that belongs in the business area

we are studying.we are studying. The ERD is the tool we have been The ERD is the tool we have been

using to study, document and using to study, document and understand this data.understand this data.

The Significance of Data.

Page 48: Chapter 4 Data-Oriented Models

48Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The structure of this data drives the The structure of this data drives the design of the databases that must design of the databases that must store it.store it.

The databases in turn support the The databases in turn support the design of the programs,design of the programs,

That support the users’ operation by That support the users’ operation by supplying exactly the data need, when supplying exactly the data need, when they need it, in a form they can use,they need it, in a form they can use,

And by accepting the data they And by accepting the data they generate as they do their jobs.generate as they do their jobs.

The Significance of Data.

Page 49: Chapter 4 Data-Oriented Models

49Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

All of this must be done in a All of this must be done in a transparent, user-friendly way, transparent, user-friendly way,

So that the software enhances theSo that the software enhances the

users’ users’ performance.performance.

This, after all, is the only This, after all, is the only reason why the software reason why the software

should exist at allshould exist at all!!

The Significance of Data.

Page 50: Chapter 4 Data-Oriented Models

50Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Data as a CorporateCorporate Asset.

Since the users both need Since the users both need and generate data as they and generate data as they work, it can be said that work, it can be said that

their operation rests upon their operation rests upon thisthis

pool of datapool of datathat must exist for them to that must exist for them to

function. function.

Page 51: Chapter 4 Data-Oriented Models

51Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Since data is something the users Since data is something the users must have must have in order to work,in order to work,

It can rightly be regarded as aIt can rightly be regarded as a Business Asset Business Asset oror ResourceResource

Just likeJust likeFinanceFinanceHuman ResourcesHuman ResourcesPlant and EquipmentPlant and EquipmentVehiclesVehiclesInventoriesInventoriesEtc.Etc.

Data as a CorporateCorporate Asset.

Page 52: Chapter 4 Data-Oriented Models

52Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

AcquisitionAcquisition Organizing, storing and safekeepingOrganizing, storing and safekeeping Deployment, on time, to the people Deployment, on time, to the people

who need itwho need it Disposal when no longer neededDisposal when no longer needed

Data as a CorporateCorporate Asset.

Like any corporate asset, there are some basic functions that must be

done as part of managing the asset:

Page 53: Chapter 4 Data-Oriented Models

53Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

This has led to two new functions in the This has led to two new functions in the information industry,information industry,

Data Administration (DA) and Data Administration (DA) and Data Resource Management (DRM).Data Resource Management (DRM).

DA is a middle-management function DA is a middle-management function concerned with finding and documenting concerned with finding and documenting every data element the company uses.every data element the company uses.

DRM is a high-level management function, DRM is a high-level management function, involving long-term strategic planning. DRM involving long-term strategic planning. DRM reports to the CIO reports to the CIO (Chief Information Officer; in a (Chief Information Officer; in a well-organized company the CIO is a vice-president).well-organized company the CIO is a vice-president).

Data as a CorporateCorporate Asset.

Page 54: Chapter 4 Data-Oriented Models

54Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The focus of DA and DRM is to The focus of DA and DRM is to manage data as we would manage data as we would manage any other business manage any other business resource.resource.

Hitherto, the ERD has been the Hitherto, the ERD has been the tool used to understand, tool used to understand, document and administer data.document and administer data.

As of now, the Object Model is As of now, the Object Model is taking over this function.taking over this function.

Data as a CorporateCorporate Asset.

Page 55: Chapter 4 Data-Oriented Models

55Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship Notation.

There are many E-R notations.There are many E-R notations. All of them work, any will do the job.All of them work, any will do the job.

Use whichever one you or your boss or Use whichever one you or your boss or your professor or your client prefers.your professor or your client prefers.

UML is now the standard notation in UML is now the standard notation in the object world, sothe object world, so

We will use UML for our Entities as well We will use UML for our Entities as well as our Objects.as our Objects.

Page 56: Chapter 4 Data-Oriented Models

56Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Draw an Entity as a square or Draw an Entity as a square or rectangular box, divided by a line near rectangular box, divided by a line near the top. the top.

Above the line place the name, singular.Above the line place the name, singular.

The Entity-Relationship Notation.Notation.

EntitiesEntities

Student

Page 57: Chapter 4 Data-Oriented Models

57Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

If there are not too many, Attributes may go in the If there are not too many, Attributes may go in the bottom part of the box.bottom part of the box.

Primary key first, marked with an asterisk.Primary key first, marked with an asterisk. If not enough room, show only the key, If not enough room, show only the key,

list the others in the accompanying write-up.list the others in the accompanying write-up.

The Entity-Relationship Notation.Notation.

AttributesAttributes

Student

*Student No.NameAgeSex

Page 58: Chapter 4 Data-Oriented Models

58Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Draw a line joining two entity boxes to show a relationship existsDraw a line joining two entity boxes to show a relationship exists Write the verb above the line.Write the verb above the line.

Enrolls InEnrolls In

The Entity-Relationship Notation.

Associations:

Student

*Student No.NameAgeSex

CourseOffering

*Course No.*DateRoom No.Max Enrol

Page 59: Chapter 4 Data-Oriented Models

59Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship Notation.

Associations

CourseOffering

*Course No.*DateRoom No.Max Enrol

Add a solid arrowhead so that it makes a sentence when you read Add a solid arrowhead so that it makes a sentence when you read itit in the direction of the arrowin the direction of the arrow::

““StudentStudent enrols in enrols in course”course”

Enrolls InEnrolls In

Student

*Student No.NameAgeSex

Page 60: Chapter 4 Data-Oriented Models

60Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship Notation.

Associations

CourseOffering

*Course No.*DateRoom No.Max Enrol

Student

*Student No.NameAgeSex

Instructor

*Employee No.NameAgeSexSalary

teaches

Enrolls In

Page 61: Chapter 4 Data-Oriented Models

61Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Enrols InEnrols In

The Entity-Relationship Notation.

Associations

CourseOffering

*Course No.*DateRoom No.Max Enrol

Student

*Student No.NameAgeSex

Instructor

*Employee No.NameAgeSexSalary

teaches

College

*NameAddressPhoneRating

Employs

Page 62: Chapter 4 Data-Oriented Models

62Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship Notation.More Examples of Associations

Customer

*A/c No.NameAddressPhone No.Balance

Product

*Prod No.DescriptionUnit PriceQty in Stock

buys

Read the sentence in the direction of the arrow:

““Customer buys Product.”Customer buys Product.”

Page 63: Chapter 4 Data-Oriented Models

63Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The Entity-Relationship Notation.More Examples of Associations

Bus

*Bus No.MakeModelSeating

Driver*Employee No.NameWageSex

Customer

*A/c No.NameAddressPhone No.Balance

Product

*Prod No.DescriptionUnit PriceQty in Stock

Read the sentence in the direction of the arrow.Read the sentence in the direction of the arrow.

drives

“Customer buys Product”

“Driver drives Bus”

buys

Page 64: Chapter 4 Data-Oriented Models

64Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Q. When a driverQ. When a driver drivesdrives a bus,a bus, how many how many does she drive?does she drive?

A.A. OneOne, usually. But over time?, usually. But over time?

Why, a whole bunch!Why, a whole bunch!Q. When a CustomerQ. When a Customer buysbuys a Product,a Product, how how

many many does he buy?does he buy?

A. One per transaction, perhaps, but over A. One per transaction, perhaps, but over time we hope he’ll buytime we hope he’ll buy a great many.a great many.

The Entity-Relationship Notation.

MultiplicityMultiplicity

Page 65: Chapter 4 Data-Oriented Models

65Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The critical thing we need to know The critical thing we need to know isis

Is it Is it OneOne, , or or

Is it Is it ManyMany??

This is theThis is the MultiplicityMultiplicity of the of the relationship (also called relationship (also called cardinalitycardinality).).

The Entity-Relationship Notation. Multiplicity

Page 66: Chapter 4 Data-Oriented Models

66Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Webster definesWebster defines CardinalityCardinality as “The as “The number of members in a set.”number of members in a set.”

For us,For us, MultiplicityMultiplicity is theis the number of number of occurrences occurrences of each entity type of each entity type that can be involved in an that can be involved in an associationassociation..

The Entity-Relationship Notation. Multiplicity

Page 67: Chapter 4 Data-Oriented Models

67Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

We diagram this by adding a We diagram this by adding a starstar (asterisk) below the (asterisk) below the relationship line whenever it should show “many.” relationship line whenever it should show “many.”

Read this one asRead this one as

““Instructor Instructor teachesteaches manymany course offerings”course offerings”

The Entity-Relationship Notation. Multiplicity

CourseOffering

*Course No.*DateRoom No.Max Enrol

Instructor

*Employee No.NameAgeSexSalary

teaches

**

Page 68: Chapter 4 Data-Oriented Models

68Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

We refer to this as aWe refer to this as a

““One-to-Many” Association,One-to-Many” Association,

or 1:Mor 1:M

The Entity-Relationship Notation.Notation. Multiplicity

CourseOffering

*Course No.*DateRoom No.Max Enrol

Instructor

*Employee No.NameAgeSexSalary

teaches

**

Page 69: Chapter 4 Data-Oriented Models

69Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Read the sentence in the direction of Read the sentence in the direction of the arrowthe arrow

Read the star (asterisk) as the word Read the star (asterisk) as the word

““manymany.”.”

The Entity-Relationship Notation.Notation. Multiplicity

CourseOffering

*Course No.*DateRoom No.Max Enrol

Instructor

*Employee No.NameAgeSexSalary

teaches

**

Page 70: Chapter 4 Data-Oriented Models

70Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

And, since we wishAnd, since we wish manymany Customers to Customers to buybuy manymany Products,Products,

This one is aThis one is a Many-to-ManyMany-to-Many association, orassociation, or M:MM:M

The Entity-Relationship Notation.Notation. Multiplicity

Customer

*A/c No.NameAddressPhone No.Balance

Product

*Prod No.DescriptionUnit PriceQty in Stock

buys

****

Page 71: Chapter 4 Data-Oriented Models

71Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

There are numerous other symbols also There are numerous other symbols also used for the “many” end of a relationship,used for the “many” end of a relationship,

including single and double arrows, etc.including single and double arrows, etc.

The star (asterisk) is the UML standard.The star (asterisk) is the UML standard.

Other ERD notations have their own ways Other ERD notations have their own ways to show “many” and what direction to to show “many” and what direction to read the sentence.read the sentence.

The Entity-Relationship Notation.Notation. Multiplicity

Page 72: Chapter 4 Data-Oriented Models

72Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

There are many ERD notations. We are using UML There are many ERD notations. We are using UML since it has become the official world standard since it has become the official world standard object notation.object notation.

AnAn entityentity is a square box, with a singular name is a square box, with a singular name above a horizontal line.above a horizontal line.

TheThe primary key primary key attribute is below the line, with an attribute is below the line, with an asterisk ( asterisk ( * * ))

Other attributes are listed below or on another Other attributes are listed below or on another page.page.

ctd. . . ctd. . .

The Entity-Relationship Notation.Notation.

SummarySummary

Page 73: Chapter 4 Data-Oriented Models

73Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

AnAn associationassociation is a line joining two entities. is a line joining two entities. Write theWrite the verbverb above the line, with arrowhead.above the line, with arrowhead. ReadingReading in the direction of the arrowin the direction of the arrow, ,

entity-verb-entity entity-verb-entity

should make a simple sentence.should make a simple sentence.

ctd. . . ctd. . .

The Entity-Relationship Notation.Notation.

SummarySummary

Page 74: Chapter 4 Data-Oriented Models

74Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

MultiplicityMultiplicity isis oneone (straight line) or(straight line) or manymany (asterisk) below each end of the line.(asterisk) below each end of the line.

The Entity-Relationship Notation.Notation.

SummarySummary

1:M1:M

M:MM:M**

** **

Page 75: Chapter 4 Data-Oriented Models

75Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

There is one majorThere is one major side benefit side benefit

to both ERDs and to both ERDs and Object modelingObject modeling..

Page 76: Chapter 4 Data-Oriented Models

76Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Both serve these four important functions:Both serve these four important functions:

Allow us toAllow us to understandunderstand the users’ business the users’ business quickly and accuratelyquickly and accurately

DocumentDocument the information needs of the users’ the information needs of the users’ businessbusiness

Give the DA the tool toGive the DA the tool to understandunderstand, , documentdocument

and ultimatelyand ultimately controlcontrol the datathe data Give aGive a templatetemplate oror patternpattern for database design.for database design.

AndAnd they arethey are more effective, more effective, and give usand give us better better insights and understanding, insights and understanding, than any of the than any of the

earlier methods.earlier methods.

Page 77: Chapter 4 Data-Oriented Models

77Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.4. Object-Oriented Models

Object-OrientedObject-Oriented Programming (OOP)Programming (OOP) is is now the state of the art.now the state of the art. Pool of C programmers Pool of C programmers C++C++ Everybody now learns JavaEverybody now learns Java

Object-OrientedObject-Oriented Analysis and Design Analysis and Design (OOA&D) (OOA&D) are still very much the are still very much the leading edge.leading edge.

Object-Oriented Databases (OODBMS)Object-Oriented Databases (OODBMS) are are powerful and rapidly catching up.powerful and rapidly catching up.

RDBMSs are going O-O.RDBMSs are going O-O.

Page 78: Chapter 4 Data-Oriented Models

78Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Object-Oriented Object-Oriented Development Development Environments Environments so far are mostlyso far are mostly Object-Oriented Front Ends Object-Oriented Front Ends that link that link to a relational database.to a relational database.

They are truly O-O only in the GUI.They are truly O-O only in the GUI. They are evolving toward true O-O,They are evolving toward true O-O, And so are the relational databases!And so are the relational databases!

ORACLE 9i permits O-O.ORACLE 9i permits O-O.

4.4. Object-Oriented Models

Page 79: Chapter 4 Data-Oriented Models

79Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.5. An Introduction to Objects

Like an entity, an object is Like an entity, an object is described by a noun,described by a noun,

And it isAnd it is ““SomeSomethingthing in the in the user’s world that has a separate user’s world that has a separate and distinct existence, and is of and distinct existence, and is of interest in that they need to keep interest in that they need to keep

datadata aboutabout itit..””

Page 80: Chapter 4 Data-Oriented Models

80Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

But an object is more than an But an object is more than an entity.entity.

In addition to the data, the object In addition to the data, the object carriescarries program code,program code,

ThatThat uses or changes that data.uses or changes that data.

4.5. An Introduction to Objects

Page 81: Chapter 4 Data-Oriented Models

81Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Now here is the Now here is the

fundamental principlefundamental principle

ofof Objects:Objects:

Page 82: Chapter 4 Data-Oriented Models

82Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

TheThe onlyonly way that a programway that a program

cancan read or change read or change

the data carried by an object, the data carried by an object,

oror access the data access the data in any way at allin any way at all

is by invoking one of the definedis by invoking one of the defined

pieces of pieces of program code program code that the object carries within that the object carries within

itself.itself.

4.5. An Introduction to Objects

Page 83: Chapter 4 Data-Oriented Models

83Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

I’ll say that again. . . I’ll say that again. . .

4.5. An Introduction to Objects

Page 84: Chapter 4 Data-Oriented Models

84Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

TheThe onlyonly way that a programway that a program

cancan read or change read or change

the data carried by an object, the data carried by an object,

oror access the data access the data in any way at allin any way at all

is by invoking one of the definedis by invoking one of the defined

pieces of pieces of program code program code that the object carries within that the object carries within

itself.itself.

4.5. An Introduction to Objects

Page 85: Chapter 4 Data-Oriented Models

85Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

This can be illustrated with a Taylor Donut This can be illustrated with a Taylor Donut Diagram:Diagram:

4.5. An Introduction to Objects

Change Address

PrintBalanceList all

Upd

ate

Bal

ance

Change

Phone N

o

Change

NameC

reat

eC

usto

mer

Delete

Customer

Name Jo Address Here Phone No 555 Balance $1.49

CustomerCustomer

Page 86: Chapter 4 Data-Oriented Models

86Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.5. An Introduction to Objects4.5. An Introduction to Objects

The “behaviors” around the outside areThe “behaviors” around the outside are subroutines or functions.subroutines or functions.

They physically are pieces ofThey physically are pieces of compiled compiled program code.program code.

In the real world they correspond to In the real world they correspond to things this object canthings this object can dodo oror have done to it.have done to it.

Page 87: Chapter 4 Data-Oriented Models

87Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.5. An Introduction to Objects4.5. An Introduction to Objects

These are called variously:These are called variously:FunctionsFunctionsBehaviorsBehaviorsOperationsOperationsServicesServicesResponsibilitiesResponsibilitiesMethods (esp. at the OOP level)Methods (esp. at the OOP level)

The data in the center is surrounded and The data in the center is surrounded and protected by them.protected by them.

Page 88: Chapter 4 Data-Oriented Models

88Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.5. An Introduction to Objects4.5. An Introduction to Objects

Thus, as Coad and Yourdon put it,Thus, as Coad and Yourdon put it, An object encapsulates both “the data, An object encapsulates both “the data,

and the exclusive functions on that and the exclusive functions on that data.”data.”

By “exclusive” we mean that By “exclusive” we mean that no other no other codecode can access or manipulate this data. can access or manipulate this data.

Page 89: Chapter 4 Data-Oriented Models

89Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

So our task as Analysts is to investigate So our task as Analysts is to investigate the users’ business to find:the users’ business to find:

The objects and their classesThe objects and their classes Their attributes and associationsTheir attributes and associations The operations that can be performed on, to, with or by The operations that can be performed on, to, with or by

these objects.these objects.

Then we check how each operation will use Then we check how each operation will use or affect the data attributes.or affect the data attributes.

In the Design phase we produce specs for In the Design phase we produce specs for each operation.each operation.

In Coding we use these specs to write them In Coding we use these specs to write them as methods in whatever OOPL we chose.as methods in whatever OOPL we chose.

4.5. An Introduction to Objects

Page 90: Chapter 4 Data-Oriented Models

90Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

OOPLs and OODBMSs actuallyOOPLs and OODBMSs actually store the store the program code program code for the methods in the for the methods in the database along with the data.database along with the data.

We write small pieces of code, each to do aWe write small pieces of code, each to do a single operation.single operation.

A Customer object will need:A Customer object will need:AnAn operationoperation called UpdateAddresscalled UpdateAddressAA piece of code piece of code to carry it outto carry it out

This code is then attachedThis code is then attached

to the object to the object

in the database.in the database.

4.5. An Introduction to Objects

Page 91: Chapter 4 Data-Oriented Models

91Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

When an object is first created, it When an object is first created, it appears as a collection of fields appears as a collection of fields (attributes)(attributes) in RAM.in RAM.

Some areSome are deleteddeleted after a short lifetime.after a short lifetime. SomeSome disappeardisappear when the machine is when the machine is

turned off.turned off.

These are allThese are all Transient Objects, Transient Objects, which which DODO NOTNOT survive beyond the survive beyond the current session.current session.

4.5. An Introduction to Objects

Page 92: Chapter 4 Data-Oriented Models

92Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Some objects we need to keep around longerSome objects we need to keep around longerCustomersCustomersEmployeesEmployeesProducts, etc.Products, etc.

i.e., all the things we normally would i.e., all the things we normally would expect to put in a expect to put in a databasedatabase..

These we create asThese we create as

Persistent Objects, Persistent Objects,

thatthat DODO survive beyond survive beyond

the current session.the current session.

4.5. An Introduction to Objects

Page 93: Chapter 4 Data-Oriented Models

93Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Objects are entities (Objects are entities (thingsthings that carry data) that carry data) with behavior (operations) added.with behavior (operations) added.

These operations exclusively access the These operations exclusively access the data it carries - no other code can touch it.data it carries - no other code can touch it.

Operations are coded in an OOPL or Operations are coded in an OOPL or OODBMS asOODBMS as methodsmethods (functions, subroutines).(functions, subroutines).

Code for the methods is storedCode for the methods is stored in the database in the database along with the data for the object.along with the data for the object.

Any program that wants data from this Any program that wants data from this object can get it only byobject can get it only by calling one of the calling one of the methods methods defined on this object.defined on this object.

4.5. An Introduction to Objects

Summary

Page 94: Chapter 4 Data-Oriented Models

94Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Transient Objects Transient Objects are created by are created by OOPLs in the RAM of the computer andOOPLs in the RAM of the computer and

DO NOT SurviveDO NOT Survive

the current session.the current session.

Persistent Objects Persistent Objects are stored by a are stored by a database (OODBMS) anddatabase (OODBMS) and

DODO SurviveSurvive beyond the current sessionbeyond the current session..

4.5. An Introduction to Objects

Summary

Page 95: Chapter 4 Data-Oriented Models

95Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.6. Object-Oriented vs Object-Based Some programming languages have objects Some programming languages have objects

but do not qualify as Object-Oriented.but do not qualify as Object-Oriented. e.g. ADA 85, Clippere.g. ADA 85, Clipper

To be truly O-O, they must have two To be truly O-O, they must have two important features:important features:

InheritanceInheritance,, and and

PolymorphismPolymorphism ((These are defined and fully explained in Chapter These are defined and fully explained in Chapter

8)8)

These two features account for a great deal These two features account for a great deal of the power and benefits of O-O methods.of the power and benefits of O-O methods.

Page 96: Chapter 4 Data-Oriented Models

96Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.7. Conceptual, Logical & Physical Models

There are a variety of modeling There are a variety of modeling paradigms available: DFDs, ERDs, paradigms available: DFDs, ERDs, Objects, etc.Objects, etc.

Each can be done at three levels.Each can be done at three levels. These are three different levels ofThese are three different levels of

abstraction:abstraction:

ConceptualConceptual

LogicalLogical

PhysicalPhysical

Page 97: Chapter 4 Data-Oriented Models

97Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

A physical model is one that shows in A physical model is one that shows in full detail:full detail:

Who will do each processWho will do each process Physically where the data will be stored Physically where the data will be stored What communications medium data will be What communications medium data will be

transferred ontransferred on

4.7. Conceptual, Logical & Physical Models

Page 98: Chapter 4 Data-Oriented Models

98Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

AA physical model physical model is the final is the final design document showing design document showing how things will be written, how things will be written, done or built, and depicting done or built, and depicting all hardware and software all hardware and software platform details, including platform details, including

data storage and data data storage and data transmission media.transmission media.

4.7. Conceptual, Logical & Physical Models

Page 99: Chapter 4 Data-Oriented Models

99Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

At theAt the logicallogical level, we build a model level, we build a model that shows everything that must be that shows everything that must be included, and everything that the included, and everything that the

system must do,system must do, withoutwithout specifying specifying

how.how.

It makes no reference to choices of It makes no reference to choices of hardware, software or media.hardware, software or media.

4.7. Conceptual, Logical & Physical Models

Page 100: Chapter 4 Data-Oriented Models

100Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

A A logical model logical model shows what a shows what a system must do or have, system must do or have,

without regard for without regard for howhow it is to it is to be done, built or represented. be done, built or represented.

4.7. Conceptual, Logical & Physical Models

Page 101: Chapter 4 Data-Oriented Models

101Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

AA conceptual model conceptual model is like a logical is like a logical

one, except that it shows theone, except that it shows the users’ users’ concept concept of of their operation.their operation.

It will miss out a lot of behind-the-It will miss out a lot of behind-the-scenes activity and structurescenes activity and structure

Things that must be there, i.e., must Things that must be there, i.e., must exist or must happen, even though the exist or must happen, even though the users are mostlyusers are mostly unawareunaware of them. of them.

These things are added when we later These things are added when we later make a logical model.make a logical model.

ItIt includes many-to-many includes many-to-many associations.associations.

4.7. Conceptual, Logical & Physical Models

Page 102: Chapter 4 Data-Oriented Models

102Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

AA Conceptual Model Conceptual Model is a is a representation of the users’ representation of the users’

business in terms ofbusiness in terms of their their conception conception of how it operates. of how it operates.

For ERDs and Object models, this For ERDs and Object models, this means it includes M:M means it includes M:M

associations.associations.

4.7. Conceptual, Logical & Physical Models

Page 103: Chapter 4 Data-Oriented Models

103Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

We begin by working with the users to We begin by working with the users to

produce aproduce a conceptual model.conceptual model. Then we expand that into aThen we expand that into a logical logical

model model by adding all the features that by adding all the features that were not apparent to the users.were not apparent to the users.

Finally we make all our design decisions Finally we make all our design decisions

and document them on theand document them on the physical physical model.model.

4.7. Conceptual, Logical & Physical Models

Page 104: Chapter 4 Data-Oriented Models

104Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

4.8. Models as Communication Tools

Users always accuse us “technoids” of Users always accuse us “technoids” of speaking in a foreign tongue.speaking in a foreign tongue.

They complain that:They complain that: ““Those computer people never listen to us,”Those computer people never listen to us,” or “They never do what we were asking for”or “They never do what we were asking for” or “They gave us way more than we needed”or “They gave us way more than we needed” or “They can never explain in English how to or “They can never explain in English how to

make it work.”make it work.”

Page 105: Chapter 4 Data-Oriented Models

105Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

The secret to solving all of these isThe secret to solving all of these is

CommunicationCommunication, , butbut

““The biggest problem The biggest problem with communication iswith communication is

the the illusionillusion that it has that it has taken place!”taken place!”

4.8. Models as Communication Tools

Page 106: Chapter 4 Data-Oriented Models

106Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

To build an accurate model, it is To build an accurate model, it is essential that you areessential that you are user-drivenuser-driven in in your modeling.your modeling.

The difference between aThe difference between a goodgood systems systems analyst andanalyst and aa greatgreat one is inone is in people skillspeople skills, ,

especiallyespecially listening skills.listening skills. ““God gave us two ears and one mouth!”God gave us two ears and one mouth!” Remember, we are using our object-Remember, we are using our object-

oriented techniques to understandoriented techniques to understand theirtheir business.business.

4.8. Models as Communication Tools

Page 107: Chapter 4 Data-Oriented Models

107Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

Once the users learn the notation, they Once the users learn the notation, they quickly take to using the model to quickly take to using the model to discuss and solve problems with the discuss and solve problems with the analysts.analysts.

All players on the team and sometimes All players on the team and sometimes outside it can make use of these outside it can make use of these models.models.

4.8. Models as Communication Tools

Page 108: Chapter 4 Data-Oriented Models

108Copyright 8 2002 Flying Kiwi Productions Inc. [email protected]

End ofChapter Four.