azad
azad

Reputation: 361

Which one is better than another for database Analysis: Class diagram or ERD?

I've used class diagram for analyses database before. but now, I'm thinking different between Class diagram and ERD. which one is completely?

what is different and similarity between these diagram?

Upvotes: 2

Views: 3431

Answers (2)

duffymo
duffymo

Reputation: 308763

Entity/relationship diagrams don't usually have object-oriented concepts like inheritance.

You can think of one-to-one, one-to-many, and many-to-many relationships in terms of object composition HAS-A, but the display is certainly different.

Upvotes: 3

Omid Nazifi
Omid Nazifi

Reputation: 5234

What is ER Diagram?

ER diagrams are the product of entity-relationship modeling. Entity-relationship modeling is the process of coming up with an abstract and conceptual representation of data. ER diagrams ultimately model the databases. More specifically, it produces the conceptual schema of the data model. Main building blocks of ER diagrams are entities, relationships and attributes. An entity represents a thing that can exist independently and that can be defined uniquely. Most often, an entity represents a real world object such as a car or an employee. Entities can be though of as nouns that come up during the description of the problem to be solved. Relationship shows how entities are connected. They are like verbs found in the description of the problem to be solved. Properties of both entities and attributes are called attributes.

What is Class Diagram?

A class diagram (more correctly known as a UML class diagram) is a design diagram that represents the static structure and the behavior of a proposed system, defined using UML (Unified Modeling Language). A class diagram shows the systems’ classes, relationships between classes, and their attributes. Classes depict the abstract representation of real world objects, while the relationships depict how each class is connected to others. Both classes and relationships have properties called attributes. Methods in the classes represent or define the behavior of these classes. Methods and attributes of classes are called the members of the class.

What is the difference between ER Diagram and Class Diagram?

Although ER diagrams and Class diagrams are two of the design diagrams developers often come across during the design phases of software engineering projects, they have their key differences. ER diagrams represent the abstract representation of the data model, while class diagrams represent the static structure and behavior of the proposed system. Main building blocks of ER diagrams are entities, relationships and attributes but the main building blocks of class diagrams are classes, relationships and attributes. Class diagram are more likely to map in to real-world objects, while ER diagrams most often map in to the tables in the database. Usually, relationships found in ER diagrams are more difficult to understand for humans than relationships in class diagrams.

Read more: link1 - link2 - link3

Upvotes: 5

Related Questions