ER Diagram vs Class Diagram
ER (entity-relationship) diagrams and Class diagrams are two of the design diagrams that the software developers create usually during the design phases of the software engineering life cycle. ER diagrams are a product of entity-relationship modeling (ERM) technique for modeling databases. A class diagram, written in Unified Modeling Language, is a diagram that describes the structure of a proposed system. Although there is no requirement to have an exact one to one mapping between the classes in class diagrams and entities in entity diagrams, generally there is some meaningful relationship between them. However, there are plenty of occasions where an entity of an ER diagram maps to multiple classes of the corresponding class diagram or a single class of a class diagram mapping to multiple entities of the corresponding ER diagram. But, this depends entirely on the design choices of the software developers.
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?
类图(更正确地称为UML类图)是一个设计图,代表使用UML(统一建模语言)定义的静态结构和行为。类图显示了系统的类,类之间的关系及其属性。类描述了现实世界对象的抽象表示,而关系描述了每个班级如何与他人连接。类和关系都具有称为属性的属性。类中的方法表示或定义这些类的行为。类的方法和属性称为类的成员。
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.
Leave a Reply