I want to design a database.I heard UML is one of the way. What is the advantage in using UML? When should I decide I have to use UML ? and also after generating the code from model how should I proceed?I'm using UML studio for designing the database.
2 Answers
There are many advantages but it mainly depends on how you use it and to what purpose. The first is that by means of a graphical modeling language it might be easier to look at the whole database architecture and possibly find improvements. The second important reason is that being platform independent you can, in principle, generate different artifacts supporting your database implementation (i.e. SQL scripts, Data Access Objects, documentation, etc.)
Now I don't know UML Studio but in Eclipse you can use Papyrus to model your DB architecture (a stereotyped class diagrams should be enough) and Acceleo to define and execute your own model to text transformation workflows.
This may help you http://lowcoupling.com/modeling http://lowcoupling.com/post/47802411601/uml-diagrams-and-models-with-papyrus http://lowcoupling.com/post/47347056110/models-to-text-transformations-with-mofm2t-and-acceleo
3 Comments
I'm a big fan of UML, but UML diagrams are not the best solution to model databases, and especially Entity-Relationship. In fact all the best UML modeling tools support ER diagrams, too (besides many other types of diagrams). Yes, class diagrams can be used in a similar way, but ER diagrams offer a better visualization and support specific presentation options; you can define the type of each attribute among those supported by the specific DBMS you are using. I love Visual Paradigm, as UML and ER tool, but it's only my taste. Normally you have other nice options in advanced IDE supporting DB modeling, like real DB reverse engineering, SQL generation, support for physical and logical models (using different data types), and so on. I would use a class diagram to model a DB only if I can't use another tool supporting ER diagrams.
Hope this helps!
Luca