1

I am not sure if this is a good question as I'm unsure if there's any agreement on the subject. However due to the lack of information in the internet I'm compelled to ask anyways.

Let's say I'm making a system that is mainly object-oriented, with its corresponding UML diagrams (use-case, class, colaboration, etc). However, none of the UML diagrams are helpful when dealing with the database, which should be relevant for the developing team so they can know what exists in the database and what does not.

There are two ways to represent a database: Entity-Relationship and Relational (it's unknown to me if there are more, but those two are relevant within the relational database paradigm). ER deals with the representation of the BD in terms of business rules, and Relational deals with the actual, physical implementation. But none are "UML standard" (unless I'm missing something here).

Which modeling should I use, and why? Is ER relevant in terms of UML, or should I stick to relational? Thank you beforehand.

Carlos Vergara
  • 3,592
  • 4
  • 31
  • 56
  • 1
    That's correct, but both are relevant in terms of what should be communicated to the developing team. Using the OO paradigm removes the relevance of ER modeling as the business is instead modeled through the UML diagrams. That's why I'm asking what's the relevance of ERM in OO systems and if it should be used or not. – Carlos Vergara Feb 02 '14 at 20:47

2 Answers2

2

If you want to use UML only, you could use limited class diagrams - without m-n associations and methods. But if you are using some class-table mapping tools, you can use anything, except m-n relationships only.

Nobody had ever said that you can use Class diagram for OOP classes only. You can use them for any more or less formal concepts, if their needs can be covered by the complex of CD elements. I use class diagrams for UI planning and even formal text planning. And tables are very close to classes. So, no problem.

You can use data model diagrams, if you need something that is CALLED data diagram. But they are covered by class diagrams fully. That is the reason they are not supported anymore.

Your task is to make the model understandable for everybody, who can get it in hands. Class diagram is the most widely known UML diagram. A good title and a pair of comments will resolve all possible misunderstandings.

Gangnus
  • 24,044
  • 16
  • 90
  • 149
  • So, if I'm getting this correctly... I can use class diagrams as a replacement to a ER or relational diagram and solve all my problems right? For instance, if I wanted to make a ER diagram I use the same cardinalities in UML and that's it, and if I wanted to make a relational diagram I convert those into a directed association to represent the FKs? – Carlos Vergara Feb 03 '14 at 00:02
  • Yes, you can use classes for it. It is a standard school takes nowadays to describe DB by class diag. I have answered some questions about it the last time (http://stackoverflow.com/questions/21231096/uml-class-diagram-for-database) – Gangnus Feb 03 '14 at 08:39
  • Sorry, I don't know what is FK. But you use navigable association for showing that one table has id's of the other table. – Gangnus Feb 03 '14 at 08:41
  • FK = Foreign Key, right what you described (one table has an ID from another table). Thank you, this is my answer. – Carlos Vergara Feb 04 '14 at 01:11
  • Sorry, I wasn't sure you know what Foreign Key is. And I myself haven't recognize the abbreviation. I thought: If that Americans had named even something in IT in honour of (John) Fitzgerald Kennedy? – Gangnus Feb 04 '14 at 08:18
0

Both are different ER diagrams are relationship of entities and UML diagrams are behaviour of Ojects how they communicate with each other, as per my view point DFD (data flow diagram) is option. It has different levels which is based on number of processes and will better explain about data entities.

ajitksharma
  • 4,523
  • 2
  • 21
  • 40
  • Personally I believe DFD is no longer an option when you adopt the OO paradigm, as most if not all the diagrams in UML replace what DFD can do. What UML does not and can not replace is how the DB is composed. – Carlos Vergara Feb 02 '14 at 20:50