E-r Diagram of UML

Source: Internet
Author: User

The e-r graph , also known as the entity-contact graph (Entities Relationship Diagram), provides methods for representing entity types, attributes, and connections to describe the conceptual model of the real world.

1 , Presentation method

E-r is an effective method to describe the conceptual structure model of the real world. is a way to represent a conceptual model.

(1) Rectangle: Indicates the entity type, the name of the entity is indicated in the rectangle box;

(2) Ellipse: represents the attribute of the entity, and connects it with the corresponding entity type without a forward edge;

(3) Diamond: Indicates the relationship between the entity type, the contact name is indicated in the Diamond box, and the non-oriented side is connected with the entity type respectively, and the type of contact on the non-Edge side label (1:1,1:N or M:N).

2 , composition

There are four components in the ER diagram:

(1) Rectangle box: Represents the entity, and the entity name is entered in the box.

(2) Diamond box: Indicates a contact, and the contact name is entered in the box.

(3) Oval box: A property that represents an entity or contact, and the property name is entered in the box. For the primary property name, underline it under its name.

(4) Connection: between entity and attribute; Contact and attribute are connected by a straight line and the type of contact is marked on a line.

3 , e-r entity Relationship Model

Most database design products use the entity-Contact model (ER model) to help users with database design. This data model is typically used in the first phase of information system design, such as the types of information that they use to describe information needs and/or to be stored in the database during the requirements analysis phase. But data modeling techniques can be used to describe any ontology (that is, the area of interest) of a particular domain (that is, an overview and classification of the terms used and their linkages). In the case of database-based information system design, in the latter phase (usually called logical design), the conceptual model is mapped to a logical model such as a relational model, which in turn is mapped to the physical model during physical design.

Note that sometimes these two phases are collectively referred to as "physical design."

4 , composition elements

basic elements : Entity type, attribute, and contact, which are represented by:

(1) Solid Type (entity): Entities with the same attributes have the same characteristics and properties, with the entity name and its set of attribute names to abstract and characterize similar entities ; In the E-r diagram, a rectangle is used to indicate the entity name in the rectangle, such as a student entity. If it is a weak entity, a solid line rectangle is then set outside the rectangle.

(2) Properties (Attribute): An entity has an attribute that can be characterized by several attributes. In the E-r diagram, it is represented by an ellipse , and it is connected with the corresponding entity by a non-edge, such as the student's name, school number, gender, and all attributes. If it is a multivalued attribute, then a solid ellipse is set outside the ellipse. If it is a derived property, it is represented by a dashed ellipse.

(3) Contact (relationship): relations are also referred to as relationships, and the information world reflects the linkages between entities within or between entities. Relationships within entities usually refer to the linkages between the attributes that make up the entity, and the relationships between entities usually refer to the linkages between different entity sets. In the E-r diagram, a diamond is used to indicate the contact name in the diamond frame, and the non-forward side is connected with the relevant entity, and the type (1:1,1:n or m:n) of the contact on the non-edge side label. For example, the teacher to teach students there is a teaching relationship, students choose the course there is the relationship between selection. In the case of a weak entity, the diamond is then set outside the diamond.

5 , drawing steps

(1) Determine all the entity sets;

(2) Select the attributes that the entity set should contain;

(3) Determining the linkages between entity sets;

(4) Determine the keyword of the entity set, underline the attribute combination of the keyword on the attribute;

(5) Determine the type of contact, the type of contact is indicated on the line when connecting the diamond frame that represents the link to the entity set;

6 , design steps

The first step, the investigation and analysis

(1) Select the local application in the demand analysis stage, through the application of the environment and requirements of detailed investigation and analysis, with multi-layer data flow chart and the database of the whole system described.

The first step of designing the E-r diagram is to select an appropriate level (experience is important) in the multi-layer data flow chart according to the specific situation of the system, so that each part of this group corresponds to a local application, we can design the E-r graph with this level of traffic graph as the starting point. Generally speaking, the middle-level data flow chart can reflect the subsystem composition of each local application in the system, so people often use the middle-level flow chart as the basis of the design e-r graph.

(2) Each design of the sub-e-r diagram each local application corresponds to a set of data flow diagram, the local application of the information involved in the data has been collected in the dictionary. This is to extract the data from the data dictionary, referencing the entity in the local application, the attribute of the <2> entity, the code,<3> identifying the entity, and the type of the entity (1:1, 1:n, m:n).,<1>

<1> calibrating entities in a local application a group of objects with certain common characteristics and behaviors can be abstracted as an entity in the real world. The relationship between the object and the entity is ' member of '. For example, in a school environment, objects such as Zhang San can be abstracted as student entities. The constituent components of an object type can be abstracted as attributes of an entity. The relationship between the composition and the object type is ' part of '. For example, student numbers, names, majors, grades, etc. can be abstracted into the attributes of students ' entities. The number is the code that identifies the student entity.

The attributes of the <2> entity, the code that identifies the entity are actually relative to the attribute, and it is difficult to have a completely divided boundary. The same thing, as an "attribute" in one application environment, must be "entity" in another application environment. In general, in a given application environment: the ⑴ property can no longer have the properties that need to be described. That is, the attribute must be a data item that is not divided. The ⑵ property cannot be associated with other entities. The contact only occurs between entities.

<3> determine the relationships between entities and their types (1:1, 1:n, m:n). According to the demand analysis, we should investigate whether there is any connection between the entities, there is no redundant connection.

Step Two, Merge Builds

There are three main types of conflicts between E-r charts: attribute conflicts, naming conflicts, and structural conflicts.

1. Property Conflicts:

(1) Domain conflicts, that is, the type of the property value, the range of values, or the collection of values is different. For example, the attribute "part number" is defined as a character type, and some is a numeric type.

(2) attribute value Unit conflict. For example: The property "weight" some in grams, some in kilograms units.

2. Naming conflicts:

(1) The same name is different. Different meaning objects have the same name.

(2) synonyms (more than one name). The same meaning object is not the same name. "Projects" and "topics"

3. Structure conflict:

(1) The same object has different abstractions in different applications. For example, a "course" is treated as an entity in a local application and is considered an attribute in another local application.

(2) The same entity does not have exactly the same attributes in different detail views, or the order of the attributes is not identical.

(3) The relationships between entities render different types in different detail views. For example, the entity E1 and E2 are many-to-many links in local application A, but in the local application B is a one-to-many connection, as in the local application of x E1 with E2, and in the local application of Y E1, E2, E3 between the three are connected. The workaround is to synthesize or adjust the type of entity contact based on the semantics of the application.

The third step, Modify Refactoring

A preliminary e-r diagram is generated by merging the E-r diagram of the basic e-r graph. This is referred to as the preliminary e-r diagram because there may be redundant data and a redundant relationship between entities, that is, data that can be exported from basic data and connections that can be exported by other contacts. Redundant data and redundant links can easily destroy the integrity of the database, to increase the difficulty of database maintenance, so the preliminary e-r map, you should further check whether there is redundancy in the E-r diagram, if there is, should try to eliminate. Revise and reconstruct preliminary e-r diagram to eliminate redundancy, mainly using analysis method. In addition, the normalization theory can be used to eliminate redundancy.

E-r Diagram of UML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.