2 u l CAD ComputerAided Design w CAD

  • Slides: 34
Download presentation

 새로운 데이터베이스 응용 (2) u 새로운 응용들 l 컴퓨터 이용 설계(CAD, Computer-Aided Design)

새로운 데이터베이스 응용 (2) u 새로운 응용들 l 컴퓨터 이용 설계(CAD, Computer-Aided Design) w CAD 데이터베이스, design components, versions l 컴퓨터 이용 소프트웨어 공학 (CASE, Computer-Aided Software Engineering) w CASE 데이터베이스, source code, definitions and uses l 멀티미디어(Multimedia) 데이터베이스 w image, spatial data, audio/video data, geographical data l 사무 정보 시스템(OIS, Office Information System) w schedule, documents, document contents l 하이퍼텍스트(hypertext) 데이터베이스 시스템 w world wide web, link-based document retrieval and query 3

 객체 데이터 모델 u 객체 지향 개념(object-oriented concepts) l l l u 객체

객체 데이터 모델 u 객체 지향 개념(object-oriented concepts) l l l u 객체 및 객체 식별자(object and object identifier) 애트리뷰트와 메소드(attributes and method) 클래스, 클래스 계층(class and class hierarchy) 상속(inheritance) 복합 객체(complex object) 객체 데이터 모델(ODM: object data model) l 객체 지향 개념을 지원하는 데이터 모델 5

 클래스의 예 차재병 박정숙 채진영 S_number Name Date_ of_birth Dept Grade Address Course_taken

클래스의 예 차재병 박정숙 채진영 S_number Name Date_ of_birth Dept Grade Address Course_taken Advisor Sgrade() Mail() Student 인스턴스(객체) 인스턴스 변수 (애트리뷰트) 메소드 Student 클래스 11

 클래스 계층의 예 tree structure Vehicle Car Domestic Car Truck Import Car 14

클래스 계층의 예 tree structure Vehicle Car Domestic Car Truck Import Car 14

 다중 상속 (multiple inheritance) : DAG Person rrno name addr Student sno dept

다중 상속 (multiple inheritance) : DAG Person rrno name addr Student sno dept year Part. Time. Student lattice Employee eno sal dept major advisor 16

 클래스 구성 계층의 예 Vehicle. Engine Vehicle ID weight engine manufacturer Car Domestic.

클래스 구성 계층의 예 Vehicle. Engine Vehicle ID weight engine manufacturer Car Domestic. Car Truck Foreign. Car size cylinder Company name location president Domestic. Auto. Co Employee rrno name age city Foreign. Auto. Co 슈퍼클래스/서브클래스 링크 애트리뷰트/도메인 링크 19

 ODMG의 ODBMS u ODMG(Object Data Management Group) l l l ODBMS의 기술 표준화를

ODMG의 ODBMS u ODMG(Object Data Management Group) l l l ODBMS의 기술 표준화를 위한 국제 산업체 컨소시엄 OMG(Object Management Group) 산하 소그룹 1993/1997/2000년에 ODMG 1. 0/2. 0/3. 0 표준 ODBMS를 위한 ODMG 구조의 주요 구성 요소 w 객체 모델(OM: Object Model), 객체 정의어(ODL), 객체 질의어 (OQL), 객체 지향 언어 바인딩(C++, Java, Smalltalk) 등 포함 u 표준화(standardization) l l 이식성(portability) – capability to execute applications on different system with minimal modifications. 상호 운영성(interoperability) – ability of applications to access multiple distinct systems. 20

▶ ODMG 객체모델 (3) u 리터럴(literal) 타입 l 원자 리터럴(atomic literal) 타입 w long,

▶ ODMG 객체모델 (3) u 리터럴(literal) 타입 l 원자 리터럴(atomic literal) 타입 w long, short, char, string l 구조화 리터럴(structured literal) 타입 w system-defined structure: date, timestamp, interval w user-defined structure: struct 키워드를 사용 l 집단 리터럴 (collection literal) 타입 w Set, Bag, List, Array, Dictionary u 클래스 정의 l l 애트리뷰트(attribute) 관계(relationship) w 어떤 객체에 대한 참조(reference)나 참조의 집합을 표현 w ODMG에서는 이원 관계(binary relationship)만 허용 w 역 관계 (inverse relationship) 명세 가능 l 연산(operation) : 객체에 적용하는 함수 23

 인터페이스 정의의 예 interface Object { ··· boolean same-as(in object other-object); //in은 매개변수

인터페이스 정의의 예 interface Object { ··· boolean same-as(in object other-object); //in은 매개변수 애트리뷰트로 out, inout도 있음 object copy(); void delete(); ··· }; interface Time : Object { //Object interface를 상속 ··· unsigned short hours(); unsigned short minutes(); unsigned short seconds(); unsigned short milliseconds(); ··· boolean equal(in Time other-time); boolean greater(in Time other-time); ··· }; 25

 클래스 정의 예 class Student ( extent Students key sno ) { struct

클래스 정의 예 class Student ( extent Students key sno ) { struct Department { string dname, string location }; attribute integer sno; attribute string sname; attribute Department dept; relationship set <Course> take inverse Course: : enrol; } u extent : 한 클래스에 속하는 객체(인스턴스)들의 집합을 총칭 27

 클래스 정의 예 u Course 클래스의 정의 class Course ( extent Courses key

클래스 정의 예 u Course 클래스의 정의 class Course ( extent Courses key cno ) { attribute string cno; attribute string cname; attribute string professor; attribute integer credit; relationship set <Student> enrol inverse Student: : take; float no. Of. Students(); } u Course 클래스의 서브클래스로 Seminar. Course 정의 class Seminar. Course extends Course ( extent Seminar. Courses ) { attribute integer max. Attendees; } 28

▶ 익스텐트의 set/subset relationship 슈퍼클래스와 서브클래스 익스텐트 간의 관계는 set/subset 관계가 유지 class Course

▶ 익스텐트의 set/subset relationship 슈퍼클래스와 서브클래스 익스텐트 간의 관계는 set/subset 관계가 유지 class Course ( extent Courses key cno ) { attribute string cno; ……………. } class Seminar. Course extends Course ( extent Seminar. Courses ) { attribute integer max. Attendees; } u u 익스텐트 Seminar. Courses에 속하는 객체 집합은 반드시 익스 텐트 Courses에 속하는 객체 집합의 부분집합이 됨. 29

▶ OQL (2) u 예제 수강생 수가 20명 미만인 과목을 수강하는 학생의이름 (student_name), 소속학과명(department),

▶ OQL (2) u 예제 수강생 수가 20명 미만인 과목을 수강하는 학생의이름 (student_name), 소속학과명(department), 과목명(course_name)을 검색하라. SELECT student_name: S. sname, 결과 필드 이름 department: S. dept. dname, course_name: C. cname FROM Students S, S. take C 참조 연산: SQL의 JOIN과 비슷 WHERE C. no. Of. Students() < 20 • • S. take C는 현재 바인딩된 S가 수강(take)하는 Course(C)를 바인딩 경로식(path expression): S. dept. dname 31

▶ OQL (3) u 예제 SELECT creditno: C. credit avg. Num: AVG( SELECT P.

▶ OQL (3) u 예제 SELECT creditno: C. credit avg. Num: AVG( SELECT P. C. no. Of. Students() FROM partition P ) FROM Courses C GROUP BY C. credit * partition은 GROUP BY 결과로 만들어진 그룹들을 나타냄 * p는 반복 변수 32

▶ OQL (4) u 예제 SELECT low, high, avg. Num: AVG( SELECT P. C.

▶ OQL (4) u 예제 SELECT low, high, avg. Num: AVG( SELECT P. C. no. Of. Students() FROM partition P ) FROM Courses C GROUP BY low: C. credit < 3, high: C. credit >= 3 * 2개의 투플을 결과로 생성 * GROUP BY 는 low, high 두 그룹을 생성하고 partition이 이 들을 표현 *SELECT 절의 low와 high는 불리언 변수가 되어 no. Of. Student()가 실행하는 그룹에 따라 True나 False를 출력 시킴 33