Model diagram doesn't seem right. How else can I relate the objects?
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.
精彩评论