UML class diagram for database

class-diagramdatabaseuml

I have an assignment for developing a hotel reservation system!
One of tasks is to develop UML class diagram! However, in the task description it is written
"Class diagram should represent your database"

I am a bit confused about the rules, notations and etc… because I can't find any official UML class diagrams specifically for databases!

Could you help me please?

Best Answer

Yes, the latest UML standards threw off the data diagram. Nowadays Entity Relationship Diagram is NOT the part of UML. But the Class diagram still is there in UML and it will be enough.

Simply make a usual class diagram. The only difference is that you shouldn't use n-to-m dependencies, instead make a new class between the ends and you'll have n-to-1 and 1-to-m dependencies instead. Such class diagram can be realized in a database. For better understanding in every class you can set an attribute id to be used in the DB later.

The other thing for such class diagram is that you need not to describe any methods - they don't belong to DB tables. But in the reality you need them - so, I'd create one easier diagram - with instantiable classes and without methods, and the other, more thorough - that one will include also abstract classes, interfaces and methods.

Also, on the first one you needn't put classes that belong to the UI - classes, that show your data and edit them.

Related Topic