13.1 User defined data types Flashcards
Why are user-defined data types neccessary?
Because each user-defined data type exist as a complete entity, including the data definitions, default values, and value constraints, this entity insures uniformity and consistency. Reusability - As a hierarchy of common data structures are assembled, these can be re-used within many definitions, saving coding time and insuring uniformity.
Reusability - As a hierarchy of common data structures are assembled, these can be re-used within many definitions, saving coding time and insuring uniformity.
Flexibility - The ability to create real-world data representations of data allows the database object designer to model the real world as it exists.
What are the non-composite data types?
Enumerated
Pointer
What is a non-composite data type?
A non-composite data type is defined without reference to another data type
What is a composite data type?
A composite data type is built from other data types.
Enumerated data type
An enumerated data type is a non-composite data type defined from an ordered list of values. Variables can be declared by this data type, and assigned one of the values in the list
Pointer data type
A pointer data type references memory locations. Thus, it has to relate to the type of data that it is pointing to.
What are the composite data types?
Record
Object
Set
Record data type
A record data type stores a collection of information regarding a common subject, similar to a record in a database. It is constructed from several fields, which each have their own data types; thus, the record data type is a composite data type.
Set data type
A set data type is a composite data type that allows a programmer to apply set theory operations to data in a program.
These operations typically include:
Union Difference Intersection Including an element Excluding an element Checking whether an element is in a set
Object data type
An object data type is a composite data type used in object-oriented programming to define classes.
Essentially, objects are just records with functions that act on the data that they contain.