Rollor
Rollor

Reputation: 621

Can I use my relational db table diagram to create UML class diagrams?

I am new to UML. But I'm well versed in drawing db tables and their relationships.

Can I just "extend" these tables by adding Methods() below and call it a UML Class Diagram?

Student

..........................

StudentID : int

StudentNumber : string

FirstName : string

Surname : string

..........................

Display()

Update()

Add()

Delete()

Upvotes: 1

Views: 1769

Answers (2)

Chris Nava
Chris Nava

Reputation: 6802

You seem to have the basics of UML. The main differences are that relationship types are different from SQL and that Java (or whatever language) data types don't match SQL data types directly, so you'll need to convert those as you have above.

[opinion] Unless you have a UML->code->UML tool I would not get too hung up on drawing the UML. It's mainly a tool for white boarding (IMHO) and trusting those diagrams tends to hurt you in the long run when maintenance changes make that sort of documentation obsolete. I prefer to use a code->UML tool when looking at legacy code rather than outdated UML diagrams from design time. [/opinion]

[edit] Since you already have working code you may want to try Amateras UML in Eclipse. You can drag a bunch of classes onto an empty document and it will create the UML diagram for you. [/edit]

Upvotes: 2

Bart De Vos
Bart De Vos

Reputation: 631

Making an object for every table isn't a good practice. Not every table needs to be an object in your UML... But then again... I think this is more for StackOverflow...

Upvotes: 3

Related Questions