Advance Database Management Systems : 11 Object Structure and Type Constructors Prof Neeraj Bhargava Vaibhav Khanna Department of Computer Science School of Engineering and Systems Sciences Maharshi Dayanand Saraswati University Ajmer
Object Identity • Unique Identity: – An OO database system provides a unique identity to each independent object stored in the database. • This unique identity is typically implemented via a unique, system-generated object identifier, or OID • The main property required of an OID is that it be immutable – Specifically, the OID value of a particular object should not change. – This preserves the identity of the real-world object being represented.
Type Constructors • Type Constructors: – In OO databases, the state (current value) of a complex object may be constructed from other objects (or other values) by using certain type constructors. • The three most basic constructors are atom, tuple, and set. • Other commonly used constructors include list, bag, and array. • The atom constructor is used to represent all basic atomic values, such as integers, real numbers, character strings, Booleans, and any other basic data types that the system supports directly.
Example 1 – One possible relational database state corresponding to COMPANY schema
Example 1 (contd.):
Example 1 (contd.)
Object Identity and Object Structure • Example 1 (contd.) – We use i1, i2, i3, . . . to stand for unique system- generated object identifiers. Consider the following objects: • o1 = (i1, atom, ‘Houston’) • o2 = (i2, atom, ‘Bellaire’) • o3 = (i3, atom, ‘Sugarland’) • o4 = (i4, atom, 5) • o5 = (i5, atom, ‘Research’) • o6 = (i6, atom, ‘1988-05-22’) • o7 = (i7, set, {i1, i2, i3})
Object Identity, Object Structure, and Type Constructors • Example 1(contd.) • o8 = (i8, tuple, <dname:i5, dnumber:i4, mgr:i9, locations:i7, employees:i10, projects:i11>) • o9 = (i9, tuple, <manager:i12, manager_start_date:i6>) • o10 = (i10, set, {i12, i13, i14}) • o11 = (i11, set {i15, i16, i17}) • o12 = (i12, tuple, <fname:i18, minit:i19, lname:i20, ssn:i21, . . ., salary:i26, supervisor:i27, dept:i8>) • . . .
Object Identity, Object Structure, and Type Constructors • Example 1 (contd.) – The first six objects listed in this example represent atomic values. – Object seven is a set-valued object that represents the set of locations for department 5; the set refers to the atomic objects with values {‘Houston’, ‘Bellaire’, ‘Sugarland’}. – Object 8 is a tuple-valued object that represents department 5 itself, and has the attributes DNAME, DNUMBER, MGR, LOCATIONS, and so on.
Example 2 – This example illustrates the difference between the two definitions for comparing object states for equality. – o1 = (i1, tuple, <a1:i4, a2:i6>) – o2 = (i2, tuple, <a1:i5, a2:i6>) – o3 = (i3, tuple, <a1:i4, a2:i6>) – o4 = (i4, atom, 10) – o5 = (i5, atom, 10) – o6 = (i6, atom, 20)
Example 2 (contd.) • Example 2 (contd.): – In this example, The objects o1 and o2 have equal states, since their states at the atomic level are the same but the values are reached through distinct objects o4 and o5. – However, the states of objects o1 and o3 are identical, even though the objects themselves are not because they have distinct OIDs. – Similarly, although the states of o4 and o5 are identical, the actual objects o4 and o5 are equal but not identical, because they have distinct OIDs.
Type Constructors
Assignment • What do you understand by Object Identity, Object Structure, and Type Constructors. • Give an Example to demonstrate the usage of Object Identity, Object Structure, and Type Constructors

Adbms 11 object structure and type constructor

  • 1.
    Advance Database ManagementSystems : 11 Object Structure and Type Constructors Prof Neeraj Bhargava Vaibhav Khanna Department of Computer Science School of Engineering and Systems Sciences Maharshi Dayanand Saraswati University Ajmer
  • 2.
    Object Identity • UniqueIdentity: – An OO database system provides a unique identity to each independent object stored in the database. • This unique identity is typically implemented via a unique, system-generated object identifier, or OID • The main property required of an OID is that it be immutable – Specifically, the OID value of a particular object should not change. – This preserves the identity of the real-world object being represented.
  • 3.
    Type Constructors • TypeConstructors: – In OO databases, the state (current value) of a complex object may be constructed from other objects (or other values) by using certain type constructors. • The three most basic constructors are atom, tuple, and set. • Other commonly used constructors include list, bag, and array. • The atom constructor is used to represent all basic atomic values, such as integers, real numbers, character strings, Booleans, and any other basic data types that the system supports directly.
  • 4.
    Example 1 – Onepossible relational database state corresponding to COMPANY schema
  • 5.
  • 6.
  • 7.
    Object Identity andObject Structure • Example 1 (contd.) – We use i1, i2, i3, . . . to stand for unique system- generated object identifiers. Consider the following objects: • o1 = (i1, atom, ‘Houston’) • o2 = (i2, atom, ‘Bellaire’) • o3 = (i3, atom, ‘Sugarland’) • o4 = (i4, atom, 5) • o5 = (i5, atom, ‘Research’) • o6 = (i6, atom, ‘1988-05-22’) • o7 = (i7, set, {i1, i2, i3})
  • 8.
    Object Identity, ObjectStructure, and Type Constructors • Example 1(contd.) • o8 = (i8, tuple, <dname:i5, dnumber:i4, mgr:i9, locations:i7, employees:i10, projects:i11>) • o9 = (i9, tuple, <manager:i12, manager_start_date:i6>) • o10 = (i10, set, {i12, i13, i14}) • o11 = (i11, set {i15, i16, i17}) • o12 = (i12, tuple, <fname:i18, minit:i19, lname:i20, ssn:i21, . . ., salary:i26, supervisor:i27, dept:i8>) • . . .
  • 9.
    Object Identity, ObjectStructure, and Type Constructors • Example 1 (contd.) – The first six objects listed in this example represent atomic values. – Object seven is a set-valued object that represents the set of locations for department 5; the set refers to the atomic objects with values {‘Houston’, ‘Bellaire’, ‘Sugarland’}. – Object 8 is a tuple-valued object that represents department 5 itself, and has the attributes DNAME, DNUMBER, MGR, LOCATIONS, and so on.
  • 10.
    Example 2 – Thisexample illustrates the difference between the two definitions for comparing object states for equality. – o1 = (i1, tuple, <a1:i4, a2:i6>) – o2 = (i2, tuple, <a1:i5, a2:i6>) – o3 = (i3, tuple, <a1:i4, a2:i6>) – o4 = (i4, atom, 10) – o5 = (i5, atom, 10) – o6 = (i6, atom, 20)
  • 11.
    Example 2 (contd.) •Example 2 (contd.): – In this example, The objects o1 and o2 have equal states, since their states at the atomic level are the same but the values are reached through distinct objects o4 and o5. – However, the states of objects o1 and o3 are identical, even though the objects themselves are not because they have distinct OIDs. – Similarly, although the states of o4 and o5 are identical, the actual objects o4 and o5 are equal but not identical, because they have distinct OIDs.
  • 13.
  • 14.
    Assignment • What doyou understand by Object Identity, Object Structure, and Type Constructors. • Give an Example to demonstrate the usage of Object Identity, Object Structure, and Type Constructors