3

I have been asked this question and even after a lot of research, I cannot find the answer.

When I design a database using Entity relationship (ER) and then re-draw it as UML class model (extended with Data modeling profile for UML), what are the differences and how both models can be (in their way) useful for db developer? With regard to multiplicity, foreign keys..

5

The level of abstraction provided by Entity Relationship Diagrams created with modeling tools, the entity model provided by EF, and UML class diagrams is almost the same. When I create my POCO entities I generally put them in my Model project with my other domain classes, and so a class diagram of the domain model contains the same POCO entities found in the ERD.

While both models provide for relationships, UML can be more descriptive in its relationships which often reflect some sort of action, behavior, or complex relationships such as interface implementation or inheritance. ERD relationships, on the other hand, are all about keys and multiplicity.

I feel that the model designer provided by the Entity Framework meets my needs for modeling entities. I use a modeler to produce an ERD during the design phase, but I like the entity model to speak for itself after that.

As for UML, I find it very useful for communication and documentation of how software processes behave and interact with one another. These diagrams can be found in the system documentation in the form of use cases, activity diagrams, class diagrams, and sequence diagrams.

Hope this helps.

  • I think he is talking about UML profile for data modeling, which is an extension to UML for DB support. I think there are some differences in terms of information you can read from these diagrams, but I am not an expert. How is UML more descriptive? – John V Jan 2 '14 at 8:43
  • UML is more flexible. Relationships can be described with verbs, like "creates", or "contains", and the model can express interface implementations, inheritance, composition, etc. UML goes beyond modeling entities and their properties to include behaviors. – field_b Jan 2 '14 at 11:45
  • Thank you, and in terms of Data design (when there is basically no inheritance etc.)? E.g. what is the difference between FK displayed in UML class with data profile and ERD? – John V Jan 2 '14 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.