English 中文(简体)
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 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

最佳回答

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.





相关问题
Representing a C# Generic Method in a UML Class Diagram

I have the following interface: public interface IRegisterable { T Register<T>(string username, string passw) where T : User, ICanLogin, new(); } User is an abstract class, and ICanLogin is ...

Create C++ Code from Visio UML diagram [closed]

Visio 2010 Beta can generate static UML diagram from Native C++ project, and it s great. How is it possible to solve reverse problem: given a static UML diagram from Visio, generate header files? Or, ...

How relations in UML class diagram inherit?

I was wondering how associations, dependencies and such relations inherit in UML (or let s say, in general). So, in a situation like this: ┌──────────┐ ┌──────...

Using constant fields vs initial data

I m designing some new class diagrams for extending an existing office automation application. In a special case I have an option to use extra fields on Entity1 to determine something or use ...

Association of n to 1 objects in a UML class diagram

Is it safe to say that in a UML class diagram, if there is an association of n to 1 objects, then the association arrow is pointing from the class associated with n objects to the class associated ...

热门标签