Object-oriented database system supports object-oriented data model, named OO model. In other words, an object-oriented database system is a persistent, shareable object library storage and management; An object library is a collection of objects defined by an OO model.
Object-oriented database system is lack of uniform specification of OO model, the OO model lacks a uniform and strict definition, but many and new concepts about OO model have been agreed.
1 OO Model
An OO model is a model that describes the logical organization of real-world entities, constraints and connections between objects in the object-oriented perspective. A series of object-oriented core concepts form the basis of OO model.
The core concepts of OO models include:
(1) Object and object identity: Any entity in the real world is uniformly modeled as an object, each with a unique identity called an object identifier (OID). There is an essential difference between OID and the concept of code in relational database, as well as the record identification and tuple identification supported in some systems. The OID knowledge is independent of the value and the system global uniqueness. Objects usually remain unchanged from the actual table knowledge. A part of an object's properties, methods may change, but the object's label does not change. An OID is a standard that distinguishes two different objects. There are several common OIDs:
Value identification: identifies by value. For example, the code value of a relational database faithful forever Group is distinguished by a tuple.
Name identification: To identify with a name. For example, in a scope, the program variable is commonly used as a name identifier.
Internal identification: Is established in the data model or program design with serious not requiring the user to give the indication. For example, an object-oriented database system uses an internal identity.
(2) Encapsulation: Each object is its state and behavior of the encapsulation, where the state is the object a series of attribute values set, behavior is in the object state of the operation of the set, the operation is also known as the method. Encapsulation is a key concept of the OO model, the encapsulation is an abstraction between the object's external interface and the internal implementation, and the external communication with the object is realized through "message".
Encapsulation separates the implementation of objects from object applications, allows the implementation of algorithms and data structures to be modified without corresponding interfaces, and eliminates the need to modify the use of their applications, which facilitates data independence. Encapsulation also hides the details of the data structure and program code, and enhances the readability of the application.
Query or Use object property values must call the method, as in VB, to store the text contents of a text box in a string variable, you can use the following statement:
以下是引用片段:
myStr=txtTextBox1.text
Which, "." Called an accessor, it can access the Text property of the TxtTextBox1 object.
(3) Class: All objects that share the same attributes and set of methods form an object class (Class), and an object is an instance of a class. The concept of class is a basic concept in object-oriented database, we refer to a set of objects with similar attributes and methods as classes, and each object as an instance of the owning class.
The concept of a class is similar to that of a relational pattern, where the properties of a class are similar to those in a relational schema, and to a concept similar to the source group, an instance object of a class is similar to a tuple in a relationship. The class itself can also be considered an object, called a class object.
(4) class hierarchy: In an object-oriented database schema, you can define a lei (C1) subclass (C2), a class C1 called a class C2 superclass, and subclasses can also redefine subclasses (C3). Thus, a set of classes of object-oriented database schemas form a finite hierarchy, called class level. At the top of each class is usually called the base class. For a class, it can have more than one superclass, or it can inherit properties and methods of its direct or indirect superclass in the class hierarchy.
(5) Message: The object is encapsulated, and the object is generally communicated with the external communication through explicit messaging. That is, messages are transmitted externally to objects, access and invocation of properties and methods in objects, and internal execution of the required operation, and the result of the operation is returned as a message.
(6) Inheritance: Two commonly used base claims in OO models: Single inheritance and multiple inheritance. If a subclass can inherit only the attributes of a superclass, this inheritance is called a single inheritance, and if a subclass inherits the attributes of multiple superclass, this inheritance is called multiple inheritance. For example, "Travel car" is both a car and a wagon, it inherits all the properties, methods, and messages of two super classes of cars and wagons, so it belongs to multiple inheritance.
Inheritance is a powerful tool for modeling, and it provides a concise and accurate description and information reuse mechanism for the real world. Subclasses can inherit the attributes of a superclass, avoid many duplicate definitions, and define their own special properties, methods, and messages. When you define your own special properties, methods, and messages that conflict with properties, methods, and messages of inherited superclass, it is often resolved by the system to use different conflict resolution methods in different systems, thus generating different inheritance semantics. For example, a conflict between a subclass and a superclass is typically defined as a subclass, that is, the definition of a subclass replaces or replaces a definition inherited by a superclass, or a conflict between multiple direct superclass classes with the same name, where the precedence of a superclass is specified in a subclass, first inheriting the definition of the superclass with the highest precedence. Some systems specify a definition that inherits one of the superclass.