KR0127101B1 - Object-oriented database system - Google Patents

Object-oriented database system

Info

Publication number
KR0127101B1
KR0127101B1 KR1019940010450A KR19940010450A KR0127101B1 KR 0127101 B1 KR0127101 B1 KR 0127101B1 KR 1019940010450 A KR1019940010450 A KR 1019940010450A KR 19940010450 A KR19940010450 A KR 19940010450A KR 0127101 B1 KR0127101 B1 KR 0127101B1
Authority
KR
South Korea
Prior art keywords
persistence
type
class
objects
database
Prior art date
Application number
KR1019940010450A
Other languages
Korean (ko)
Other versions
KR950033918A (en
Inventor
황규영
박종목
조완섭
Original Assignee
천성순
한국과학기술원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 천성순, 한국과학기술원 filed Critical 천성순
Priority to KR1019940010450A priority Critical patent/KR0127101B1/en
Publication of KR950033918A publication Critical patent/KR950033918A/en
Application granted granted Critical
Publication of KR0127101B1 publication Critical patent/KR0127101B1/en

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99941Database schema or data structure
    • Y10S707/99944Object-oriented database structure

Abstract

A method for providing an object with persistence in the object-oriented data base system is provided in which a forced inheritance scheme is used to provide an object-oriented language such as C++ with independent persistence together with portability. The method adds forcedly attributes necessary for persisting the object in front of the object, objects other than the class type are capable of inheriting the attributes from the imaginary root class. Thereby permitting the independent persistence to the object without lost of portability, for there is no alteration of the object-oriented language.

Description

객체 지향 데이타베이스 시스템에서 객체에 지속성을 제공하는 방법How to Provide Persistence to Objects in Object-Oriented Database Systems

제 1 도는 본 발명의 강제 계승 방법이 구현되는 시스템 구성을 개략적으로 도시한 도면.1 is a diagram schematically illustrating a system configuration in which a forced inheritance method of the present invention is implemented.

제 2 도는 강제 계승 방법을 구현하는 본 발명의 설시예에 따른 단계들을 플로우챠트로 도시한 도면.2 is a flowchart illustrating steps according to an exemplary embodiment of the present invention for implementing a forced inheritance method.

제 3 도는 헤더가 첨가된 객체의 구조를 도시한 도면.3 is a diagram showing the structure of an object to which a header is added.

제 4 도는 헤더가 첨가된 배열 객체의 구조를 도시한 도면.4 is a diagram showing the structure of an array object with a header added thereto;

* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings

10 : 컴퓨터 15 : CPU10: Computer 15: CPU

20 : 메모리 5 : 응용 프로그램 상주 영역20: Memory 5: Application Resident Area

30 : 객체 지향 데이타베이스 시스템 상주 영역30: object-oriented database system resident area

35 : 디스크(데이타베이스)35: disk (database)

본 발명은 객체 지향 언어(Object-Oriented Language)와 데이타베이스 기능을 결합한 객체 지향 데이타베이스 시스템(L0DBNlS : Object-Oriented Database System)예 관한 것으로, 특히 객체 지향 언어로서 현재 널리 사용되고 있는 C++ 언어에 지속성(persistence)를 제공하기 위한 강세 계승(forced inheitance)방법에 관한 것이다.The present invention relates to an object-oriented database system (L0DBNlS), which combines object-oriented language and database functions. In particular, the present invention relates to persistent C ++ languages that are widely used as object-oriented languages. It is about a method of forced inheitance to provide persistence.

객체 지향 데이타베이스 시스템에 관한 연구는 서로 다른 2개의 연구 분야에서 발전되어 있다. 하나는 데이타베이스 분야이고 또 다른 하나는 프로그래밍 언어 분야이다. 데이타베이스 분야에서는 전통적으로 지속성, 공유, 트랜젝션, 권한(authorization) 등의 데이타베이스 기능(database support)을 지원하기 위한 연구가 성공적으로 진행되dj 왔다. 반면에, 전통적인 데이타베이스 시스템들은 데이타 모델의 취약성, 데이타베이스 언어와 호스트 언어 결합의 부자연성 등의 단점들을 지니고 있다.Research on object-oriented database systems has evolved in two different areas of research. One is in the database field and the other in the programming language field. In the database field, research has been successfully conducted to support database support such as persistence, sharing, transaction, and authorization. Traditional database systems, on the other hand, have drawbacks such as weaknesses in the data model and the unnaturalness of the database language and host language combinations.

한편, 프로그래밍 언어 분야에서는 Smalltalk. C++,Objective-C 등의 객체 지향 언어에서 속성 계승(inhehtance). 데이타 추상화(data abstraction). 다형 성(polymorphism)등 의미가 풍부한 데이타 모델을 갖도록 하는 연구가 성공적으로 진행되어 왔다. 이러한 연구의 결과는 전통적인 데이타베이스 시스템의 단점들을 보완하는데 사용될 수 있다. 반면, 객체 지향 언어에서는 데이타베이스 기능이 없는데 이러한 점은 바로 전통적인 데이타베이스 시스템 연구에서 보완할 수 있는 사항이다.On the other hand, Smalltalk. Property inheritance in object-oriented languages such as C ++ and Objective-C. Data abstraction. Research into having a meaningful data model such as polymorphism has been successfully conducted. The results of this study can be used to compensate for the shortcomings of traditional database systems. Object-oriented languages, on the other hand, do not have database capabilities, which is a complement to traditional database system research.

객체 지향 데이타베이스 시스템에 관한 연구에서는 바로 이들 두 분야에서 발전되어온 객체 지향 언어와 데이타베이스 기능을 결합하여 이들의 상호 보완적인 장점들을 모두 갖는 통일된 데이타베이스 시스템을 구축하는 것을 목표로 하고 있다. 따라서, 현재 개발된 많은 객체 지향 데이타베이스 시스템들은 기존의 객체 지향 언어와 데이타베이스 기능을 결합한 형태를 갖는다. 이러한 시스템의 예로는 GemStone, ODE, ObjectStore, VERSANT, ONTOS, Objectivity/DB 등이 있다. GemStone은 Smalltalk 언어와 데이타베이스 기능을 결합한 시스템이며, ODE, ObjectStone, VERSANT, ONTOS, 및 Objectivity/DB는 C+ + 언어와 데이타베이스 기능을 결합한 시스템들이다.The research on object-oriented database systems aims to build a unified database system that combines the object-oriented languages and database functions that have been developed in these two fields with all of their complementary advantages. Therefore, many object-oriented database systems that are currently developed have the form of combining existing object-oriented languages and database functions. Examples of such systems are GemStone, ODE, ObjectStore, VERSANT, ONTOS, and Objectivity / DB. GemStone combines the Smalltalk language and database functionality, while ODE, ObjectStone, VERSANT, ONTOS, and Objectivity / DB combine the C ++ language and database capabilities.

이러한 객체 지향 데이타배이스 시스템에서 주로 사용된 C++는 본래 C언어가 갖던 타입(type)인 int, char, float 등의 기본 타입(fundamental type)과 배열(array), 포인터(pointer), 구조체(struct), 공용체(union) 등의 유도 타입(derived type)에 클래스(class)라는 새로운 타입이 추가된 타입 체계를 갖는다. 클래스는 다른 타입들과 달리 클래스의 한 인스턴스(instance)로 정의되는 객체의 속성(attribute)(또는 멤버변수)뿐 아니라 객체를 참조하여 연산을 수행하는 함수(멤버 함수)를 함께 가질 수 있으며, 이미 정의된 클래스로부터 속성들을 계승할 수 있다. 일반적인 프로그램 언어와 마찬가지로 C++ 언어도 프로그램 실행중에 생성된 객체들은 프로그램 종료후에는 그 기억 공간이 해체되어 객체가 지속되지 않게 된다. 그러나, 객체 지향 데이타베이스 시스템에서는 객체지향 언어로 작성된 프로그램의 실행 중 또는 실행이 종료된 후에 데이타베이스 시스템이 객체를 데이타베이스에 자동적으로 저장시킴으로써 프로그램 종료 후에도 객체가 지속되도록 하는 기능이 요구된다.C ++, which is mainly used in the object-oriented data base system, has fundamental types such as int, char, and float, arrays, pointers, and structs. It has a type system in which a new type called class is added to a derived type such as a union. Unlike other types, a class can have not only attributes (or member variables) of objects defined as an instance of the class, but also functions (member functions) that perform operations on objects. You can inherit attributes from the defined class. Like the general programming language, the C ++ language creates objects that are created while the program is running. After the program ends, the storage space is dismantled and the objects do not persist. However, in an object-oriented database system, a function of allowing an object to persist even after the end of a program by automatically storing the object in a database during or after execution of a program written in an object-oriented language is finished.

언어에 지속성을 주는 방법은 다음과 같은 요구 사항들을 만족시켜야 한다. 첫째, 독립적 지속성(independent persistence 또는 orthogonal persistence)을 제공해야 한다. 독립적 지속성은 타입에 관계없이 모든 객체가 지속될 수 있는 성질로 정의된다. 독립적 지속성이 없는 언어에서는 객체가 지속될 수 있는 타입(지속성 타입)과 지속될 수 없는 타입(휘발성 타입)이 존재하게 되는데, 프로그래머가 휘발성 타입의 객체를 지속시키고자 할 때마다 그 객체를 지속성 타입의 객체로 흉내내야(simulate)하므로 프로그래밍 오버헤드가 수반된다는 단점이 있다. 따라서, 독립적 지속성은 지속성 언어가 가져야 할 중요한 성질이다.A method of giving persistence to a language must meet the following requirements. First, you must provide independent persistence or orthogonal persistence. Independent persistence is defined by the nature that all objects can be persisted, regardless of type. In languages with no independent persistence, there are types that can be persisted (persistent types) and types that cannot be persisted (volatile types). Whenever a programmer wants to persist an object of volatile type, the object is persisted. The drawback is that it involves programming overhead as it simulates. Thus, independent persistence is an important property that persistent language must have.

둘째, 이식성(portablity)이 있어야 한다. 여기에는 두가지 측면에서의 이식성이 있을 수 있다. 하나는 시스템의 이식성으로서 지속성을 제공하는 시스템이 특정한 하드웨어나 운영체제에 의존하지 않아야 한다는 것이다. 다른 하나는 프로그램의 이식성으로서 지속성 언어로 작성된 프로그램들이 특성 컴파일러에 의존하지 않아야 한다는 것이다.Second, there must be portablity. There may be portability in two aspects. One is that a system that provides persistence as a system's portability should not depend on specific hardware or operating systems. The other is that the portability of programs is that programs written in persistent languages should not rely on specific compilers.

현재 C++와 데이타베이스 기능을 결합하는 방법은 크게 두가지로 분류된다. 하나는 클래스 라이브러리 바인딩(Class Library Binding)이며, 다른 하나는 DML 바인딩(Data Manipulation Language Bibding)으로서 이들 각각은 서로 다른 방법으로 C++에 지속성을 첨가한다. 클래스 라이브러리 바인딩은 C++로 정의된 클래스와 함수들을 포함하는 실행 라이브러리(run-time library)를 통하여 데이타베이스 기능을 사용하도록 하는 방법이다. VERSANT, ONTOS, ObjectStore의 클래스 라이브러리 바인딩 버젼 Objectivity/DB가 클래스 라이브러리 바인딩을 사용하는 시스템의 예이다. 반면, DML 바인딩은 C++의 문법(syntax) 자체를 확장한 고유의 proprietary 언어를 통하여 데이타베이스 기능을 사용하도록 하는 방법이다. 여기서는 응용 프로그램들이 확장된 언어로 작성되며 고유의 컴파일러에 의해서 컴파일된다. ODE와 ObjectStore의 DML 바인딩 버전이 DML 바인딩을 사용하는 시스템의 예이다.Currently, there are two main ways to combine C ++ with database functionality. One is the Class Library Binding, and the other is the Data Manipulation Language Bibding, each of which adds persistence to C ++ in different ways. Class library binding is a way to use database functionality through a run-time library that contains classes and functions defined in C ++. Class library binding versions of VERSANT, ONTOS, and ObjectStore Objectivity / DB is an example of a system that uses class library bindings. DML binding, on the other hand, is a way to use database functionality through a proprietary language that extends the syntax of C ++ itself. Here, applications are written in an extended language and compiled by their own compilers. The DML binding versions of ODE and ObjectStore are examples of systems that use DML binding.

현재, 클래스 라이브러리 바인딩에서는 대부분 C++의 클래스 속성 계승 기능을 이용한다. 즉, 지속성을 갖는 클래스를 루트 클래스(root class)로 정의하고 그 서브클래스(subclass)들의 객체들에 한하여 지속성을 제공한다. 예를들면, VERSANT는 'PObject, ONTOS는 Object라는 지속성 루트 클래스를 가진다. 이와같이 클래스 라이브러리 바인딩에 속하면서 루트 클래스를 이용하는 방법을 애트우드(Atwood)는 가상 베이스 클래스에 의한 지속성(Persistence from a Virtual Base C1ass(PfVBC)) 제공 방법이라 정의하였다. 여기서는 이를 간단히 베이스클래스(Base Class) 방법이라고 칭한다.Currently, most class library bindings take advantage of C ++ 's inheritance of class attributes. In other words, you define a persistent class as the root class and provide persistence only for objects of its subclasses. For example, VERSANT has a persistent root class called 'PObject, and ONTOS is Object. Atwood defined the method of using the root class while belonging to the class library binding as a method of providing persistence from a Virtual Base C1ass (PfVBC). This is referred to simply as the Base Class method.

일반적으로 언어에 지속성을 주기 위해서는 임의의 지속성 타입의 객체를 실행 시간에 데이타베이스에 저장하는 포괄적인 함수(genehc function)가 존재해야 한다. 이것이 없으면 프로그래머가 각 타입마다 그 객체를 저장하기 위한 코드를 작성해야 하기 때문이다. 이러한 함수를 지속용 함수(persistence function)라 정의한다. 또한, 지속용 함수에 각각의 객체를 저장하기 위한 정보가 실행 시간에 제공되어야 한다. 이러한 정보에는 타입에 관한 정보와 크기에 관한 정보가 포함된다. 타입에 관한 정보는 객체가 저장된 후 다시 사용될 때 올바른 타입의 객체로 사용될 수 있도록 하기 위해서 필요하다. 크기에 관한 정보는 객체를 저장하기 위한 기억 공간을 할당하기 위해서 사용된다.In general, to give a language persistence, there must be a generic function that stores objects of any persistence type in the database at runtime. Without this, the programmer would have to write code to store the object for each type. This function is defined as a persistence function. In addition, information for storing each object in the persistence function must be provided at run time. This information includes type information and size information. Information about types is needed so that objects can be used as objects of the correct type when they are saved and used again. Information about the size is used to allocate storage space for storing objects.

C++에 지속성을 주려면 실행 시간에 이러한 정보를 객체마다 유지하도록 해야 한다. C++ 컴파일러는 프로그램에서 사용한 객체들에 관한 정보를 컴파일 시간에만 보존하며 실행 시간에는 제한적으로만 제공한다. 즉, 타입에 관한 정보는 실행시간에 유효하지 않고 객체의 크기에 관한 정보는 프로그램에 객체를 형성할 때 호출되는 함수인 new 연산자 함수(operator function)에게 매체 변수(parameter)로 넘겨질 뿐 별도로 유지되지 않는다. 객체마다 이러한 정보가 실행시간에 제공되도록 하는 방법은 각 객체가 이들을 저장하기 위한 속성들을 별도로 지니게 하는 것이다. 이러한 속성들을 지속용 속성들(persistence attributes)이라 정의한다. 요약하면, C++에 지속성을 주기 위한 방법은 지속시키고자 하는 모든 객체가 지속용 속성들을 지나도록 하고 지속용 함수가 이들을 참조하도록 하는 것이다.To give persistence to C ++, you need to keep this information per object at run time. The C ++ compiler preserves information about objects used in a program only at compile time and provides a limited amount at run time. That is, type information is not valid at run time and information about the size of an object is passed as a media parameter to the new operator function, a function that is called when the object is formed in the program. It doesn't work. One way to ensure that this information is provided at run time for each object is to have each object have separate properties for storing them. These attributes are defined as persistence attributes. In summary, the way to give persistence to C ++ is to make sure that all objects you want to persist are passed through persistence properties, and that the persistence function references them.

베이스 클래스 방법은 C++의 클래스 속성 계승 기능을 사용하여 객체들이 지속용 속성들을 지니도록 한다. 즉, 지속용 속성들을 루트 클래스의 속성(멤버 변수)들로 정의하여 지속성 클래스가 이들을 계승함으로써 그 객체가 이들을 실행시간에 유지하도록 한다. 마찬가지로, 지속성 함수를 루트 클래스의 멤버 함수로 정의하여 지속성 클래스가 이것을 계승함으로써 객체 내에 존재하는 지속용 속성들을 참조할 수 있도록하는 것이다.The base class method uses C ++ 's class attribute inheritance feature to allow objects to have persistent attributes. That is, you define persistent attributes as attributes of the root class (member variables) so that the persistence class inherits them so that the object maintains them at run time. Similarly, you define a persistence function as a member function of the root class so that the persistence class can inherit it and refer to the persistence properties that exist in the object.

베이스 클래스 방법은 C++를 확장하지 않기 때문에 응용 프로그램들이 일반 C++ 언어를 그대로 사용하므로 특정 컴파일러에 의존하지 않게 되어 이식성이 높으나, 독립적 지속성을 부여하지 못한다. 즉, 클래스의 객체만 지속성을 계승하므로 속성 계승을 못하는 기본 타입이나 배열 타입의 객체들은 지속될 수 없다. 이러한 타입의 객체가 지속되는 것과 같은 효과를 얻으려면 프로그래머는 휘발성 타입을 흉내내는 지속성 클래스를 정의하여야 한다. 이하에 Element란 클래스의 배열을 흉내내는 지속성 클래스인 Element Array를 정의한 예를 나타낸다. 여기서 pObject는 지속성 루트 클래스라고 가정한다.Since the base class method does not extend C ++, applications use the normal C ++ language as it is, so they are not dependent on a specific compiler and are portable, but do not provide independent persistence. That is, only objects of class inherit the persistence, so objects of basic or array type that cannot inherit properties cannot be persisted. To have the same effect as persisting this type of object, the programmer must define a persistence class that mimics a volatile type. Element below shows an example of defining an element array that is a persistent class that mimics an array of classes. Here pObject is assumed to be a persistent root class.

1 : ch1ss ElementArray : public pObject1: ch1ss ElementArray: public pObject

2 : {2 : {

3 : int numelem:3: int numelem:

4 : public:4: public:

5 : Element e[1]:5: Element e [1]:

6 : ElementArray(int num) {6: ElementArray (int num) {

7 : Allocate variable sized storage to hole 'num' elements;7: Allocate variable sized storage to hole 'num' elements;

8 : for(int i=o; i〈num; i++) construct e[i];8: for (int i = o; i <num; i ++) construct e [i];

9 : numelem=num,;9: numelem = num ,;

10 : }10:}

1l : ∼ElementArray() {1l:-ElementArray () {

12 : for(int i=0; inumelem; i+ +) destruct e[i];12: for (int i = 0; inumelem; i + +) destruct e [i];

13 : }13:}

14 : }14:}

여기서 프로그래머는 다음과 같은 작업을 해야 한다. 첫째, 제 1 행에서 ElementArray를 pObject의 서브클래스로 선언한다. 이렇게 함으로써 이 클래스가 지속성을 가질 수 있게 된다. 둘째, 배열의 요소들을 저장할 변수를 선언한다. C++에서는 가변 길이 배열의 선언을 허용하지 않으므로, 배열의 크기를 1로 정하여(제 5 행의 e[1]) 컴파일 시간에는 고정 길이 변수로 보이게 하고 실행 시간에 가변 길이로 사용하도록 한다. C++에서는 배열을 사용할 때 배열의 영역을 실행시간에 검사하지 않으므로 이런 방법이 가능하다. 세째, 객체의 기억 공간을 크기에 맞게 할당하고 배열의 요소들에 대해서 생성자를 부르는 생성자(제6행부터 제10행까지)를 구현해야 한다. 이것을 구현하지 않으면 ElementArray 클래스의 객체를 생성할 때 객체의 기억 공간이 항상 고정된 크기로 할당되며, 실제로 클레스에 선언되지 않은 두번째 요소(e[2])나 세번째 요소(e[3])등에 대해서는 생성자가 불려지지 않게 되어 가변 길이를 갖는 배열을 흉내낼 수 없게 된다.Here the programmer must do the following: First, line 1 declares ElementArray as a subclass of pObject. This allows this class to be persistent. Second, declare a variable to store the elements of the array. Since C ++ does not allow the declaration of variable length arrays, set the size of the array to 1 (e [1] on line 5) to make it appear to be a fixed length variable at compile time and to use it as a variable length at run time. This is possible because C ++ doesn't check the area of an array at run time when you use it. Third, you must implement a constructor (lines 6 through 10) that allocates the object's storage space to fit the size and calls the constructor for the elements of the array. If you don't implement this, when you create an object of the ElementArray class, the object's storage is always allocated with a fixed size. For the second element (e [2]) or the third element (e [3]) that are not actually declared in the class, The constructor will not be called and you will not be able to simulate an array of variable length.

네째, 객체가 소멸될 때 배열의 요소들을 소멸시키는 소멸자(제 11 행 부터 제 13 행까지)와 요소의 갯수를 나타내는 변수(제 3 행의 numelem)를 정의해야 한다. 소멸자에서는 요소의 갯수를 검사하여 그 갯수만큼의 객체들을 소멸시켜야 한다. 이것들을 정의하지 않으면 앞에서와 마찬가지로 클래스에 선언되지 않은 요소들에 대해서는 소멸자로 불려지지 않는다.Fourth, we need to define a destructor that destroys the elements of the array when the object is destroyed (lines 11 through 13) and a variable that represents the number of elements (numelem in line 3). The destructor must check the number of elements and destroy that many objects. If you don't define them, you won't be called a destructor for elements that aren't declared in the class as before.

상기한 바와 같이 프로그래머가 휘발성 타입을 지속성 클래스로 흉내낼 때에는 해야 할 작업이 많고 복잡하다. 또한, 휘발성 타입이 여러개 존재하면 프로그래머는 각 타입 마다 이를 흉내내는 지속성 클래스를 구현해야 하므로 오류가 발생될 여지가 많고 프로그래밍 오버헤드가 초래된다.As mentioned above, when a programmer simulates a volatile type as a persistent class, there is a lot of work and complexity to do. In addition, if there are multiple volatile types, the programmer must implement a persistence class that mimics each type, resulting in a lot of error and programming overhead.

뿐만 아니라, ElementArray 클래스의 배열 요소들을 참조하는데 성능 저하가 일어난다. 배열 요소를 참조하려면 배열에 대한 인덱싱을 해야하는데, C++에서는 배열에 대한 인덱싱을 배열의 첫 요소에 대한 포인터를 사용해야 만 할 수 있다. 그런데, ElementArray 클래스의 객체에 대한 포인터는 배열의 첫 요소인 e[0]를 가리키지 않고 수퍼클래스(super class)인 pObject 클래스의 첫 요소를 가리키므로, 포인터가 이를 가리키도록 할때 e[0]란 멤버가 위치한 오프셋(offset)만큼의 덧셈으로 인한 성능 저하가 초래된다.In addition, there is a performance penalty in referencing array elements of the ElementArray class. To reference an array element, you must index the array. In C ++, indexing an array may require using a pointer to the first element of the array. However, the pointer to the object of the ElementArray class does not point to the first element of the array, e [0], but rather to the first element of the superclass pObject class. 0] adds as much as the offset where the member is located.

베이스 크래스 방법 외에도, ObjectStore의 클래스 라이브러리 바인딩 버젼은 CPU와 운영체제의 가상메모리(virttlal memory) 기능을 사용하여 지속성을 제공한다. ObjectStore는 운영체제의 기능을 이용하여 CPU의 가상 메모리 매핑 테이블을 조정함으로써 데이타베이스가 차지하는 디스크 공간을 프로그램에서 사용하는 가상 메모리 공간의 일부로 간주하도록 한다. 따라서, 메모리에 존재하는 페이지 내의 객체들이메모리 형태 그대로 저장되고 읽혀진다. 그러나, 이 방법은 하드웨어나 운영체제의 기능에 의존하므로 이식성을 잃는다는 단점을 가지고 있다.In addition to the base class method, the object library binding version of the ObjectStore provides persistence using the virtual memory capabilities of the CPU and operating system. The ObjectStore uses the capabilities of the operating system to adjust the CPU's virtual memory mapping table so that the disk space occupied by the database is considered part of the virtual memory space used by the program. Thus, objects in pages that exist in memory are stored and read in memory. However, this method has the disadvantage of losing portability since it depends on the hardware or the function of the operating system.

다음으로, DML 바인딩에서는 C의 문법에 새로운 키워드를 추가하여 이 키워드를 사용하면 객체가 타입에 관계없이 데이타베이스에 저장된다는 의미를 갖도록 한다. 예를 들면, ObjectStore의 DML 바인딩 버젼의 OQL 언어는 C++의 기억 장소의 종류(strage class)를 지정하는 auto, static, register 등에 상당하는 persistent란 새로운 키워드를 추가한 문법을 가지며, 이 키워드를 사용하여 정의된 변수의 값은그 타입에 관계없이 데이타베이스에 저장된다. 또한, ATT의 O++ 언어는 C++의 객체 생성을 위한 new 연산자에 상당하는 pnew라는 새로운 키워드를 가지며, 이 키워드를 사용하여 생성된 객체는 그타입에 관계없이 데이타베이스에 저장된다.Next, the DML binding adds a new keyword to C's syntax, which means that an object is stored in the database regardless of its type. For example, the OML language of the DML-bound version of the ObjectStore has a syntax that adds a new keyword, persistent, corresponding to auto, static, register, etc., which specifies the kind of storage class in C ++. The value of a defined variable is stored in the database regardless of its type. Also, ATT's O ++ language has a new keyword pnew, which is equivalent to the new operator for creating objects in C ++. Objects created using this keyword are stored in the database regardless of their type.

DML 바인딩 방법은 객체들의 타입에 관계없이 지속성을 주므로 독립적 지속성을 보장하나, C++ 언어 자체를 확장하므로 응용 프로그램들이 고유의 컴파일러에 의존하게 되어 이식성이 낮아진다. 또한, 이러한 프로그램들은 새로운 버젼의 C++ 컴파일러가 공개되더라도 그 기능을 사용하지 못하게 되므로 C++컴파일러가 업그레이드됨에 따라 컴파일러를 변경해야 하는 번거로움이 있다.The DML binding method guarantees independent persistence by providing persistence regardless of the type of objects, but extends the C ++ language itself, making applications dependent on their own compilers, making them less portable. In addition, these programs will not be able to use their functions even if a new version of the C ++ compiler is released, which is a hassle to change the compiler as the C ++ compiler is upgraded.

본 발명은 객체 지향 언어와 데이타베이스 기능을 결합한 데이타베이스 시스템에서 객체 지향 언어에 지속성을 부여하기 위한 상기한 방법들의 단점들을 해소하기 위하여 객체 지향 언어, 특히 C++에 독립적 지속성을 부여하는 강제 계승(forced inheritance)이라는 새로운 방법을 제공하는 것을 목적으로 한다.The present invention provides a forced inheritance for granting object persistence to an object-oriented language, in particular C ++, to overcome the shortcomings of the above methods for imparting persistence to an object-oriented language in a database system combining object-oriented language and database functionality. It aims to provide a new way of inheritance.

본 발명에서는 객체가 지속되기 위한 속성들을 포함하는 헤더를 객체에 장제로 첨가함으로써 클래스가 아닌 타입의 객체도 이러한 속성을 가상의 지속성 루트 클래스로부터 계승하는 것과 같은 효과를 갖도록 한다.In the present invention, by adding a header containing an attribute for persisting an object to the object, an object of a type other than a class has an effect such as inheriting such an attribute from a virtual persistent root class.

이하, 첨부 도면을 참조하여 본 발명을 상세히 설명하기로 한다.Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.

제 1 도는 본 발명의 강제 계승 방법이 구현되는 시스템 구성을 개략적으로 도시하고 있다.1 schematically illustrates a system configuration in which a forced inheritance method of the present invention is implemented.

제 2 도에는 본 발명의 방법에 따라 구현된 객체 지향 데이타베이스 시스템(30)의 한 실시예에서 응용 프로그램(25)의 수행중에 생성된 객체들을 강제 계승을 이용하여 지속시키는 단계들이 도시되어 있다. 제 2 도를 참조하여 그 수순을 상세히 설명하면 다음과 같다.2 shows the steps of persisting objects created during execution of the application 25 using forced inheritance in one embodiment of the object oriented database system 30 implemented in accordance with the method of the present invention. The procedure is described in detail with reference to FIG. 2 as follows.

우선, 응용 프로그램(25)이 개시되면 단계(100)에서 데이타베이스 열기를 객체 지향 데이타베이스 시스템(30)에 요청한 후 단계(110)에서 프로그램이 수행된다. 응용 프로그램(25)의 수행중에 단계(120)에서 객체의 생성 요구가 있을 경우, 이것이 지속성 객체의 생성 요구이면 객체 지향 데이타베이스 시스템은 단계(140,150,160)에 따라 강제 계승을 반은 객체를 생성시키고 그 객체에 대한 포인터를 반환한다. 반면, 이것이 일반 C++ 객체의 생성 요구이면 단케(170)에 따라 객체 지향 데이타베이스 시스템은 일반 C++ 객체를 생성시키고 그 객체에 대한 포인터 값을 반환한다. 상기 단계(120)에서 객체 생성 요구가 없을 경우는 단계(80)으로 진행한다.First, when the application program 25 is started, it requests the object-oriented database system 30 to open the database in step 100 and then the program is executed in step 110. If there is a request to create an object in step 120 while the application 25 is running, if it is a request to create a persistent object, then the object-oriented database system creates an object that is half the forced inheritance according to steps 140, 150, and 160; Returns a pointer to the object. On the other hand, if this is a request for creation of a generic C ++ object, then according to Danke 170, the object oriented database system creates a generic C ++ object and returns a pointer value to that object. If there is no object creation request in step 120, the process proceeds to step 80.

본 발명의 강제 계승이 구현되는 단계들인 단계(140,150,160)에 대하여 더욱 상세하게 설명하면, 먼저 단계(140)에서 객체와 객체가 지속되기 위해 필요한 속성들을 포함하는 헤더의 크기를 합한 만큼의 기억 공간을 메모리(20)에 할당한다. 제 3 도는 헤더가 첨가된 객체의 형태를 보여주며 빗금친 부분이 헤더를 나타낸다. 제 3 도에서 나타낸 바와 같이, 헤더는 객체의 식별자(ID:Object Identifier), 객체의 크기 정보 및 타입에 관한 정보를 포함할 수 있다. 객체의 식별자는 객체가 저장되어 있는 데이타베이스(35) 내의 기억 공간을 갖기 위한 인덱스로 사용되며, 객체의 크기와 타입은 객체를 컴퓨터(10)내의 기억 공간 즉, 메모리로 읽어들이거나 데이타베이스(35)에 저장할 때 사용된다. 다음, 단계(150)에서 객체의 헤더 객체가 지속되기 위한 정보를 기록하여 후에 객체가 저장될 수 있도록 하고, 단계(160)에서 제 3 도에서와 같이 포인티가 가리키는 주소가 객체가 위치한 곳이 되도록 고정하고 그 값을 반환한다. 그러면, 응용 프로그램(25)에서는 객체에 대한 연산을 수앵할 때 일반 C++ 객체에 하는 것과 동일하게 할 수 있다.In more detail with respect to the steps 140, 150 and 160, which are the steps in which the forced inheritance of the present invention is implemented, first, in step 140, as much storage space as the sum of the size of the header including the object and the attributes necessary for the object to persist, It allocates to the memory 20. 3 shows the shape of the object to which the header is added, and the hatched portion represents the header. As shown in FIG. 3, the header may include an object identifier (ID), information about the size and type of the object. The identifier of the object is used as an index to have a storage space in the database 35 in which the object is stored, and the size and type of the object read the object into a storage space in the computer 10, that is, a memory, or a database ( 35) is used for storage. Next, in step 150, the header object of the object is recorded so that the object can be stored later. In step 160, as shown in FIG. Fix it as much as possible and return its value. The application 25 can then do the same as it would for a normal C ++ object when accepting an operation on an object.

다음으로, 응용 프로그램(25)이 종료하기 전에 단계(180)에서 데이타베이스 닫기 요구를 할 경우 단계(190)으로 진행하여 객체 지향 데이타베이스 시스템은 지속성 객체들의 헤더에 기록된 정보를 참조하여 데이타베이스(35) 내의 기억 공간에 객체들을 저장한다. 데이타베이스 닫기 요구가 없는 경우는 단계(110)으로 복귀하여 계속 응용 프로그램(25)을 수행하게 된다.Next, if the request for closing the database is made in step 180 before the application 25 terminates, the process proceeds to step 190 where the object-oriented database system references the information recorded in the headers of the persistent objects. The objects are stored in the storage space in (35). If there is no database close request, the process returns to step 110 to continue executing the application program 25.

응용 프로그램에서는 다음의 연산을 사용하여 객체 지향 데이타베이스 시스템(30)에 지속성 객체의 생성을 요구한다.The application program requires the creation of persistent objects in the object-oriented database system 30 using the following operations.

DB_new(Type)DB_new (Type)

이 연산은 객체 지향 데이타베이스 시스템(30)이 제공하는 연산으로서 Type을 타입으로 갖는 객체를 헤더가 첨가된 형태로 생성하며, 일반 new 연산자와 마찬가지로 객체에 대한 메모리 주소를 반환한다. 실제로 이 연산은 아래와 같이 매크로로 정의되며 중복 정의된 new 연산자 함수를 부른다.This operation is provided by the object-oriented database system 30, and creates an object having a type as a type with a header, and returns a memory address of the object like the general new operator. In fact, this operation is defined by a macro as shown below and calls the newly defined new operator function.

#define DB_new(Type) new(ID(Type)) Type#define DB_new (Type) new (ID (Type)) Type

여기서, ID(Type)은 Type이란 타입 이름을 타입 번호로 반환하는 매크로이다.Here, ID (Type) is a macro that returns a type name as a type number.

중복 정의된 new 연산자 함수는 강제 계승을 구현하는 부분인 제 2 도의 단계(140,150,160)을 수행하며 예를 들어 아래와 같이 소스코드화된다.The newly defined new operator function performs steps 140, 150, and 160 of FIG. 2, which is a part of implementing forced inheritance. For example, the new operator function is source coded as follows.

1 : void operator new1: void operator new

2 : size-t size,2: size - t size,

3 : int type3: int type

4 : )4 : )

5 : {5: {

6 : OID id;6: OID id;

7 : OBJ-Header pHead;7: OBJ - Header pHead;

8 : pHead=Alloc(size+sizeof(OBJ-Header),id);8: pHead = Alloc (size + sizeof (OBJ Header), id);

9 : pHead-size=size;9: pHead-size = size;

10 : pHead-id=id;10: pHead-id = id;

11 : pHead-typeID=type;11: pHead-type ID = type;

12: return(void)(char)pHead+sizeof(OBJ-Header);12: return (void) (char) pHead + sizeof (OBJ - Header);

13 : }13:}

상기 소스 코드의 제 8 행에서는 객체와 객체의 헤더의 크기를 합한 만큼의 기억 공간을 메모리에 할당하고 객체의 식별자와 할당된 메모리에 대한 포인터를 반환받는다. 제 9 행 내지 제 11 행까지는 헤더의 속성에 객체가 지속되기 위한 정보를 기록한다. 또한, 제 12 행에서는 포인터가 객체를 가리키도록 조정하여 반환한다.In the eighth line of the source code, as much storage space as the sum of the sizes of the object and the header of the object is allocated to the memory and an identifier of the object and a pointer to the allocated memory are returned. In the ninth to the eleventh lines, information for persisting the object is recorded in the attribute of the header. In addition, in the twelfth line, the pointer is adjusted to return the object.

이와같이, 본 발명의 강제 계승 방법은 기존의 방법에 비하여 여러가지 장점을 갖는다. 첫째로, 독립적 지속성을 제공한다. 그 이유는 클래스의 객체 뿐 아니라 클래스가 아닌 타입의 객체에 대해서도 헤더를 첨가할 수 있고, 헤더는 항상 객체의 앞부분에 위치하므로 지속용 함수가 객체의 타입에 관계없이 헤디를 참조할 수 있기 때문이다. 따라서, 이 방법은 베이스 클래스 방법과 DML 바인딩 방법의 장점들을 모두 갖는다. 즉, 독립적 지속상으로 인하여 베이스 클래스 방법이 초래하던 프로그래밍 오버헤드를 제거해주며, DM'L 바인딩 방법에서와는 달리 언어를 확장하지 않기 때문에 이식성이 좋다.As such, the forced inheritance method of the present invention has various advantages over the conventional method. First, it provides independent persistence. This is because headers can be added not only to objects of the class but also to objects of non-class types, and because the headers are always located at the front of the object, so the persistence function can refer to the heady regardless of the object's type. . Thus, this method has the advantages of both the base class method and the DML binding method. This eliminates the programming overhead incurred by the base class method due to independent persistence, and is portable because it does not extend the language unlike the DM'L binding method.

다음으로, 프로그램 내에서 객체를 참조할 때 객체의 헤더가 위치한 주소를 사용하기 않고 제 3 도의 포인터가 가리키는 곳과 같이 객체 자신이 위치한 주소를 사용하도록 하므로 지속성을 C++에 투명하게(transparently) 줄 수 있다. 즉, 프로그래머들은 지속성 객체를 직접 가리키는 포인터로 객체를 참조하므로 객체가 지니는 헤더의 존재를 의식하지 않고 지속성 객체들을 C++ 객체들과 다름없이 다룰 수 있다.Next, when you refer to an object in your program, you do not use the address where the object's header is located, but instead use the address where the object is located, as the pointer in Figure 3 points to, so you can make persistence transparent to C ++. have. That is, programmers refer to objects with pointers that point directly to persistent objects, so they can handle persistent objects just like C ++ objects without being aware of the existence of headers.

또한, 배열 객체를 다룰 때 기억 공간의 낭비와 인덱싱 성능의 저하가 일어나지 않는다. 배열 객체를 위한 지속성 속성이 요소들의 수 만큼 중복되는 것이 아니라 제 4 도에서와 같이 전체 배열에 대해 앞부분에 하나만 존재하게 되므로 기억 공간을 절약하게 된다. 배열 객체에 대한 인덱싱을 할 경우, 베이스 클래스 방법에서와 달리 포인터가 배열의 첫 요소를 직접 가리키게 되므로 성능이 일반 C++ 배열에 대한 인덱싱을 할 때와 동일하게 된다.In addition, when dealing with array objects, there is no waste of storage space and deterioration of indexing performance. Persistence attributes for array objects are not duplicated by the number of elements, but only one at the beginning for the entire array, as shown in Figure 4, saving memory space. When indexing array objects, unlike the base class method, the pointer points directly to the first element of the array, so performance is the same as when indexing regular C ++ arrays.

본 명세서에서는 편의상 객체 지향 언어 중 C++를 예를 들어 설명하였으나, 본 발명은 본 발명의 사상 또는 본질적인 특징으로부터 크게 벗어나지 않는 범위내에서 본 기술 분야에 통상의 지식을 가진 자에 의해 그대로 또는 약간의 번경이 가해져 기타 특정 형태로 실시되거나 기타의 프로그램 언어에도 적용될수 있을 것이다. 따라서, 전술한 본 발명의 실시예는 모든 면에 있어서 예시적인 것이며 제한적으로 해석되어서는 아니되며, 발명의 범위는 전술한 설명보다는 첨부된 특허청구의 범위에 의해 정해전다.In the present specification, for convenience, C ++ is described as an example of an object-oriented language, but the present invention is provided by a person having ordinary skill in the art as is or without slight change without departing from the spirit or essential features of the present invention. It may be implemented in other specific forms or applied to other programming languages. Accordingly, the above-described embodiments of the present invention are illustrative in all respects and should not be construed as limiting, the scope of the invention being defined by the appended claims rather than the foregoing description.

Claims (4)

객체 지향 데이타베이스 시스템에서 객체 지향 언어에 의해 속성 계승을 하는 타입 또는 속성 계승을 하지 못하는 타입으로 정의되는 객체에 지속성을 제공하는 방법에 있어서, 상기 객체의 앞부분에 하나 또는 그 이상의 선정된 속성을 강제로 첨가함으로써 상기 속성 계승을 하지 못하는 타입의 객체도 속성을 강제로 계승하도록 하여 양자 타입의 객체 모두가 지속될 수 있도록 하는 것을 특징으로 하는 지속성 제공방법.A method for providing persistence for an object defined as a type that inherits attributes or a type that does not inherit attributes in an object-oriented database system, the method enforces one or more selected attributes at the beginning of the object. By adding to the object of the type that can not inherit the attribute to provide a persistence forcibly inherit the attribute so that both types of object can be persisted. 제 1 항에 있어서, 상기 속성은 객체의 식별자, 객체의 크기 및 타입 정보를 포함하는 것을 특징으로 하는 지속성 제공 방법.The method of claim 1, wherein the attribute includes an identifier of an object, size and type information of the object. 객체 지향 데이타베이스 시스템에서 객체 지향 언어에 의해 정의되는 타입의 객체에 지속성을 제공하는 방법에 있어서, 상기 객체 및 상기 객체가 지속되기 위해 필요한 속성들을 포함하는 헤더의 크기를 합한 만큼의 기억 공간의 메모리에 할당하는 단계와, 상기 객체의 헤더에 상기 객체가 지속되기 위한 상지속성 정보를 기록하는 단계, 및 상기 객체에 대한 포인터가 상기 객체가 위치한 주소를 가리키도록 조성하는 단계로 이루어져 상기 객체에 상기 속성을 강제로 계승시키는 것을 특징으로 하는 지속성 제공 방법.A method of providing persistence for an object of a type defined by an object-oriented language in an object-oriented database system, the method comprising: a memory of storage space equal to the size of the object and a header including attributes required for the object to be persisted Assigning to the object, recording upper persistence information for persisting the object in the header of the object, and arranging a pointer to the object to point to an address where the object is located. A method of providing persistence characterized by forcibly inheriting an attribute. 제 3 항에 있어서, 상기 속성은 객체의 식별자, 객체의 크기 및 타입 정보를 포함하는 것을 특징으로 하는 지속성 제공 방법.4. The method of claim 3, wherein the attribute includes an identifier of the object, size and type information of the object.
KR1019940010450A 1994-05-13 1994-05-13 Object-oriented database system KR0127101B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019940010450A KR0127101B1 (en) 1994-05-13 1994-05-13 Object-oriented database system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019940010450A KR0127101B1 (en) 1994-05-13 1994-05-13 Object-oriented database system

Publications (2)

Publication Number Publication Date
KR950033918A KR950033918A (en) 1995-12-26
KR0127101B1 true KR0127101B1 (en) 1998-04-02

Family

ID=19382994

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019940010450A KR0127101B1 (en) 1994-05-13 1994-05-13 Object-oriented database system

Country Status (1)

Country Link
KR (1) KR0127101B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100426620B1 (en) * 2000-12-26 2004-04-13 한국전자통신연구원 Method of an class instance updating with OID in the main memory resident, object-relational DBMS

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100426620B1 (en) * 2000-12-26 2004-04-13 한국전자통신연구원 Method of an class instance updating with OID in the main memory resident, object-relational DBMS

Also Published As

Publication number Publication date
KR950033918A (en) 1995-12-26

Similar Documents

Publication Publication Date Title
Boyland et al. Capabilities for sharing: A generalisation of uniqueness and read-only
Alves-Foss Formal syntax and semantics of Java
US5361350A (en) Object oriented method management system and software for managing class method names in a computer system
US5692195A (en) Parent class shadowing
Drossopoulou et al. More dynamic object reclassification: Fickle∥
US6526457B1 (en) Systems utility object interface for facilitating software portability
Bergel et al. Stateful traits and their formalization
Bokowski Coffeestrainer: Statically-checked constraints on the definition and use of types in java
Jones et al. Object inheritance without classes
Casais et al. OBST—An overview
Wirfs-Brock et al. A overview of modular smalltalk
KR0127101B1 (en) Object-oriented database system
Marquez et al. Fast portable orthogonally persistent JavaTM
Sakkinen Comments on “the Law of Demeter” and C++
Harper Modules and persistence in Standard ML
Crary et al. Type structure for low-level programming languages
Craik et al. Using ownership to reason about inherent parallelism in object-oriented programs
Cohen et al. An architecture for safe bytecode insertion
Bettini et al. On multiple inheritance in Java
Schäfer et al. A Parameterized Type System for Simple Loose Ownership Domains.
Boyapati JPS: A distributed persistent Java system
Lienhard Bootstrapping Traits
Noth Exploding Java objects for performance
KR100496983B1 (en) Method and system of managing sql query using metasql component
Alt et al. The OBST Tutorial

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20030930

Year of fee payment: 7

LAPS Lapse due to unpaid annual fee