34
6. THE LOGICAL DESIGN 2008-10-02 박 박 박 [email protected]

6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 [email protected]

  • View
    217

  • Download
    3

Embed Size (px)

Citation preview

Page 1: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

6. THE LOGICAL DESIGN

2008-10-02

박 춘 걸[email protected]

Page 2: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

2

abstract

개념적인 integrated data model (IDM) 을 논리적인 unified data structure (UNS) 로 변환

relational approach object-oriented approach

Page 3: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

3

6.1 Relational Approach

relational approach 사용 이점 사용의 용이성 : 사용자들로 하여금 DBMS 의 자료 접근 보다 응용에

집중할 수 있게 함 유연성 (flexibility): 데이터 구조를 용이하게 확장하거나 수정할 수

있음 다양한 데이터베이스 관리 시스템 , 컴퓨팅 플랫폼 , 운용체제에

사용가능 소프트웨어 라이버러리 , 질의 언어 (SQL, QBE) 를 사용 가능 입력과 출력이 다른 시스템에서도 사용 가능

Page 4: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

4

6.1.1 Relational Data Structure for TIN-based Model

Constructing Dependency Statements 데이터베이스에 저장하기 위한 data field 를 다룸

1. surface feature: SID, SCLASS (surface feature class)2. line feature: LID, LCLASS (line feature class)3. point feature: PID, PCLASS(point feature class), PNODE (node number)4. NODENR : position (x, y, z)5. arc: ARCNR, Node1(starting node), Node2 (ending node), Tri1 (triangle on its left side),

Tri2 (triangle on its right side)6. ARCNR: arc 는 많아야 하나의 ALID line feature 가짐7. triangle: TRINR, TSID (surface feature)

Page 5: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

5

6.1.1 Relational Data Structure for TIN-based Model

Mapping from Dependency Statements into Dependency Diagram 속성은 (data fields) bubble 내에 표현 2 개 bubble 사이의 선은 data field 사이의 관계를 표시 single-headed arrow 은 single-valued dependency 를 표시 double-headed arrow 은 multivalued dependency 를 표시 Bubble 를 연결한 선에 인접한 번호는 dependency statement number

를 가리킴 삼각형은 domain flag 를 표시

Page 6: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

6

6.1.1 Relational Data Structure for TIN-based Model

Composing Relational Tables from Dependency Diagram 테이블은 single-valued dependencies, multi-valued dependencies

로부터 생성 화살의 시작이 되는 bubble 은 primary key, 목표 bubble 은 같은

테이블의 data field 화살이 가리키는 bubble 의 domain flag 는 foreign key multivalued dependency 경우 만일 3 개 이상의 data field 가 같은 p

rimary key 를 포함하여 성능이 저하되거나 실행 불가능 할 경우 surrogate key 와 foreign key 를 사용하여 테이블을 분할

Page 7: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

7

6.1.1 Relational Data Structure for TIN-based Model

Composing Relational Tables from Dependency Diagram 그림 6.1 을 테이블로 표시

R1: NODE (NODENR, x, y, z)R2: ARC (ARCNR, node1, node2, tri1, tri2)R3: TRISURF (TRINR, tsid)R4: ARCLINE (ARCNR, alid)R5: POINT (PID, pclass, pnode)R6: LINE (LID, lclass)R7: SURFACE (SID, sclass)

R1, R2 는 geometric primitive 와 topological 관계를 표시 ARC 는 시작점과 끝점 , 왼쪽과 오른쪽 삼각형을 표시

R3, R4 는 geometric primitive 와 feature 의 part-of relationship 표시 R5 는 node 와 point feature 사이의 1 대 1 관계의 thematic classifi

cation 을 표시 R6, R7 은 line 과 area feature 의 thematic class 를 표시

Page 8: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

8

6.1.2 Relational Data Structure for a TEN-based Model

1. body feature: BID, BCLASS (body feature class)2. surface feature: SID, SCLASS (surface feature class)3. line feature: LID, LCLASS (line feature class)4. point feature, PID, PCLASS (point feature class), PNODE (node num

ber)5. arc: ARCNR, NODE1 (starting node), NODE2 (ending node)6. NODENR: position (x, y, z)7. triangle: TRINR, TSID (surface feature), TET1 and TET2 (two tetrahe

drons), EDGE1, EDGE2 and EDGE3 (three edges)8. ARCNR: ALID (line feature)9. tetrahedron: TETNR ( 식별자 ), TBID (body feature)

Page 9: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

9

6.1.2 Relational Data Structure for a TEN-based Model

TEN-based relational data structure

R1R2

R3

R4 R6R5

R7R8R9R10

Page 10: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

10

그림 6.3 를 테이블로 표시R1: Node (NodeNr, x, y, z)R2: Arc (ArcNr, node1, node2)R3: Triangle (TriNr, tet1, tet2, edge1,

edge2, edge3)R4: Tetra (TetNr, tbid)R5: TriSurf (TriNr, tsid) R1, R2, R3 은 geometry tables R4, R5, R6 은 geometry-feature tables R7 은 geometry-feature-class table R8, R9, R10 은 class tables table R4 는 tetrahedron number (TetNr) 와 body feature (TBID)

정보를 가짐 Tetrahedron 의 geometric component 인 tetrahedron (TetNr) 을 R3 (T

riangle) table 에서 검색하여 tet1 또는 tet2 의 속성 값을 획득 R3 table 의 edge1, edge2, edge3 을 R2 (Arc) table 에서 ArcNr 를

검색 R2 table 에서 node1, node2 속성 값을 검색하고 R1 (Node) table

에서 node 의 x, y, z 값을 획득

6.1.2 Relational Data Structure for a TEN-based Model

R6: ArcLine (ArcNr, alid)R7: Point (Pid, pclass, pnode)R8: Line (Lid, lclass)R9: Surface (Sid, sclass)R10: Body (Bid, bclass)

Page 11: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

11

6.1.3 Relational Data Structure for an n-dimensional Data Model

TIN-based, TEN-based 의 모델에서 n 차원 UNS(unified data structure) 에 필요한 테이블의 수를 예측 N 개의 geometric tables, n

개의 geometry-feature tables, 1 개의 geometry-feature-class table, n 개의 featureclass tables

Crdi is a coordinate component

Si represents the simplex or

geometric primitive of i dimensionCi represents the complex or feature of i

dimensionSij represents the number j of i-simplex

Cij represents the number j of i-complex

Page 12: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

12

6.2 Object-oriented Approach

relational database 방법은 이점을 갖고 있지만 일부 중요한 aspect 는 부족하기에 object-oriented approach 을 제안 relational approach 는 Cartesian product 를 기반으로 하여 GIS

에서 대용량의 데이터의 통계를 위한 join 연산은 긴 응답시간을 초래 object-oriented approach 는 효율적으로 topology 를 표현할 수 있고

서로 다른 요소들을 쉽게 접근하고 더 빠른 응답시간을 제공 소스 코드의 수정이 없이 데이터 베이스 관리 API 를 재 사용 및 확장가능

Page 13: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

13

6.2.1 Object-oriented Definition of a Spatial Object

실 세계의 객체를 geometric 와 thematic 으로 분류 Thematic 은 색,이름,소유권,기능 등을 포함 Geometric 은 shape, location, topology 관한 정보를 포함 relational approach 의 개념을 적용할 때, geometric 과 thematic

의 속성들은 feature identifier 를 통하여 연결 Object-oriented approach 에서는 feature object 를 geometric

component 와 thematic component 캡슐화하여 표현

Page 14: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

14

6.2.2 Object-oriented Design Based on IDM

Classification Molenaar (1993) 은 object-oriented design 을 위한 기본 원리 제공

실 세계의 객체를 3 개의 ADT(abstract data type) 로 분류• ADTFeature, ADTGeometry, ADTTheme• ADTFeature class 는 ADTGeometry class 와 ADTTheme class 로 구성

ADTFeature class 는 실 세계 객체를 전체적으로 정의 Geometric 과 thematic descriptions 은 ADTGeometry class 와 ADTTheme

class 에 정의 일반적으로 각 class 는 더 세부적인 class 로 분할

Page 15: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

15

6.2.2 Object-oriented Design Based on IDM

Thematic class ADTTheme class 는 geoinformation domain 의 thematic 한 정보를

저장하기 위하여 데이터 구조를 정의 (land use, transportation networks, water bodies)

보통 속성 정보와 자손 thematic object 들의 behaviour 로 구성 계층의 상속을 용이하게 하고 중복들을 최소화 하며 thematic 정보

재 사용을 허락

class : ADTThemedescription : general representation of thematic components of a

spatial objectparent : noneattributes : code, name, texture, colour, ...methods : create, delete, show code, modify code, show name,

modify name, ...constraints : ...

Page 16: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

16

6.2.2 Object-oriented Design Based on IDM

Geometric class 공간 객체를 저장 및 관리 geometric primitive 의 계층을 정의 컴포넌트의 저장을 위하여 데이터 구조를 제공 , feature 의 형태를

표현 , georeferencing scheme 와 topological relationship 을 표현 모든 geometric object 는 ADTFeature class 로부터 생성

class : ADTGeometrydescription : general representation of geometric components of a

spatial objectparent : noneattributes : identifier, reference to a feature class object (part of), ...methods : create, delete, show identifier, modify identifier, show

feature, modify feature, display graphics, ...constraints : on creation, requires input of object identifier and

reference to a feature object from the creator; on creation, sends a request to the reference feature object to update the geometric container of the feature, ...

Page 17: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

17

6.2.2 Object-oriented Design Based on IDM

Feature class 현실의 세계의 표현에 있어서 가장 중요한 역할을 수행 사용자와 시스템의 사이에서 인터페이스를 제공 Feature 의 모든 구성 요소를 찾거나,저장하는 entry 를 제공 형성된 instance 는 ADTGeometry object, ADTTheme object 로 구성

Class : ADTFeatureDescription : general representation of a spatial objectParent : noneAttributes : identifier (to interface with users), reference to ADTTheme object, r

eference to the collection of ADTGeometry objects, ...methods : create, delete, add to geometric container a reference to

ADTGeometry object, delete from geometric container a reference to

ADTGeometry object, (graphics) display geometry, display thematic

properties, ...constraints : on creation, requires identifier and reference to ADTTheme object

from the creator, ...

Page 18: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

18

6.2.3 Specialization of Classes

Thematic Hierarchy ADTTheme class 는 road, railway, river, control point 등 여러가지 서브

클래스로 세분화 object-oriented approach 으로 thematic information 을 모델링 할 때

이점을 가짐 특히 객체가 동시에 여러 개의 thema 와 관계가 있을 경우

각 class 는 한 개 이상의 부모 class 로부터 상속 받을 수 있고 또한 theme 의 조합으로 표현 예 : TRiver class 는 TWaterBody, Tnatural 로 상속 받으며 thematic hierar

chy 의 TRiver class 는 feature hierarchy 의 line feature class 의 구성 요소로서 feature hierarchy 의 여러 thematic information 를 포함

두 개의 부모 class 로부터 상속받을 경우 같은 이름의 속성과 메소드를 포함 할 수 있기에 특별히 주의하고 적절한 선택 방법이 필요

Page 19: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

19

6.2.3 Specialization of Classes

Thematic Hierarchy

Page 20: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

20

6.2.3 Specialization of Classes

Geometric hierarchy ADTGeometry 를 geometric primitive 또는 simplex—node, arc, triang

le, tetrahedron 등으로 세분화

Page 21: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

21

6.2.3 Specialization of Classes

class : TNodedescription : 0D geometric component of the representation of a spatial objectparent : ADTGeometryattributes : x, y, z coordinate, perspective transformed coordinate (xp,yp)methods : get coordinates, modify coordinates, (graphics) display, 2D, 3D,

perspective transformation, ...constraints : requires 3D coordinates, reference to ADTFeature object, and a

geometric identifier from the creator

Class : TArcdescription : 1D geometric component of representation of a spatial objectparent : ADTGeometryattributes : references to two TNode objects as begin and end nodes, references

to two TTriangle objects on its left and right sides.methods : create, delete, (graphics) display 2D, 3D, ...constraints : requires identifier, references to two TNodes and ADTFeature objects

from creator, ...

Page 22: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

22

6.2.3 Specialization of Classes

class : TTriangledescription : 2D geometric component of representation of a spatial objectparent : ADTGeometryattributes : references to three TNode objects as its vertices, three TArc objects

as its edges, three TTriangle objects as neighbour triangles, slope, parameters of plane in normal form (a, b, c, d), ...

methods : create, delete, get edges, get neighbours, get slope, get plane parameters, interpolate elevation for a given x,y coordinate, interp

olate locations for a given z coordinate, (graphics) display 2D, display 3D, shade, ...

constraints : requires a geometric identifier, references to three Tarc objects, and reference to an ADTFeature object, ...

class : TTetrahedrondescription : 3D geometric component of representation of a spatial objectparent : ADTGeometryattributes : references to four TTriangle objects as its faces, four TArc objects as

its edges, four TNode objects as its vertices, four TTetrahedron objects as its neighbours, ...

methods : create, delete, get vertices, get edges, get faces, get neighbours, interpolate value for a given x,y,z coordinates, interpolate contour surface, (graphics) display 3D, shade, ...

constraints : requires a geometric identifier, references to four Tnode objects, and reference to an ADTFeature object, ...

Page 23: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

23

6.2.3 Specialization of Classes

Feature Hierarchy ADTFeature class 는 point, line, area, body class 로 세분 각 class 는 behaviour, attribute 와 부모 ADTFeature class 에서

추가된 behaviour, attribute 를 포함

Page 24: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

24

6.2.3 Specialization of Classes

class : TPointFdescription : 0D representation of a spatial object parent : ADTFeatureattributes : ...methods : create, delete, display geometric (draw node, 2D, 3D), display

thematic, ...constraints : on creation, requires an identifier, references to ADTGeometry and

ADTTheme objects from the creator, ...

class : TLineFdescription : 1D representation of a spatial objectparent : ADTFeatureattributes : bounding rectangle, ...methods : create, delete, display geometric (draw all component arcs as 2D, 3D),

display thematic, ...constraints : on creation, requires an identifier, references to ADTGeometry and

ADTTheme objects from the ADTFeature TPoiTNComplex ... TBodyF TSurfaceF TLineF ntF creator, ...

Page 25: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

25

6.2.3 Specialization of Classes

class : TSurfaceFdescription : 2D representation of a spatial objectparent : ADTFeatureattributes : bounding rectangle (cube)methods : create, delete, display geometric (draw all component Triangles as 2D,

3D, shade), display thematic, ...constraints : on creation, requires an identifier, references to ADTGeometry and

ADTTheme objects from the creator, ...

class : TBodyFdescription : 3D representation of a spatial objectparent : ADTFeatureattributes : bounding box (cube)methods : create, delete, display geometric (draw all component tetrahedron as,

3D, shade), display thematic, ...constraints : on creation, requires an identifier, references to ADTGeometry and

ADTTheme objects from the creator, ...

Page 26: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

26

6.2.4 Aggregation of Objects

ADTFeature class 는 aggregation hierarchy 를 생성 geometric 과 thematic hierarchy 로부터 객체를 생성

ADTFeature 의 Subclass TPointF , TLineF , TSurfaceF , TBodyF은 aggregate type 을 가짐

TLineF 객체는 여러 개의 TArc 객체로 이루어질 수 있음 ADTFeature subclass 의 실질적인 aggregation 은 실행과정에 수행

thematic hierarchy 의 어떤 specific class 가 객체의 thematic 구성 요소일 것이라는 것을 설계 단계에서 알 수 없음

dynamic referencing mechanism 으로 이 문제를 해결 먼저 generic class (ADTTheme) 를 사용하여 aggregation 을 정의 실행 과정에서 specific class (Troad) 를 선택하고 이때 동적인 inheritanc

e 와 aggregation 수행 실행과정에서 TRoad class 와 TLineF class 를 합침 TLineF object 의 thematic component 가 TRoad class 임을 알 수 있음

Page 27: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

27

6.2.4 Aggregation of Objects

Page 28: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

28

6.2.5 Creation of Objects

ADTTheme, ADTGeometry, ADTFeature classe 로 객체를 생성할 때 시스템은 또한 container classes 를 제공해야 함

각 class 로 생성된 객체는 순차적으로 만들어 져야 함 ADTTheme objects 를 첫 번째로 만들고 ADTTheme container 에

등록 실제로 사용자는 사용 목적에 따라 첫 번째로 thematic hierarchies 를

정의 예 : 만일 geoinformation 을 road network 에 이용한다면 thematic hi

erarchy 를 ‘ general road’ 로 시작하여 'primary road' , 'secondary road', 'highway', 'superhighway’ 등으로 세분화

ADTFeature objects 를 다음으로 만들고 ADTFeature container 에 등록 사용자는 어떤 theme 가 어떤 feature 종류를 표현하는지를 정의 예 : 작은 scale 의 지도를 사용할 때 도시를 point feature (represente

d by TPointF class) 로 표시하고 큰 scale 의 지도를 사용할 때 도시를 area feature (represented by TSurfaceF class) 로 표시

ADTGeomety class 가 없기에 불완전한 ADTFeature

Page 29: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

29

6.2.5 Creation of Objects

ADTGeometry object 를 마지막에 만들고 ADTGeometry container에 등록 ADTGeometry object 는 ADTFeature 의 specialized class 로 표현 강이라는 객체를 line feature 로 표시하고 ADTGeometry object 의 TAr

c class 를 사용

Page 30: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

30

6.2.5 Creation of Objects

Page 31: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

31

6.2.6 Behaviour of Objects in the Database

객체 사이의 계층과 관계를 정의함으로써 모든 객체는 다른 객체로부터 받은 메시지에 반응할 수 있음 예를 들면 , 사용자가 한 지역의 특징을 원근감 있게 보고 싶을 경우

사용자는 Draw-3D 와 같은 메시지를 TSurfaceF 클래스에 속한 모든 객체들에게 보냄

이 메시지를 받은 각 TSurfaceF 객체는 geometric container 에서 검색하여 TTriangle 객체들의 모든 구성요소에 Draw-3D 메시지를 전달함

이후 각 TTriangle 객체는 메시지를 받아서 이를 TNode 에 보내어 이를 변환된 좌표를 사용하고 필요하다면 colour-fill 이나 shading 를 추가하여 원근감 있게 표현

Page 32: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

32

6.2.6 Behaviour of Objects in the Database

Spatial access 관점에서 고려해보면 TLineF 와 TSurfaceF 객체들은 각각 TArc 와 TTriangle 의 클래스들과 관계를 가짐

명확한 결과를 간단하고 빠르게 얻기 위해 TSurfaceF 의 spatial search 는 TSurfaceF 의 구성요소인 TTriangle 객체들에 한해서 수행

객체간의 참조는 객체의 구성요소 attributes 나 methods 에 빠르게 접근하는 방법을 제공

Page 33: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

33

6.2.7 Comparison with Other OO Approaches

Object Oriented Approach more flexible structure 를 제공 예 ) 지도 scale 에 따른 city 표현

area object ( 1:50000 ) point object ( 1:500000 )

Other Approaches Webster and Omare(1991) Kainz and Shahriari(1993)

Point feature 은 Node class 의 supertype (parent or ascendant) Geometric class 는 Thematic class 의 subtype (child or descendant)

Worboys 외 District class 는 Polygon class 의 specialization Feature object class 는 Geometric class 의 child

Page 34: 6. THE LOGICAL DESIGN 2008-10-02 박 춘 걸 cgpark@db.konkuk.ac.kr

34

6.2.7 Comparison with Other OO Approaches

클래스의 상속 접근 방법은 UNS 에 어울리지 않을 수 있음 클래스를 이용해 multiple geometric 를 표현함으로 데이터베이스에

저장된 features 의 수를 최소화 가능 같은 지도에서 도시들이 area 나 point 로 표현될 경우

Point 로 표현된 도시도 데이터베이스에서 area object 로부터 point object들을 얻음