1、EUROPEAN COMPUTER MANUFACTURERS ASSOCIATIONOBJECT-ORIENTED DATABASESECMA TR/59June 1992.EUROPEAN COMPUTER MANUFACTURERS ASSOCIATIONOBJECT-ORIENTED DATABASESECMA TR/59June 1992.BRIEF HISTORYObject-oriented databases, or OODBs, are likely to be the databases of the future. A flurry of activity over th
2、e next fewyears is expected - not least in the area of standardization and development of commercial object-oriented databaseproducts.These databases are capable of handling any type of data that may be represented as objects. Such type of data includetext, graphics (still and moving images), and au
3、dio data. Popularity of object-oriented database is assured by virtue ofuser-friendly features: as an example, a single retrieval command would send appropriate data to the relevant port, bethis connected to a printer, a screen or a loudspeaker system.This ECMA Technical Report provides general back
4、ground information on object-oriented systems, object-orienteddatabases and object-oriented database management systems, and identifies the issues related to databases. It isintended as a tutorial for novices.Work on this ECMA Technical Report started in ECMA TC22, Databases, in the middle of 1990 a
5、nd was completed atthe end of 1991.Adopted as an ECMA Technical Report by the ECMA General Assembly of June 1992.- i -Table of Contents1Scope 12 Structure 13 Acronyms 14 Object-Oriented Approach 14.1 Object 14.2 Object-oriented programming languages 34.3 Benefits of object-oriented systems 34.4 Limi
6、tations of object-oriented systems 45 Object-oriented databases 45.1 Viable object-oriented database solutions 45.2 Problems and issues to be resolved 56 Standards 66.1 International 66.2 National standardisation activity 77 Conclusions 7- ii -.1ScopeThis ECMA Technical Report provides general backg
7、round information on object-oriented systems, object-oriented databases, object-oriented database management systems, and identifies issues related to databases.General background information on the object-oriented approach is provided, and specifically the followingitems are discussed:- significanc
8、e of current interest in object-oriented systems;- issues to be addressed by object-oriented database developers;- standardisation activity.The intent of the report is to inform readers who are unfamiliar with object-oriented databases and highlight therelated issues.2 StructureThe rest of this repo
9、rt describes the object-oriented (OO) approach and a number of characteristics of theobjects. It gives considerations to the current standardisation work and identifies a number of sources that werestudied or have influenced this report.3 AcronymsDB database DBL database languageDBMS database manage
10、ment system OO object-orientedOODB object-oriented database OODBMS object-oriented database management systemOOPL Object-oriented programming language OOS object-oriented systemSQL structured query language4 Object-Oriented ApproachThe advantages of using an object-oriented approach have been recogn
11、ised for some time and stem from thebasic concepts of an object-oriented system (OOS). Before considering object-oriented databases therefore,these basic concepts are introduced first.4.1 Object4.1.1 Black-box view of an objectThe most fundamental concept in an object-oriented system is that of a se
12、lf-contained modularisation intoentities called “objects“. An object is an entity that can be identified by a name, however, it should beessentially regarded as a “black box“. As such, an object is characterised by the public interface offered tothe outside world and the behaviour exhibited when mes
13、sages are passed to the object via that interface.The internal workings of an object is hidden from the surrounding external environment. See figure 1.objectexternal interfaceinput messageresponse behaviourFigure 1 - Black-box view of an object- 2 -4.1.2 Object classes and instancesAn object belongs
14、 to a class which identifies its type. A particular example of class of an object is termedan instance of an object. An object class may have subclasses below it. The object can then be referred toas the superclass of the subclass object and the classes form an hierarchy. The features of the class b
15、asicobject are shared and propagated down the hierarchy of classes. See figure 2, giving examples ofhierarchy of objects called shapes.Classshapessubclass subclass subclasstriangles squares circlessub-subclassinstancesinstancesinstancesFigure 2 - Object classes and instances4.1.3 Data abstraction an
16、d extendibilityGeneric messages can be used to invoke specific methods on the hidden data. Table 1 is an example of theresponses to a message, depending on the real structure of the object.Table 1 - Relationship between messages and responsesInput message to an object: add (A+B) ResponseA and B real
17、 numbers (A+B)A and B complex numbers (a+jA) + (b+jB) (a+b) + j(A+B)A and B characters string ABA and B others (not recognised type) reject messageThis characteristic makes the addition of new features to produce a new class of specialised objects froman existing one relatively easy.4.1.4 Inside vie
18、w of an objectThe objects contain data and code for procedures to manipulate the data. These procedures are referred toas “methods“ in the object-oriented terminology. This containment of data and procedure within an objectis called encapsulation.The data within an object can only be accessed by the
19、 internal procedure and in order to access andmanipulate this data, an appropriate method needs to reside inside the relevant object, see figure 3. If therequired method does not exist within the object then the request would be ineffective and rejected.Any object can be a composite object made up o
20、f any number of one or more objects, not visibleexternally.- 3 -PPPPPPPP12345678DATAexternal interfacecomposite objectIO internal objectinternal mechanism for message distributionP - P - Procedures 1 - 818Figure 2 - Inside structure of an object4.2 Object-oriented programming languagesWriting progra
21、ms using an object-oriented approach requires object-oriented programming languages(OOPL).A number of object-oriented programming languages have emerged such as SIMULA, LISP, MODULA,ADA, SMALLTALK-80 and, as noted above, C+. None of them are perfect object-oriented programminglanguages, but each add
22、resses some of the requirements . In addition, object-oriented features have beenadded to other popular programming languages such as PASCAL.C+ and SMALLTALK-80 appear to be emerging as the leading object-oriented programming languages.4.3 Benefits of object-oriented systems4.3.1 Increased productiv
23、ityObject-oriented technology increases productivity through the software life cycle offering return oninvestment.With the object-oriented approach time required for software system design phase is found to be reducedby as much as half with perhaps only a quarter of the effort in man-years being req
24、uired compared with aconventional approach.4.3.2 Models complexityA physical system can be mapped on to a software design by identifying all significant physical objectsand mapping them on to classes of corresponding software objects which could be arranged in a hierarchy.The approach consists of de
25、fining an object class incorporating all the common functionality. Furthersubclasses are then defined for each type of object required in the system for its specific features that areover and above the common features.- 4 -4.3.3 Designed for changeThis benefit arises from the fact that messages are
26、used for communicating between objects. Thus if onetype of object becomes obsolete, it can be replaced with an object providing higher functionality which isa member of a newly defined subclass of the existing superclass. The main body of the system includingthe messages remain the same.For example
27、in 4.3.2, an object that is the instance of a newly defined subclass could replace an instanceof an existing subclass.4.3.4 ReusabilityIn the past libraries of subroutines have been available to software developers to handle standard tasks.Object-oriented systems provide scope for reuse on a wider s
28、cale.It has been found that the amount of code needed for a new application could be reduced by as much as5:1 through the reuse of existing object-oriented code.4.3.5 MaintainabilityIn an object-oriented system, data and procedures are treated together as part of one package: the object.If data is c
29、hanged all the procedures affected are easily identified and changed at the same time. Becausechange is limited to one area of the system, its impact is reduced.Maintenance accounts for anything up to 80 per cent of the total life-cycle cost of a software system. Anytechnique that attacks this overh
30、ead is of benefit. The object-oriented approach not only makes it easy tomaintain source code but also improves the reliability of the product.4.4 Limitations of object-oriented systemsThe limitations of present day object-oriented systems are largely due to problems of immaturity: limited availabil
31、ity across a range of standard platforms; the need for integration with existing systems and databases; lack of support for large-scale software development; object-oriented systems are limited in their scope by: lack of persistence of objects; the amount of memory available (real and virtual); inab
32、ility to share objects within a community of users; limited form of version control; no access to external data such as SQL database tables.5 Object-oriented databasesObject-oriented databases (OODB) are required to store objects and an object-oriented database managementsystem (OODBMS) designed for
33、 these databases could potentially solve all the problems identified above. Sothere is a considerable interest in object-oriented databases.5.1 Viable object-oriented database solutionsContributory factors to the upsurge in interest are listed in 5.1.1 to 5.1.4.5.1.1 Popularity of C+The gain in popu
34、larity of C+, a programming language from AT&T, has provided an increased interestin object-oriented programming languages. C+ is programming language C with object-orientedextensions added to it and which facilitates an object-oriented programming approach as a result.- 5 -C+ is significant for the
35、 fact that its object-oriented approach makes it possible to write re-usable code.Software development time can be reduced through this re-useability of code and considerable savings canresult.5.1.2 Looking for viable solutionsThe relational model of data is found lacking in support for features of
36、inheritance, deductions, andrecursions, but users want their applications to embody these features and are looking for viable solutions.5.1.3 Reduced costThe cost of hardware has been falling and the current generation of hardware provides the computingpower and amount of memory required by the obje
37、ct-oriented approach to databases in a cost effectiveway.Early research work in the object-oriented approach had been started in the sixties but was found to bevery expensive in terms of computing resources. Hardware technology was not advanced then andmemory was very expensive.Emergence of the rela
38、tional model of data with its formal algebra was seen as the ultimate in databasemodel and subsequently the object-oriented database work suffered a setback.5.1.4 Progress in design managementProgress in computer aided design (CAD), and design management has also provided an impetus for thework on o
39、bject-oriented databases especially if the large number of versions and generations that arecreated during the development process need to be controlled, managed and maintained.5.2 Problems and issues to be resolvedThe object-oriented system discussed above have tended to be software systems. Databa
40、ses differ verysignificantly from system software.A database comprises data records which persist a long time after the process that created them hasdisappeared. Databases also require consistency of data and ability to recover to a known consistent stateafter failure. The user application view of t
41、he logical database needs to be made effectively independent ofthe physical database implementation. Databases need to be available concurrently to a number of users.Other data models already have a large user base and any new data model such as the object-orienteddatabase needs to co-exist with the
42、 previous models.Database vendors are taking up these problems and are beginning to advance solutions to some of them.As the object-oriented technology has not matured yet, a number of issues need to be satisfactorily resolvedbefore a truly object-oriented database system can be developed. Some of t
43、hese controversial issues are listedin 5.2.1 to 5.2.5.5.2.1 Data type or data class.Data types define structure of the data, such as whether it is a string of characters or a number. They areused as constructors of more complicated data types in programming languages. Details of data typedefinition
44、may be used anywhere in the program. Data types do not provide any organisation ofprocedures.Classes define the structure as well as the behaviour of their instances. Methods that implement behaviourare intimately bound to the class. The details of structure definitions are restricted to those metho
45、ds thatbelong to the class. In addition, the class provides a mechanism to organise or group those methods whichare common to a class.Programmers (the C+ user community) favour the data type approach since data types can be validated atcompile-time, while database designers (the SMALLTALK-80 user co
46、mmunity) prefer data class as it ismore of a run-time notion. This give rise to the problem that these two approaches are incompatible.- 6 -5.2.2 Persistence of dataIn order for data to be available for the user after the execution time, data needs to survive the executionof a process in a database
47、application.When a program is executed processes within the program create data which will be destroyed oncompletion of the process. In a database it is often a requirement that the data persists (is captured) oncompletion of the process.In an object-oriented system, an object is treated as a black
48、box, the contents (including data) invisibleand not directly accessible. Ensuring relevant data persist after the process that created it has beendestroyed, therefore poses a challenge. Not only objects have to be stored, but a “garbage collectionfunction“ needs to be devised to purge the object sto
49、re of inaccessible (redundant) objects5.2.3 Database management systems and data retrievalA database management function helps to decouple the application logic (users view) from the physicalimplementation (disk storage, memory) of the database in a given system.However managing large databases involves the use of mechanisms such as index management, dataclustering, data buffering and so on to improve data retrieval time.Using these mechanism locks the application logic into the physical implementation making it difficult toupgrade or modify applications at a later date.Wit