Object type
Before you see this chapter, let me think of JDO. If Oracle can implement the operation of the relational database with an object, how good it is. I don't know what this chapter will bring me.
Object components include attributes and methods
The attribute is the translation of Attribute. Usually in advanced languages, attributes are typically translated by Property, while Attribute is translated as features. In Oracle, Attribute and Java's Property correspond to it. That is, it has the properties of the description object.
method(
Method
) Used to implement the operations performed by the object.
1 Construction method After 9i, it is allowed to be overloaded.
Constructor Function Fangfaming (Somevariable ...) Return Self as result This fangfaming here must be the defined class name, otherwise it is called "constructor" 2Member method is an instance method in advanced languages.
MEMBER Procedure Fangfa1 ()
MEMBER FUNCTION FANGFA2 () RETURN SIMPLE_TYPE
use:
Declare
A_SHILI A_LEI;
Begin
A_shili.fangfa1 ()
3static method is a class method, a global method.
A_lei.staticfa ();
The 4MAP method is used to map the object instance into a scalar value, and then the object instance can be sorted according to the scalar type data. Used to compare multiple object instances.
5ORDER method is used to compare the size of two object instances
In an object type, you can only define a MAP method or an Order method (they cannot be used at the same time).
Object type
Includes Object Type Specification and Object Type Body. It is defined and implemented. For those who are familiar with Delphi, it may think that this way is very decent.
Establish an object type specification syntax:
Create or Replace Type Type_Name As Object (
Attribute1 DataType, [, Attribute2 DataType, ...],
[MEMBER | Static Method1 Spec,
MEMBER | Static Method2 Spec, ...]);
Establish the syntax of the object type:
Create Or Replace Type Body Type_name As
MEMBER | static method1 body;
MEMBER | static method2 body;
...]);
When establishing an object type, at least one property can be defined (this does not need to establish an object type body).
Object Table - Like the object / instance in the advanced language, it is the implementation of the class, divided into line objects and column objects.
Line object is a table established directly to the object type
Create Table Table_name of Type_name
Column objects are object tables that contain multiple columns
Create TBALE TABLE_NAME {
MyNum Number (6),
Mytype type_name,
Mychar varchar2 (10)
);
REF data type
By using the REF, it is a different table sharing the same object, thereby reducing the occupation of memory.
Here is the information about JDO. Author Sun2bin Oracle and JDO As an important member of the JDO expert group, it is clear that the Oracle status of the largest relationship database manufacturer is apparently non-common. In the JDO specification, Oracle can also be said to have a hoe-sweating, a lot of API's formation, Oracle provides a very important reference, and the final vote Oracle is not hesitant. However, the world is always changed, and when JDO1.0 is released, Oracle acquires Toplink, which makes Oracle's identity and complex. Toplink is a commercial product, and Oracle is also a typical business that is pursuing interests, this is a typical business with JDO's open spirit. Therefore, we see the later Oracle's unprically attitude toward JDO, even in the Javaone conference, someone informally attack JDO from Oracle's perspective. - "JDO before the world" object packaging technology, hundreds of concertment? Is the magical dance? Thus, from the principle of standardized development, we start writing your own JavaBean to pack data objects, making data objects, avoiding too many places involving JDBC operations. But some problems also come: the flexibility is not enough, the interface is dead, the performance is low, which makes me worry. So, "the gentleman is not different, good and fake is also in the object", and I also go online to find "technical support"! Soon, it was actually discovered "CASTOR JDO", a special OQL dedicated to data packaging, DMG standard OQL as a query language, convenient and easy to understand, much better than SQL. This allows me to enjoy the benefits of "object-oriented database development", "the effect is good, affordable!".
However, the good view is not long, some inherent bugs in Castor affect stability, and this free product update is too slow, and has not been resolved. I have to give up. "Doubted see tears in their eyes, even Yuning choke"! How to do? You know, how can you endure the life that can only be taken by the person who is extravagant, people who are extravagant, those who eat meat! It is still uncommon to "Party B". For us, using JDBC original call seems to be difficult to swallow, and then use JavaBean packaging and a little return, so I started the online search history.
Yu Qiuyu
Mr. has "cultural and bitter travel", this is also "programming bitter travel", huh, huh, hilarious.
From the online information, my experience is also a common experience of many Java development colleagues. Whether domestic or abroad, from the actual situation, foreign research is more in-depth, at least from the information you can found online. It is the case. The United States has begun to study object-oriented database ODBMS from the 1980s. There are currently some forming products, such as Versant's Versant database, FastObjects's FastObjects T7 database, and other companies such as ObjectStore, such as other relative market share. Products, of course, there are no shortcomings such as orient, etc. Overall, although ODBMS has an object-oriented advantage, because of historical reasons, it is always in the lower wind in the competition with the relational database RDBMS, and the application based on RDBMS is still mostly, and therefore, some Object-Relational maps appear. Tool, the Cast mentioned earlier is a tool in recent years. In fact, there are some mature, stable commercial products, such as toplink acquired by Oracle, WEBGAIN, which is acquired by BEA , More famous Cocobase, and more. I also understand the product like Toplink, the function is powerful, performance, and stability have advantages, however, their equally powerful prices and weird APIs make me step. I am very worried that it is locked in a product, can't get out, well known, Java gives us a feeling of freedom, freedom, will always attract people.
Where is the way out? JDO is in front of my eyes.
JDO Since 1999, JDO has submitted an outline from some experienced developers who often write database object mappings, and they have conducted a lot of database processing and objective packaging in long-term object-oriented development, finally, a variety of diverse Packaging methods have caused many compatibility issues. So some major development teams jointly, with Sun as leading sheep, developed JDO specifications. Its goal is not to replace JDBC or EJB, but packaged on the JDBC, and can also make EJB's underlying (CMP), simplify the J2EE server provider. JDO is primarily for small and medium-sized projects, but with the product provider (Vendors) gives more and more features, such as distributed synchronous control, JDO's role is growing. JDO Specifications Under the leadership of Sun's experienced Craig Russel, after three years of discussion, the first edition was formed in April 2002. - "How to use JDO Development Database Application"