模型图好像不太对。我还能如何关联这些对象?
我有一个来自一些分析的实体图,我希望有人查看一下。由于某种原因,系统对象对我来说似乎不合适。有没有更好的方法来关联对象?
它基本上是一个处于起步阶段的用户身份验证/管理系统。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
User
和Company
应该有一个共同的基类(它们都有名称和邮件地址),然后您可以将System
链接到这个基类。这是业务建模的常见模式,例如,请查看 Martin Fowler 的书的第一章 "分析模式"。编辑:或者,如果您认为这更有意义,您可以使用 System 作为基类本身,将电子邮件地址放在那里(也许给 System 一个更好的名称,例如 < code>LegalPerson、
CorporateBody
或类似的内容)。User
andCompany
should have a common base class (they both have names and mail addresses), then you can link theSystem
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 giveSystem
a better name likeLegalPerson
,CorporateBody
or something like that).考虑到密码与用户具有一对一的关系,并且不与任何其他表关联,我建议您自己保存一个内部联接,并将其作为属性表中的另一列。否则,看起来相当不错。
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.
如果没有一些比较指标,就很难评估某件事的“正确性”。类设计最简单的指标是查询。
想出尽可能多的您最终想要对该数据提出的查询。把它们写下来,看看设计如何支持它们。如果您不满意,请尝试其他设计并查看查询的外观。
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.