240 likes | 418 Views
Object Oriented Data Base. Introduction. Traditional Data Models : Hierarchical, Network (since mid-60’s), Relational (since 1970 and commercially since 1982) Object Oriented (OO) Data Models since mid-90’s Reasons for creation of Object Oriented Databases Need for more complex applications
E N D
Introduction • Traditional Data Models : Hierarchical, Network (since mid-60’s), Relational (since 1970 and commercially since 1982) • Object Oriented (OO) Data Models since mid-90’s • Reasons for creation of Object Oriented Databases • Need for more complex applications • Need for additional data modeling features • Increased use of object-oriented programming languages • Commercial OO Database products – several in the 1990’s, but did not make much impact on mainstream data management • MAIN CLAIM: OO databases try to maintain a direct correspondence between real-world and database objects so that objects do not lose their integrity and identity and can easily be identified and operated upon • Object: Two components: state (value) and behavior (operations).
OODBMS Vendors GemStone Systems, Inc. Hewlett-Packard, Inc. (OpenODB) IBEX Corporation, SA. Illustra (Informix, Inc.) Matisse Software, Inc. O2 Technology, Inc. Objectivity, Inc. Object Design, Inc. ONTOS, Inc. POET Software Corporation UniSQL Unisys Corporation (OSMOS) Versant Object Technology
ODMG (Object Data Management Group) • Provides a standard model for object databases (Object Model) • Supports object definition via ODL • Supports object querying via OQL • Supports a binding with OOL (Three langusges : C++, Java, SMALTALK).
The Object Model of ODMGInterface and Class Definition ODMG supports two concepts for specifying object types Interface & Class Both have behaviors (operations) and state (attributes and relationships) • Class • A class is a specification of abstract behavior and state of an object type • A class is Instantiable • Supports “extends” inheritance to allow both state and behavior inheritance among classes • Multiple inheritance via “extends” is not allowed • Interface • An interface is a specification of the abstract behavior of an object type • State properties of an interface (i.e., its attributes and relationships) cannot be inherited from • Objects cannot be instantiated from an interface
Object Definition Language (ODL) • ODL supports semantics constructs of ODMG • ODL is independent of any programming language • ODL is used to create object specification (classes and interfaces) • ODL is not used for database manipulation
A Very Simple ClassODL Examples • A very simple, straightforward class definition class Degree { attribute string college; attribute string degree; attribute string year; };
Inheritance via “:” – An Example interface Shape { attribute struct point {…} reference_point; float perimeter (); … }; class Triangle: Shape (extent triangles) { attribute short side_1; attribute short side_2; … };
Object Query Language (OQL) • OQL is DMG’s query language • OQL works closely with programming languages such as C++ • Embedded OQL statements return objects that are compatible with the type system of the host language • OQL’s syntax is similar to SQL with additional features for objects
Simple OQL Queries • Basic syntax: select…from…where… SELECT d.name FROM d in departments WHERE d.college = ‘Engineering’; • An entry point to the database is needed for each query • An extent name (e.g., departments in the above example) may serve as an entry point
An Example of OQL View • A view to include students in a department who have a minor: define has_minor(dept_name) as select s from s in students where s.minor_in.dname=dept_name • has_minor can now be used in queries
An Example of an OQL Aggregate Operator • To compute the average GPA of all seniors majoring in Business: avg (select s.gpa from s in students where s.class = ‘senior’ and s.majors_in.dname =‘Business’);
Binding with OOLExample : C++ Language Binding • C++ language binding specifies how ODL constructs are mapped to C++ statements and include: • a C++ class library • a Data Manipulation Language (ODL/OML) • a set of constructs called physical pragmas(to allow programmers some control over the physical storage concerns)
Class Library • The class library added to C++ for the ODMG standards uses the prefix d_for class declarations • d_Ref<T> is defined for each database class T • To utilize ODMG’s collection types, various templates are defined, e.g., d_Object<T> specifies the operations to be inherited by all objects
Template Classes • A template class is provided for each type of ODMG collections: • d_Set<T> • d_List<T> • d_Bag<t> • d_Varray<t> • d_Dictionary<T> • Thus a programmer can declare: d_Set<d_Ref<Student>>
Data Types of Attributes • The data types of ODMG database attributes are also available to the C++ programmers via the d_prefix, e.g., d_Short, d_Long, d_Float • Certain structured literals are also available, e.g., d_Date, d_Time, d_Intreval
Object Database Design • For several years, entity-relationship diagrams were the predominant modeling technique for database design. • OOD Design used Unified Modeling Language (UML) method, instead of traditional entity-relationship (ER) • The basic similarities between ER and class diagrams are • entities (classes) are drawn as boxes • binary relationships (associations) are drawn as connecting lines • n-ary associations (relationships) are drawn as diamonds. • The main differences between UML and ER diagrams occur in the details. In UML the multiplicity of an association is shown as simple numerical notation instead of as a cryptic icon
Object Definition--encapsulation. Object Name Properties Methods Customer CustomerID Address Phone AddCustomer DropCustomer Commercial Government Contact VolumeDiscount Contact BalanceDue ComputeDiscount BillLateFees AddCustomer Class name Properties Entity: Something in the real world that we wish to describe or track. Class: Description of an entity, that includes its attributes (properties) and behavior (methods). Object: One instance of a class with specific data. Property: A characteristic or descriptor of a class or entity. Method: A function that is performed by the class. Association: A relationship between two or more classes. Methods Inheritance Polymorphism
What is Data Mining?Too much data and not enough information — this is a problem facing many businesses and industries • Many Definitions • Non-trivial extraction of implicit, previously unknown and potentially useful information from data • Exploration & analysis, by automatic or semi-automatic means, of large quantities of data in order to discover meaningful patterns • Data mining, data dredging, fishing Expeditions • Knowledge Discovery in Databases (KDD)
Why Mine Data? Scientific Viewpoint • Data collected and stored at enormous speeds (GB/hour) • remote sensors on a satellite • telescopes scanning the skies • microarrays generating gene expression data • scientific simulations generating terabytes of data • Traditional techniques infeasible for raw data • Data mining may help scientists • in classifying and segmenting data • in Hypothesis Formation
What is (not) Data Mining? • What is not Data Mining? • Look up phone number in phone directory • Query a Web search engine for information about “Amazon” • What is Data Mining? • Certain names are more prevalent in certain US locations (O’Brien, O’Rurke, O’Reilly… in Boston area) • Group together similar documents returned by search engine according to their context (e.g. Amazon rainforest, Amazon.com,)
Data Mining Tasks • Prediction Methods • Use some variables to predict unknown or future values of other variables. • Description Methods Find human-interpretable patterns that describe the data. • Classification • Regression • Deviation Detection • Clustering • Association Rule Discovery • Sequential Pattern Discovery