470 likes | 1.28k Views
Semantic Object Model. Define semantic objects Use semantic object diagrams to build data models Define and illustrate the 7 basic types of semantic objects Compare semantic object and entity-relationship models. Data models as lenses. Defining Semantic Objects. SOM <> OO DB processing!
E N D
Semantic Object Model Define semantic objects Use semantic object diagrams to build data models Define and illustrate the 7 basic types of semantic objects Compare semantic object and entity-relationship models
Defining Semantic Objects • SOM <> OO DB processing! • Objects: things to be represented • Semantic: carry some meaning • Attributes • Identifiers
Semantic Object • “A named collection of attributes that sufficiently describes a distinct identity” • sufficient description means that the attributes represent all of the characteristics that users need • distinct identity is something that users recognize as independent and separate • Need not be physical
SO class vs. instance Physical? Distinct?
Attributes • Types • Simple • Group • Object • Cardinality • Domains • Physical • Semantic
Attribute Domains • Description of an attribute’s possible values • Physical Description • type and length of data, constraints • can be enumerated list • example: RoomNumber in dept. catalog? (How about the campus catalog?) • Semantic Description (logical) • function or purpose of the attribute • example: RoomNumber?
Let’s build an object • E.g., SOCCER-PLAYER? • Properties? • Instance? • Name of semantic object? • Name of semantic object instance? • Some property domains... • Physical? • Semantic?
1.1 1.1 Semantic Object Diagram Object Name STUDENT Unique Identifier StudentID StudentName FirstName Initial LastName PhoneNumber ID ID 1.1 Group Attribute Non-unique Group Identifier 0.1 1.1 Simple Attribute 1.N DEPARTMENT Object Attribute (or Object Link) Cardinality (min.max) 1.1 What is the cardinality of an identifier?
Domain specifications • Object specifications • Domain specifications (a)
Paired attributes • Object links are always paired • No 1-way object relationships
Roundtable Exercise • Form groups of 3 or 4; introduce yourself • Label yourselves: 1,2,3... • One sheet of paper and pencil per group • In turn: • one person describes an object from the following report • another person draws its diagram on the sheet (1 or 2 attributes) • rotate!
Form reverse-engineering Invoice Date: 08/15/98 FILIPPO MENCZER MCI Dumb Foreigner plan ______________________________________________________________________________ Fees $6.05 Long Distance Calls $15.50 International Long Distance Calls $105.45 ______________________________________________________________________________ Total Current Charges $127.00 International Long Distance ______________________________________________________________________________ MCI Calling Plan Calls from 319-555-PROF: DATE TIME RATE TO/FROM NUMBER MIN AMOUNT ______ ______ ______ ________________ ______________ ________ __________ Jul 29 10:44A S TO SWTZRLAND 41274812900 7 9.73 Aug 02 10:39A S TO ITALY 39336850757 4 6.08 03 12:52P S TO ITALY 39068073418 19 28.88 08 01:07P X TO ITALY 39336850757 19 28.88 14 12:48P S TO SWTZRLAND 41274812900 12 16.68 ______________________________________________________________________________ Total International Long Distance $105.45
Semantic Object Types • Simple • Composite • Compound • Hybrid • Association • Parent/Subtype • Archetype/Version
Simple Objects • Only single-valued, non-object attributes
Composite Objects • One or more multi-valued, non-object (simple or group) attributes
Is this correct? Composite Objects • Multi-valued groups can be nested
Compound Objects • Have at least one object attribute • Object attributes are always in pairs (here 1:1)
1 example of each? Compound Objects • Designer must find out about cardinalities of paired object properties • 4 types of compound objects (max card.)
Hybrid Objects • Combination of objects of two types • At least one multi-valued group attribute containing an object link
Hybrid vs. Compound Objects • What’s wrong with this?
Hybrid Object Max Cardinality • ITEM in one or more SALES-ORDERS? • ITEM in one or more LineItems within one SALES-ORDER?
Association Objects • Relates two or more objects and stores data that pertains to the relationship • Typical in resource assignments • May or may not have its own ID
Parent/Subtype Objects • Generalized object that logically contains one or more subcategories • Avoid duplication & NULLs • Subtype object attribute = IS-A attribute • Inheritance • Subtype object inherits parent attributes • Parent acquires all attributes of its subtypes
Multiple Subtypes • A parent may have more than one subtype • For exclusivity, place subtype object attributes into a subtype group • X.Y.Z • X=min group cardinality • Y=min attribute count • Z=max attribute count
Archetype/Version Objects • Archetype object produces other objects that represent versions, releases, or editions of the archetype • Version object ID contains archetype object link
E-R vs. SO Models • Objects show context (boundaries) • Objects contain multi-varied attributes • Objects contain other objects • Easier documentation (metadata)
E-R vs. SO Models • which makes better sense to you?
Form reverse-engineering Invoice Date: 08/15/98 FILIPPO/COLLEEN MENCZER Service Summary ______________________________________________________________________________ MCI One Advantage plan fee (07/25/98 to 08/14/98) $3.03 Long Distance $15.50 International Long Distance $105.45 Other Fees $6.05 ______________________________________________________________________________ Total Current Charges $130.03 International Long Distance ______________________________________________________________________________ MCI Calling Plan Calls from 319-555-PROF: DATE TIME RATE TO/FROM NUMBER MIN AMOUNT ______ ______ ______ ________________ ______________ ________ __________ Jul 29 10:44A S TO SWTZRLAND 41274812900 7 9.73 Aug 02 10:39A S TO ITALY 39336850757 4 6.08 03 12:52P S TO ITALY 39068073418 19 28.88 08 01:07P X TO ITALY 39336850757 19 28.88 14 12:48P S TO SWTZRLAND 41274812900 12 16.68 ______________________________________________________________________________ Total International Long Distance $105.45
CUSTOMER ID Name ID PhoneNumber Plan INVOICE 1.N INVOICE ID InvoiceID Date CUSTOMER Fee 0.N Call Date Time Number LONG-DISTANCE 0.ST INTERNATIONAL 0.ST Minutes Amount 1.1 INTERNATIONAL Country Rate INVOICE P 1.1.1 LONG-DISTANCE Rate INVOICE P 0.N A data model from this form