Presentation is loading. Please wait.

Presentation is loading. Please wait.

9/7/1999Information Organization and Retrieval Database Design: Object- Oriented Modeling University of California, Berkeley School of Information Management.

Similar presentations


Presentation on theme: "9/7/1999Information Organization and Retrieval Database Design: Object- Oriented Modeling University of California, Berkeley School of Information Management."— Presentation transcript:

1 9/7/1999Information Organization and Retrieval Database Design: Object- Oriented Modeling University of California, Berkeley School of Information Management and Systems SIMS 202: Information Organization and Retrieval

2 9/7/1999Information Organization and Retrieval Review New Personal Database assignment Database Design Process Basics of ER Diagrams

3 9/7/1999Information Organization and Retrieval Database Design Process Conceptual Model Logical Model External Model Conceptual requirements Conceptual requirements Conceptual requirements Conceptual requirements Application 1 Application 2Application 3Application 4 Application 2 Application 3 Application 4 External Model External Model External Model Internal Model

4 9/7/1999Information Organization and Retrieval Entity An Entity is an object in the real world (or even imaginary worlds) about which we want or need to maintain information –Persons (e.g.: customers in a business, employees, authors) –Things (e.g.: purchase orders, meetings, parts, companies) Employee

5 9/7/1999Information Organization and Retrieval Attributes Attributes are the significant properties or characteristics of an entity that help identify it and provide the information needed to interact with it or use it. (This is the Metadata for the entities.) Employee Last Middle First Name SSN Age Birthdate Projects

6 9/7/1999Information Organization and Retrieval Relationships Class Attends Student Part Supplies project parts Supplier Project

7 9/7/1999Information Organization and Retrieval More Complex Relationships Project Evaluation Employee Manager 1/n/n 1/1/1 n/n/1 Manages Employee Project Assigned Employee 4(2-10)1 SSNProjectDate Manages Is Managed By 1 n

8 9/7/1999Information Organization and Retrieval Ordering: Full ER Customer No ShipVia Dest ShipVia DiveStok DiveItem DiveOrds DiveCust Customer No ShipVia Order No Order No Item No Item No Destination Name Destination no 1 1 1 1 1 n n n n n

9 9/7/1999Information Organization and Retrieval Sites and Sea Life 2 Sites BioSite BioLife Species No Site No Destination no Species No 1 1 n n

10 9/7/1999Information Organization and Retrieval Sites and Shipwrecks Sites ShipWrck Site No Destination no Site No 1/n 1

11 9/7/1999Information Organization and Retrieval DiveShop ER Diagram Customer No ShipVia Dest Sites BioSite ShipVia ShipWrck BioLife DiveStok DiveItem DiveOrds DiveCust Customer No ShipVia Order No Order No Item No Item No Destination Name Destination Species No Site No Destination no Site No Destination no Species No Site No 1 1 1 1 1 1 1/n 1 1 n n n n n n n n 1

12 9/7/1999Information Organization and Retrieval Today Object Oriented Modeling and UML Semantic Object Model –Introduced in earlier editions of Kroenke –An alternative approach to modeling the sorts of entities and relationships of a database

13 9/7/1999Information Organization and Retrieval Object-Oriented Modeling Becoming increasingly important as –Object-Oriented and Object-Relational DBMS continue to proliferate –Databases become more complex and have more complex relationships than are easily captured in ER or EER diagrams

14 9/7/1999Information Organization and Retrieval Object Benefits Encapsulate both data and behavior Object-oriented modeling methods can be used for both database design and process design –Real-World applications have more than just the data in the database they also involve the processes, calculations, etc performed on that data to get real tasks done –OOM can be used for more challenging and complex problems

15 9/7/1999Information Organization and Retrieval Unified Modeling Language (UML) Combined three competing methods Can be used for graphically depicting

16 9/7/1999Information Organization and Retrieval CLASS A class is a named description of a set of objects that share the same attributes, operations, relationships, and semantics. –An object is an instance of a class that encapsulates state and behavior. These objects can represent real-world things or conceptual things. –An attribute is a named property of a class that describes a range of values that instances of that class might hold. –An operation is a named specification of a service that can be requested from any of a class's objects to affect behavior in some way or to return a value without affecting behavior

17 9/7/1999Information Organization and Retrieval UML Relationships A relationship is a connection between or among model elements. The UML defines four basic kinds of relationships: –Association –Dependency –Generalization –Realization

18 9/7/1999Information Organization and Retrieval UML Diagrams The UML defines nine types of diagrams: –activity diagram –class diagram Describes the data and some behavioral (operations) of a system –collaboration diagram –component diagram –deployment diagram –object diagram –sequence diagram –statechart diagram –use case diagram

19 9/7/1999Information Organization and Retrieval Class Diagrams A class diagram is a diagram that shows a set of classes, interfaces, and/or collaborations and the relationships among these elements.

20 9/7/1999Information Organization and Retrieval UML Class Diagram DIVEORDS Order No Customer No Sale Date Shipvia PaymentMethod CCNumber No of People Depart Date Return Date Destination Vacation Cost CalcTotalInvoice() CalcEquipment() Class Name List of Attributes List of operations

21 9/7/1999Information Organization and Retrieval Object Diagrams 307:DIVORDS Order No = 307 Customer No = 1480 Sale Date = 9/1/99 Ship Via = UPS PaymentMethod = Visa CCNumber = 12345 678 90 CCExpDate = 1/1/01 No of People = 2 Depart Date = 11/8/00 Return Date = 11/15/00 Destination = Fiji Vacation Cost = 10000

22 9/7/1999Information Organization and Retrieval Differences from Entities in ER Entities can be represented by Class diagrams But Classes of objects also have additional operations associated with them

23 9/7/1999Information Organization and Retrieval Operations Three basic types for database –Constructor –Query –Update

24 9/7/1999Information Organization and Retrieval Associations An association is a relationship that describes a set of links between or among objects. An association can have a name that describes the nature of this relationship. You can put a triangle next to this name to indicate the direction in which the name should be read. An association contains an ordered list of association ends. –An association with exactly two association ends is called a binary association –An association with more than two ends is called an n- ary association.

25 9/7/1999Information Organization and Retrieval Associations: Unary relationships Person Is-married-to 0..1 Employee manages * 0..1 manager

26 9/7/1999Information Organization and Retrieval Associations: Binary Relationship Employee Parking Place One-to-one Is-assigned0..1 Product Line Product One-to-many contains1 * StudentCourse Many-to-many Registers-for* *

27 9/7/1999Information Organization and Retrieval Associations: Ternary Relationships VendorWarehouse * * Supplies Part *

28 9/7/1999Information Organization and Retrieval Association Classes StudentCourse Registers-for * * Registration ________________ Term Grade ________________ CheckEligibility() Computer Account _________________ acctID Password ServerSpace *0..1 issues

29 9/7/1999Information Organization and Retrieval Derived Attributes, Associations, and Roles Student _________ name ssn dateOfBirth /age Course Offering ____________ term section time location Registers-for * 1 Course ____________ crseCode crseTitle creditHrs * * Scheduled-for {age = currentDate – dateOfBirth} * * /Takes /participant Derived attribute Derived role Derived association

30 9/7/1999Information Organization and Retrieval Generalization Employee ____________ empName empNumber address dateHired ____________ printLabel() Hourly Employee _______________ HourlyRate _______________ computeWages() Salaried Employee _______________ Annual Sal stockoption _______________ Contributepension() Consultant _______________ contractNumber billingRate _______________ computeFees()

31 9/7/1999Information Organization and Retrieval Semantic Objects Very similar to UML representation Similar to an Entity Represents something in the organization’s work environment that we want to keep information about. Formally “A named collection of attributes that sufficiently describes a distinct identity” (Kroenke, p. 74)

32 9/7/1999Information Organization and Retrieval Semantic Objects Semantics objects are grouped into classes –Object class names are spelled in capitals (e.g. STUDENT, DEPARTMENT, DIVECUST, etc.) SO’s have collections of attributes SO’s represent distincts identities –Difference between “Objects” and “Object Instances” Need not be physical entities (e.g. P.O.’s)

33 9/7/1999Information Organization and Retrieval SOM Attributes Three types: –Simple attributes have a single value –Group attributes composites of other attributes (e.g. Address is a composite of Street, City, State, Zip) –Semantic Object Attributes establish a relationship between one semantic object and another.

34 9/7/1999Information Organization and Retrieval SOM Example DEPARTMENT CampusAddress Building OfficeNumber id DepartmentName PhoneNumber FaxPhoneNumber COLLEGE PROFESSOR STUDENT 1.1 0.1 1.N 0.1 1.1 1.N

35 9/7/1999Information Organization and Retrieval Object Instance School of Information Management and Systems South Hall 202 642-1464 642-9980 642-1465 642-5814 School of Information Management and Systems Larson Hearst Varian Smith Etc...

36 9/7/1999Information Organization and Retrieval Developing a Semantic Object Model We will look at a small business -- a diveshop that offers diving adventure vacations Assume that we have done interviews with the business and found out the following information about the forms used and types of information kept in files and used for business operations...

37 9/7/1999Information Organization and Retrieval Primary Business Operations The shop takes orders from customers for dive vacations. It ships information about the dive vacation to the customers. It rents diving equipment for the divers going on the trips (these may include additional people other than the customer) It bills the customer for the vacation and for equipment rental or sales.

38 9/7/1999Information Organization and Retrieval Business Operations (cont.) It arranges sub-trips to particular dive sites at the primary location. It provides information about the features of various sites to help customers choose their destinations. –Features include sea life found at the location and shipwrecks

39 9/7/1999Information Organization and Retrieval Business Operations (cont.) Each dive order (or sale or trip) is on an invoice to one customer. –Invoices contain: Line items for each type of equipment ordered, Total amount due for the invoice, Customer information: –Name, address, phone, credit card info. Information must be kept on inventory of dive equipment. There are multiple types of dive equipment: –The prices charged for sale or rental are maintained.

40 9/7/1999Information Organization and Retrieval Business Operations (cont.) Destination information includes: –Name of the destination –information about the location (accomodations, night life, travel cost, average temperatures for different times of the year Destinations have associate dive sites. Dive Sites have associated features – Sea life –Shipwrecks

41 9/7/1999Information Organization and Retrieval Business Operations (cont.) One record is kept for each order by a customer and will include the method of payment, total price, and location information. (I.e. Customers may have multiple orders) The company needs to know how an order is to be shipped. The shop has to keep track of what equipment is on-hand and when replacements or additional equipment is needed

42 9/7/1999Information Organization and Retrieval Application of SOM to Diveshop DIVECUST Address Street City StateProvince ZIPPostalCode Country Phone FirstContact Name DIVEORDS 1.1 1.N 1.1

43 9/7/1999Information Organization and Retrieval DIVEORDS id OrderNo SaleDate SHIPVIA DESTINATION DIVEITEM PaymentMethod CCNumber CCExpDate NoOfPeople DepartDate ReturnDate VacationCost DIVECUST

44 9/7/1999Information Organization and Retrieval Assignment 1 What are the answers? –Access examples


Download ppt "9/7/1999Information Organization and Retrieval Database Design: Object- Oriented Modeling University of California, Berkeley School of Information Management."

Similar presentations


Ads by Google