Đang chuẩn bị liên kết để tải về tài liệu:
PATTERNS OF DATA MODELING- P8

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

PATTERNS OF DATA MODELING- P8: Models provide the means for building quality software in a predictable manner. Models let developers think deeply about software and cope with large size and complexity. Developers can think abstractly before becoming enmeshed in the details of writing code. Although models are beneficial, they can be difficult to construct. That is where patterns come in. Patterns provide building blocks that help developers construct models faster and better. | 16 Chapter 2 Tree Template Tree root Node 0.1 1 nodeName unique parent 0.1 child a Globally unique node name I I I I I I b Unique node name within a context Figure 2.10 Simple tree UML template with node names. There are two variations of the template globally unique names and names within a context. Figure 2.11 Sample tree with node names that are unique within a context. 2.2.2 IDEF1X Template Figure 2.12 restates Figure 2.10 with the IDEF1X notation. The following are foreign keys rootID references Node andparentID references Node. Tree i 1 1 Tree treelD Node r treeID Node rootID FK AK1.1 rootID FK AK1.1 nodelD 1 nodelD 1 L parentID FK nodeName AK1.1 1 1 L parentID FK AK1.1 nodeName Ak1.2 a Globally unique node name 1 I b Unique node name within a context Figure 2.12 Simple tree IDEF1X template. Figure 2.12 uses existence-based identity which is my preferred approach for database design. See Chapter 16. Existence-based identity means that each entity has its own artificial identifier such as an Oracle sequence or a SQL Server identity field as a primary key. Thus the primary key of Node is nodelD and not for example nodeName Figure 2.12a or 2.2 Simple Tree Template 17 parentID nodeName Figure 2.12b . Although I favor existence-based identity the templates in this book do not require it. In Figure 2.12 the AK notation denotes a candidate key that is a combination of attributes that is unique for each record in a table. No attribute in a candidate key can be null. All candidate key attributes are required for uniqueness. Figure 2.12b defines parentID nodeName as a candidate key but one record is an exception. The root node for a tree has a null parentID and a candidate key cannot involve a null. Most relational DBMSs treat NULL as just another value and do not strictly enforce candidate keys so the definition of a unique key for parentID nodeName does work. I verified this for SQL Server and expect that it would work for most relational DBMSs. Alternatively you can

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.