8.2 NESMA 1:(N)依赖关系案例分析

8.2 1:(N) with dependent existence(1对多依赖关系)

原文

Problem description

The normalized data model of a library application shows that there is a 1:(N) relationship between the entity types Book and Loan. A book does not have to be loaned out and, so, optionality is a factor in the relationship. If a Loan is made, it always relates to one Book (no optionality).

The business rule of this library, however, is that if Book is taken from the collection (is deleted), the library is no longer interested in Loan and, therefore, it may be deleted automatically when Book is deleted.

How many logical files must be identified in this case?

Discussion

A 1:(N) relationship exists between Book and Loan. According to the table in section 4.21.5, the number of logical files is determined on the basis of the entity dependence. Because a Book can always be deleted, and because any Loan linked to a Book may be deleted automatically with that Book, we can conclude that Loan is not significant to the application when separated from Book. Therefore, Loan is entity dependent with respect to Book. (See situation 1 in the discussion about (in)dependence in a 1:(N) relationship in section 4.21.4.) This means that there is only one logical file.

Solution

Count one logical file with two record types.

翻译

问题描述

图书馆应用程序的规范化数据模型表明,实体类型“图书”和“借阅”之间存在1:(N)关系。一本书可以不借阅,因此,选择性是关系中的一个因素。如果借阅,借阅记录总是与一本书相关(无选择权)。

然而,该图书馆的业务规则是,如果把书从藏书中取出(删除),图书馆将不再对书的借阅感兴趣,因此,当图书删除时,借阅可能会自动删除。

在这个案例中应该识别多少个内部逻辑文件?

讨论

在图书和借阅之间是 1:(N)关系。根据第4.21.5节中的表格,逻辑文件的数量根据实体相关性确定。由于一本书总是可以删除的,而且与该书链接的任何借阅记录都可以随该书自动删除,因此我们可以得出结论,当借阅与该书分离时,对应用程序并不重要。因此,借阅与依赖于图书的。(参见第4.21.4节中关于1:(N)关系中的(in)依赖性的讨论中的情况1。)这意味着只有一个逻辑文件。

解决方案

识别1个内部逻辑文件2个记录类型

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值