模型图好像不太对。我还能如何关联这些对象?

发布于 2024-08-16 22:24:52 字数 300 浏览 4 评论 0原文

我有一个来自一些分析的实体图,我希望有人查看一下。由于某种原因,系统对象对我来说似乎不合适。有没有更好的方法来关联对象?

它基本上是一个处于起步阶段的用户身份验证/管理系统。

http://www.dumpt.com/img/viewer.php? file=zlh8ltbtho4mutbbb3yk.gif

干杯, 麦克风

I have a entity diagram from some analysis that I'd like to have someone look over. For some reason the System object just doesn't seem right to me. Is there a better way to relate the objects?

Its basically a user authentication/management system in its infancy.

http://www.dumpt.com/img/viewer.php?file=zlh8ltbtho4mutbbb3yk.gif

Cheers,
Mike

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

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

发布评论

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

评论(3

囚我心虐我身 2024-08-23 22:24:52

UserCompany 应该有一个共同的基类(它们都有名称和邮件地址),然后您可以将 System 链接到这个基类。这是业务建模的常见模式,例如,请查看 Martin Fowler 的书的第一章 "分析模式"

编辑:或者,如果您认为这更有意义,您可以使用 System 作为基类本身,将电子邮件地址放在那里(也许给 System 一个更好的名称,例如 < code>LegalPerson、CorporateBody 或类似的内容)。

User and Company should have a common base class (they both have names and mail addresses), then you can link the System to this base class. That's a common pattern for business modeling, look for example, into chapter one of Martin Fowler's book "Analysis Patterns".

EDIT: Or, if you think this makes more sense, you use System as the base class itself, put the EMail adress there (and perhaps give System a better name like LegalPerson, CorporateBody or something like that).

她说她爱他 2024-08-23 22:24:52

考虑到密码与用户具有一对一的关系,并且不与任何其他表关联,我建议您自己保存一个内部联接,并将其作为属性表中的另一列。否则,看起来相当不错。

Considering the password has a 1-to-1 relationship with the User, and is not keyed to any other tables, I'd suggest saving yourself an inner join and just making it another column in the property table. Otherwise, looks pretty good.

对岸观火 2024-08-23 22:24:52

如果没有一些比较指标,就很难评估某件事的“正确性”。类设计最简单的指标是查询。

想出尽可能多的您最终想要对该数据提出的查询。把它们写下来,看看设计如何支持它们。如果您不满意,请尝试其他设计并查看查询的外观。

It's hard to evaluate the "rightness" of something without some metrics of comparison. The easiest metrics for class designs are queries.

Think up as many of the queries that you will eventually want to ask of this data. Write them down and see how the design supports them. If you're unhappy, try another design and see how the queries look then.

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