Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

12
Texas State Technical College DISCOVER! Modeling the Real World Modeling the Real World Its all about perspective.

Transcript of Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Page 1: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the Real WorldModeling the Real World

Its all about perspective.

Page 2: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the World

Computers are used in the everyday Computers are used in the everyday world, thus every computer system must world, thus every computer system must model a real world domain.model a real world domain.

• AccountingAccounting• FinanceFinance• Human ResourcesHuman Resources• Inventory ManagementInventory Management• SalesSales

This applies to databases too.This applies to databases too.

Why model?Why model?

Page 3: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the World

The Problem…The Problem…Modeling the system:Modeling the system: Early computer models forced the domain representation Early computer models forced the domain representation to fit a structure that didn’t accurately model the real to fit a structure that didn’t accurately model the real world.world.

The Solution…The Solution…Object Oriented Approaches:Object Oriented Approaches:

Model the computer systems after the real world. Model the computer systems after the real world.

The Evolution of ModelingThe Evolution of Modeling

Page 4: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the WorldEarly Design ApproachesEarly Design Approaches

Failings: Failings:

• Lack of data Lack of data encapsulationencapsulation

• All the attributes that described a real world object All the attributes that described a real world object were separate, independent pieces that had to be were separate, independent pieces that had to be tracked. They needed to be packaged together.tracked. They needed to be packaged together.

• Weak ability to define Weak ability to define relationshipsrelationships

• Since there is no tangible object, how do you define Since there is no tangible object, how do you define relationships with other non-tangible objects?relationships with other non-tangible objects?

Page 5: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the WorldObject Oriented DesignObject Oriented Design

Key Concept: Key Concept:

• Everything is viewed and created as independent Everything is viewed and created as independent objects.objects.

Implies:Implies:

• Everything is an object, even actions and events.Everything is an object, even actions and events.

• Each object is a package of attributes Each object is a package of attributes (encapsulated)(encapsulated), , components, and defined components, and defined relationshipsrelationships to other types of to other types of objects.objects.

Page 6: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the WorldObject Oriented ExampleObject Oriented Example

[[Car Engine SimpleCar Engine Simple] ]

Alternator

attributes:• voltage

• watts

• max torque

Battery

attributes:• voltage total

• voltage charged

Engine

attributes:• max HP

• max Torque

• fuel capacity

• volume

contains

contains

charges

Page 7: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the WorldObject Oriented ExampleObject Oriented Example

[[Car Engine DetailedCar Engine Detailed] ]

Alternator

attributes:• voltage

• watts

• max torque

Battery

attributes:• voltage total

• voltage charged

Engine

attributes:• max HP

• max Torque

• fuel capacity

• volume

contains

contains

Terminal

attributes:• Type: Positive

Terminal

attributes:• Type: Negative

Wire

attributes:• Capacity

•Resistance

Wire

attributes:• Capacity

•Resistance

contains

connected

connected

connected

Terminal

attributes:• Type: Positive

Terminal

attributes:• Type: Negative

contains connected

Page 8: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the WorldObject Oriented ExampleObject Oriented Example

[[InventoryInventory]]

Item

attributes:• size

• color

• category

Customer

attributes:• name

• address

Order

attributes:• Item Identifier

• Customer Identifier

• Date

• Quantity

Placed by

For Purchase Of

Page 9: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the WorldObject Oriented ExampleObject Oriented Example

[[Department of Motor Department of Motor VehiclesVehicles]] Vehicle

attributes:• VIN

• Color

• Make

• Year

License Plate

attributes:• Identifier

• Registration #

• Year Issued

Registrant

attributes:• SSN

• Name

• Age

• Address

Ownership by

Identifies

Registration

attributes:• Registrant #

• Vehicle #

• Date Registered

• Date ExpiredO

wne

rshi

p of

Page 10: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the WorldObject Oriented AnalysisObject Oriented Analysis

• Most accurate representation of the real world.Most accurate representation of the real world.

• Allows designers to better model the real world.Allows designers to better model the real world.

• Leaves control to the designer, simple models will work Leaves control to the designer, simple models will work but can also be as detailed as needed.but can also be as detailed as needed.

• Flexible enough to be used in the design of any system.Flexible enough to be used in the design of any system.

• Traditionally used primarily for programming languages.Traditionally used primarily for programming languages.• C++C++• JavaJava

• DatabaseDatabase design is best visualized as design is best visualized as Object OrientedObject Oriented..

Page 11: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the WorldRelational DatabasesRelational Databases

• Are the most common and frequently used means of Are the most common and frequently used means of information storage and organization.information storage and organization.

• Utilize an object oriented perspective and design.Utilize an object oriented perspective and design.

• Represent Represent objectsobjects through the use of tables. through the use of tables.

• Represent object Represent object attributesattributes through the use of fields. through the use of fields.

• Represent object Represent object relationshipsrelationships through the use of through the use of keys.keys.

Page 12: Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.

Texas State Technical College

DISCOVER!

Modeling the WorldIn Summary…In Summary…

• Relational databasesRelational databases are the most commonly used. are the most commonly used.

• They utilize an They utilize an object orientedobject oriented perspective and design. perspective and design.

• Object oriented Object oriented models models allow us to better represent allow us to better represent the real worldthe real world

• Object oriented models Object oriented models capturecapture real world real world objectsobjects, , their their attributesattributes, and their , and their relationshipsrelationships to other to other objects.objects.

• Relational databases Relational databases actualizeactualize the components the components through the use of through the use of tablestables (objects), (objects), fieldsfields (attributes), (attributes), and and keyskeys (relationships). (relationships).