开发者

Model diagram doesn't seem right. How else can I relate the objects?

开发者 https://www.devze.com 2022-12-15 17:29 出处:网络
I have a entity diagram from some analysis that I\'d like to have someone look over. For some reason the System object just d开发者_JAVA技巧oesn\'t seem right to me. Is there a better way to relate th

I have a entity diagram from some analysis that I'd like to have someone look over. For some reason the System object just d开发者_JAVA技巧oesn'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


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).


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消