零件编号字段的原子性

发布于 2024-09-07 05:09:52 字数 509 浏览 2 评论 0原文

在我们的内部库存应用程序中,我们存储三个值(在单独的字段中),这些值成为以下格式的打印“部件号”:PPP-NNNNN-VVVV(P = 前缀,N = 编号,V = 版本)。

例如,如果您有一个部件 010-00001-01,您就知道它是“010”类型部件的版本 1(假设是印刷电路板)。

因此,在创建零件的过程中,工程人员希望通过在多个前缀中保持“数字”组件(中间 5 位数字)相同的方式将零件分组在一起,如下所示:

001-00040-0001 - Overall assembly
010-00040-0001 - PCB
015-00040-0001 - Schematics

这似乎是有问题且令人沮丧的,因为它有时会为“数字”添加额外的含义”字段(但不一致,因为并非所有具有相同“数字”组件的部分都必须链接)。

我是一个纯粹主义者还是这样可以? 1NF 在原子性方面非常模糊。我认为我最感到沮丧的是因为需要额外的逻辑来确保整个零件号的下一个“数字”部分是有效的并且可用于所有前缀。

In our internal inventory application, we store three values (in separate fields) that become the printed "part number" in this format: PPP-NNNNN-VVVV (P = Prefix, N = Number, V = version).

So for example, if you have a part 010-00001-01 you know it's version 1 of a part of type "010" (which let's say is a printed circuit board).

So, in the process of creating parts engineering wants to group parts together by keeping the "number" component (the middle 5 digits) the same across multiple prefixes like so:

001-00040-0001 - Overall assembly
010-00040-0001 - PCB
015-00040-0001 - Schematics

This seems problematic and frustrating as it sometimes adds extra meaning to the "number" field (but not consistently since not all parts with the same "number" component are necessarily linked).

Am I being a purist or is this fine? 1NF is awfully vague with regards to atomicity. I think I'm mostly frustrated because of the extra logic to ensure that the next "number" part of the overall part number is valid and available for all prefixes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

高跟鞋的旋律 2024-09-14 05:09:52

已有不少企业因“零件号综合症”而倒闭或濒临倒闭。您也许可以找到一些案例研究。 DEC 部件号有些混乱。

顾客并不总是对的,但顾客永远是顾客。

在这种情况下,在我看来,工程正在尝试使用单个数字来建模关系。我指的是整体装配、PCB 和 Scematics 之间的关系。最好将关系建模为关系。它可以让您在以后的道路上更加灵活。在这一点上,你可能很难推销工程技术。

There have been a number of enterprises that have foundered, or nearly foundered, on the "part number syndrome". You might be able to find some case studies. DEC part numbers were somewhat mixed up.

The customer is not always right, but the customer is always the customer.

In this case, it sounds to me like engineering is trying to use as single number to model a relationship. I mean the relationship between Overall assembly, PCB, and Scematics. It's better to model relationships as relations. It allows you more flexibility down the road. You may have a hard time selling engineering on this point.

情感失落者 2024-09-14 05:09:52

根据我的经验,无论数据库规范规则如何,当客户/顾客/用户希望以某种方式完成某件事时,很可能有一个原因,而这个原因会为他们节省金钱(以某种方式)。有时,它可以通过减少步骤、减少培训成本或仅仅因为这就是它一直以来的方式来节省资金。无论出于什么原因,最终你都会这样做,因为他们付费才能完成它(除非它违反了会计规则)。

在这种情况下,这听起来像是对某些报告查询的额外排序标准,以及带有自动递增键的新“分配数量”表。这对我来说听起来还不错。有时问我有关数据库报告的信息,一位客户副总裁严格委托其以一种让其他副总裁在会议中看起来很糟糕的方式投射数据(并不是他事先告诉我的)。

In my experience, regardless of database normative rules, when the client/customer/user wants something done a certain way, there is most likely a reason for it, and that reason will save them money (in some fashion). Sometimes it will save money by reducing steps, by reducing training costs, or simply because That's The Way It's Always Been. Whatever the reason, eventually you'll end up doing it because they're paying to have it done (unless it violates accounting rules).

In this instance, it sounds like an extra sorting criteria on some queries for reports, and a new 'allocated number' table with an auto-incrementing key. That doesn't sound too bad to me. Ask me sometime about the database report a client VP commissioned strictly to cast data in such a fashion as to make a different VP look bad in meetings (not that he told me that up front).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文