What is Tips on Data Modeling?
What is Mapping a Class Diagram into an ERD ?
Tips
on Data Modeling
- Use an automated tool, preferably the one that your chosen
DBMS provides, for your data model.
- Apply normalization rules and normalize your database
design at least to the 3rd Normalization form or to
BCNF.
- Use understandable names for relations/tables and
attributes/fields.
- Use proper data types and apply DBMS provided restrictions
and rules such as Not Null.
- Use proper naming for Foreign Keys and Relationships.
- Check your design by providing data through DBMS interface
and control the expected outputs by running
some Structured Query Language (SQL) commands on the
provided data.
If you follow an ordinary (structured) methodology, then you would
provide an Entity Relationship Diagram (ERD). You can use this diagramto
provide a normalized data model, afterwards. However, if you follow
object-oriented methodology then you should know how you could map your class
model to an ERD. Most of IDEs and development tools are providing tools,
add-ons, and facilities to help in the mapping process. If you are using one of
these tools then your job is easier. Simply use the facilities that they
provide. However, if you do not have an automated tool to do so, below you can
find some rules of thumb for mapping a class model into an ERD, manually.
Mapping
a Class Diagram into an ERD
- Indicate your persistent class, e.g. by using a persistent
stereotype.
- Create an Entity for any persistent class, giving the name
of the class.
- Map all data members of the class as attributes of the
created Entity.
- Give the same, or equivalent, data type to the attributes.
- Make the class identity (ID) the Primary Key for the
Entity.
- Map associations, aggregations, and compositions to
relationships and use class IDs as Foreign Keys.
- Change generalization/specialization relations of the
class model to superclass/subclass relations and apply
ERD rules, accordingly.
- Map multiplicities of associations to the equivalent
cardinalities in the ERD.
No comments:
Post a Comment