66
1 / 66 Chapter 4 Chapter 4 Data-Oriented Models Data-Oriented Models

Chapter 4 Data-Oriented Models

  • Upload
    stuart

  • View
    50

  • Download
    7

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Chapter 4 Data-Oriented Models

1 / 66

Chapter 4Chapter 4Data-Oriented ModelsData-Oriented Models

Page 2: Chapter 4 Data-Oriented Models

2 / 66

Chapter 4Data-Oriented Models

4.1. Data Models: The ERD4.1. Data Models: The ERD 4.2. Entity-Relationship Modeling4.2. Entity-Relationship Modeling 4.3. Object-Oriented Models4.3. Object-Oriented Models 4.4. An Introduction to Objects4.4. An Introduction to Objects 4.5. Object-Oriented v.s. Object-Based4.5. Object-Oriented v.s. Object-Based 4.6. Conceptual, Logical & Physical 4.6. Conceptual, Logical & Physical

ModelsModels 4.7. Models as Communication Tools4.7. Models as Communication Tools

Page 3: Chapter 4 Data-Oriented Models

3 / 66

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 4: Chapter 4 Data-Oriented Models

4 / 66

DATADATA andand

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

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

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

Page 5: Chapter 4 Data-Oriented Models

5 / 66

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

The Entity-Relationship The Entity-Relationship Notation.Notation.

These further issues were also These further issues were also investigated by Chen and others:investigated by Chen and others: E-R models for database designE-R models for database design The The significancesignificance of the data of an enterprise of the data of an enterprise

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

4.1. Data Models: The ERD

Chen made two contributions:

Page 6: Chapter 4 Data-Oriented Models

6 / 66

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-Relationship The Entity-Relationship Principle.Principle.

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

The The stabilitystability of data. of data.

The The significancesignificance of data. of data.

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

4.2. Entity-Relationship Modeling

Page 7: Chapter 4 Data-Oriented Models

7 / 66

Earlier methods emphasized Earlier 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 what Here we emphasize what thingsthings the the

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

need to know need 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 8: Chapter 4 Data-Oriented Models

8 / 66

A A Data Entity Data Entity is someis somethingthing that has that has separate and distinct existence separate 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 data need 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 9: Chapter 4 Data-Oriented Models

9 / 66

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

An An is a is a class or category class or category

expressing the expressing 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.

We define:We define:

Entity TypeEntity Type

Page 10: Chapter 4 Data-Oriented Models

10 / 66

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 11: Chapter 4 Data-Oriented Models

11 / 66

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

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

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 12: Chapter 4 Data-Oriented Models

12 / 66

AttributesAttributes are the are 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 know to know aboutabout an Entity.an Entity.

The Entity-Relationship The Entity-Relationship PrinciplePrinciple..

Page 13: Chapter 4 Data-Oriented Models

13 / 66

We define:We define:

An An 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 14: Chapter 4 Data-Oriented Models

14 / 66

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 a Using a verbverb to describe each link.to describe each link.

The Entity-Relationship Principle.

Associations :

Page 15: Chapter 4 Data-Oriented Models

15 / 66

In this way we are able to diagram In this way we are able to diagram the the 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 16: Chapter 4 Data-Oriented Models

16 / 66

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.

An An 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.

An An 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.

An An 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 17: Chapter 4 Data-Oriented Models

17 / 66

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 18: Chapter 4 Data-Oriented Models

18 / 66

For database design:For database design:

Each Each EntityEntity becomes a becomes a filefile or or tabletable..

Each Each AttributeAttribute becomes a becomes a fieldfield (i.e., a (i.e., a columncolumn))

Each Each AssociationAssociation becomes an becomes 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 19: Chapter 4 Data-Oriented Models

19 / 66

This tells us thatThis tells us that

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

The StabilityStability of Data.

Page 20: Chapter 4 Data-Oriented Models

20 / 66

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 very there will be very

few new entities.few new entities.

The StabilityStability of Data.

Page 21: Chapter 4 Data-Oriented Models

21 / 66

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 22: Chapter 4 Data-Oriented Models

22 / 66

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 23: Chapter 4 Data-Oriented Models

23 / 66

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 24: Chapter 4 Data-Oriented Models

24 / 66

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 a It can rightly be regarded as a Business Asset Business Asset or or ResourceResource

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

Data as a CorporateCorporate Asset.

Page 25: Chapter 4 Data-Oriented Models

25 / 66

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 26: Chapter 4 Data-Oriented Models

26 / 66

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 27: Chapter 4 Data-Oriented Models

27 / 66

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.

The ERD has been the tool used to The ERD has been the tool used to understand, document and understand, document and administer data.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 28: Chapter 4 Data-Oriented Models

28 / 66

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 Use whichever one you or your boss or your professor or your client or your professor or your client prefers.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 We will use UML for our Entities as well as our Objects.well as our Objects.

Page 29: Chapter 4 Data-Oriented Models

29 / 66

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 30: Chapter 4 Data-Oriented Models

30 / 66

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 31: Chapter 4 Data-Oriented Models

31 / 66

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. Add a solid arrowhead so that it makes a sentence when you read it Add a solid arrowhead so that it makes a sentence when you read it in the direction of in the direction of

the arrowthe arrow:: ““Student Student enrols in enrols in course”course”

Enrolls InEnrolls In

The Entity-Relationship Notation.

Associations:

Student

*Student No.NameAgeSex

CourseOffering

*Course No.*DateRoom No.Max Enrol

Page 32: Chapter 4 Data-Oriented Models

32 / 66

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 33: Chapter 4 Data-Oriented Models

33 / 66

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 34: Chapter 4 Data-Oriented Models

34 / 66

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 the This is the MultiplicityMultiplicity of the of the relationship (also called relationship (also called cardinalitycardinality).).

The Entity-Relationship Notation. Multiplicity

Page 35: Chapter 4 Data-Oriented Models

35 / 66

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 36: Chapter 4 Data-Oriented Models

36 / 66

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 37: Chapter 4 Data-Oriented Models

37 / 66

And, since we wish And, since we wish manymany Customers to Customers to buy buy manymany Products, Products,

This one is a This 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 38: Chapter 4 Data-Oriented Models

38 / 66

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 39: Chapter 4 Data-Oriented Models

39 / 66

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.

An An 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.

The The 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 40: Chapter 4 Data-Oriented Models

40 / 66

An An associationassociation is a line joining two entities. is a line joining two entities. Write the Write the verbverb above the line, with arrowhead. above the line, with arrowhead. Reading Reading 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 41: Chapter 4 Data-Oriented Models

41 / 66

MultiplicityMultiplicity is is 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 42: Chapter 4 Data-Oriented Models

42 / 66

4.3. Object-Oriented Models

Object-Oriented Object-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-Oriented Object-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 43: Chapter 4 Data-Oriented Models

43 / 66

Object-Oriented Object-Oriented Development Development Environments Environments so far are mostly so 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.3. Object-Oriented Models

Page 44: Chapter 4 Data-Oriented Models

44 / 66

4.4. 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 is And 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

data data aboutabout it.it.””

Page 45: Chapter 4 Data-Oriented Models

45 / 66

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 carries carries program code,program code,

That That uses or changes that data.uses or changes that data.

4.4. An Introduction to Objects

Page 46: Chapter 4 Data-Oriented Models

46 / 66

The The onlyonly way that a programway that a program

can can read or change read or change

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

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

is by invoking one of the defined is 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.4. An Introduction to Objects

Page 47: Chapter 4 Data-Oriented Models

47 / 66

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

4.4. 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 48: Chapter 4 Data-Oriented Models

48 / 66

4.4. An Introduction to Objects4.4. An Introduction to Objects

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

They physically are pieces of They 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 can things this object can dodo or or have done to it.have done to it.

Page 49: Chapter 4 Data-Oriented Models

49 / 66

4.4. An Introduction to Objects4.4. 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 50: Chapter 4 Data-Oriented Models

50 / 66

4.4. An Introduction to Objects4.4. 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 can access or manipulate this data.data.

Page 51: Chapter 4 Data-Oriented Models

51 / 66

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 The operations that can be performed on, to, with

or by these objects.or by these objects.

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

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

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

4.4. An Introduction to Objects

TUGASTUGAS• Analisa Objek dan Analisa Objek dan asosiasinya dari unit bisnisasosiasinya dari unit bisnisYang anda interviewYang anda interview• Analisa menggunakan Analisa menggunakan UML class diagram UML class diagram• kirim ke kirim ke [email protected] paling lambat 5 hari paling lambat 5 hari

Page 52: Chapter 4 Data-Oriented Models

52 / 66

OOPLs and OODBMSs actually OOPLs 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 a We write small pieces of code, each to do a single operation.single operation.

A Customer object will need:A Customer object will need:An An operationoperation called UpdateAddress called UpdateAddressA A 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.4. An Introduction to Objects

Page 53: Chapter 4 Data-Oriented Models

53 / 66

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 are Some are deleteddeleted after a short lifetime. after a short lifetime. Some Some disappeardisappear when the machine is when the machine is

turned off.turned off.

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

4.4. An Introduction to Objects

Page 54: Chapter 4 Data-Oriented Models

54 / 66

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 as These we create as

Persistent Objects, Persistent Objects,

thatthat DODO survive beyond survive beyond

the current session.the current session.

4.4. An Introduction to Objects

Page 55: Chapter 4 Data-Oriented Models

55 / 66

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 as OODBMS as methodsmethods (functions, subroutines).(functions, subroutines).

Code for the methods is stored Code 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 by object can get it only by calling one of the calling one of the methods methods defined on this object.defined on this object.

4.4. An Introduction to Objects

Summary

Page 56: Chapter 4 Data-Oriented Models

56 / 66

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 session.beyond the current session.

4.4. An Introduction to Objects

Summary

Page 57: Chapter 4 Data-Oriented Models

57 / 66

4.5. 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 58: Chapter 4 Data-Oriented Models

58 / 66

4.6. 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 of These are three different levels of

abstraction:abstraction:

ConceptualConceptual

LogicalLogical

PhysicalPhysical

Page 59: Chapter 4 Data-Oriented Models

59 / 66

A A 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.6. Conceptual, Logical & Physical Models

Page 60: Chapter 4 Data-Oriented Models

60 / 66

At the At 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.6. Conceptual, Logical & Physical Models

A A logical model logical model shows what a system shows what a system must do or have, without regard must do or have, without regard for for howhow it is to be done, built or it is to be done, built or

represented. represented.

Page 61: Chapter 4 Data-Oriented Models

61 / 66

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

business in terms of business 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.6. Conceptual, Logical & Physical Models

Page 62: Chapter 4 Data-Oriented Models

62 / 66

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

produce a produce a conceptual model.conceptual model. Then we expand that into a Then 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.6. Conceptual, Logical & Physical Models

Page 63: Chapter 4 Data-Oriented Models

63 / 66

4.7. 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 Those computer people never listen to

us,”us,” or “They never do what we were asking or “They never do what we were asking

for”for” or “They gave us way more than we or “They gave us way more than we

needed”needed” or “They can never explain in English how or “They can never explain in English how

to make it work.”to make it work.”

Page 64: Chapter 4 Data-Oriented Models

64 / 66

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

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

especially especially 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 understand oriented techniques to understand theirtheir business.business.

4.7. Models as Communication Tools

Page 65: Chapter 4 Data-Oriented Models

65 / 66

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.7. Models as Communication Tools

Page 66: Chapter 4 Data-Oriented Models

66 / 66

End ofChapter 4