Iii. Concept Data Model CDM (conceptual database model)

Source: Internet
Author: User

 

Which of the following statements is correct:

Script 1:

. Set_value (_ first, true, new)
. Foreach_part (% name % ,"'#'")
. If (% _ first %)
. Delete (% currentpart %)

. Enddelete
. Set_value (_ first, false, update)
. Else
% Currentpart %
. Endif
. Next

In this example, the content behind # Of the name content is treated as code.

 

Script 2:

. Set_value (_ first, true, new)
. Foreach_part (% name % ,"'#'")
. If (% _ first %)
% Currentpart %
. Set_value (_ first, false, update)
. Endif
. Next

In this example, the content in front of # of name content is treated as code.

 

In addition, it is best to enable the automatic name/code copy function when using this function. Tool -- genneral -- Options dialog -- name to code injection ing. This is enabled by default.

 

 

 

1. Introduction to conceptual data models

Conceptual Data Model: conceptual data model, which is based on the entity-relationship (E-R) theory and is expanded. It models information from the user's point of view and is mainly used for Conceptual Design of databases.

 

Generally, people first abstract the real world into a conceptual world, and then convert the conceptual world into a machine world. In other words, objective objects in the real world are first abstracted as entities and relationship. They do not depend on a specific computer system or a DBMS system, this model is what we call CDM, and then converts CDM to the data model supported by a DBMS on the computer. This model is the physical data model, that is, PDM.

CDM is a set of strictly defined model elements that accurately describe the static characteristics, dynamic characteristics, and integrity constraints of the system, it consists of three parts: data structure, data operation, and integrity constraint.

1) Data structures are expressed as entities and attributes;

2) The data operation table is the insert, delete, modify, query, and other operations of records in the entity;

3) integrity constraints are expressed as integrity constraints of data (such as data types, checks, rules, and so on) and referential integrity constraints between data (such as links and inherited links)

 

 

Ii. Example

4.1 select file --> new. In the displayed dialog box, select CDM model (Conceptual Data Model) to create a model.

 

4.2 create a conceptual data model. To give a brief introduction to the current workspace.

 

4.3 select the newly added CDM model, right-click it, and select "properties" from the pop-up menu. the pop-up dialog box is displayed.In the "General" label, you can enter the name of the created model,Code, Description, creator, version, and default chart. Enter the description and description in the "Notes" tab. For more tags, click "More>.

5. Define entities

5.1 create an object

1) in the CDM graphic window, click entity tool on the tool option edition, and then click a blank area in the graphic window. An entity symbol is displayed at the clicked position. Click the pointer tool or right-click to release the entitiy tool.

2) double-click the newly created object symbol to open the following icon window. In the "General" tab of the window, you can enter the object name, code, description, and other information.

Name: identifies an object in the model and is generally used for displaying the model on the interface (this can be changed by changing the option settings ). In a model, Entity names cannot be repeated.

Code: This is generally used as the physical name of an object during model conversion. For example, you can convert the code of an object attribute to a column name in the database.

Generate: the default state is selected. If the State is canceled, this entity is ignored when it is converted to another model.

 

5.2 add Object Attributes

1) You can add attributes to the "attribute" option tag in the preceding window, as shown in.

Note:

The "add attribute" and "reuse existing data items" functions in the data item are related to the unique code of the data item in the model and the allow reuse option.

The P column indicates whether the property is the primary identifier;

Column D indicates whether the property is displayed in the graphic window;

The m column indicates whether the attribute is mandatory, that is, whether the column is null.

 

If an object property is mandatory, it must be assigned a value in each record and cannot be blank.

Click "crtl + u" to call out the "Custom column filter" window. You can select the ones listed in the window and hidden ones based on your preferences and actual needs. Use the shortcut key "crtl + E" to allow or disable the current filter.

 

2) In the displayed window, click the insert attribute button to bring up the attribute dialog box, as shown in.

 

5.3 check constraints for defining attributes

1) Standard inspection of defining attributes

The standard check constraint is a set of expressions that ensure the attribute is valid. In the Properties window of object properties, open the check tab.

On this tab, you can define the standard check constraints for attributes. The meanings of parameters in the window are as follows:

Parameters

Description

Minimum

Acceptable minimum number of attributes

Maximum

Maximum number of acceptable attributes

Default

Default value provided by the system when the attribute is not assigned a value

Unit

Units, such as kilometers, tons, and Yuan

Format

Attribute data display format

Lowercase

All attribute values are lowercase letters.

Uppercase

All values assigned to an attribute are uppercase letters.

Cannot modify

This attribute cannot be modified once it is assigned a value.

List of Values

Attribute Value assignment list. No value exists except the value in the list.

Label

Label of attribute List Value

 

2) additional checks for defining Properties

When standard checks or rules cannot meet the requirements of the check, you can go to the server subpage on the additional checks tab, use the variables % MINMAX %, % listval %, % rules %, % upper %, and % lower % in SQL statements to define standard and rule,

% MINMAX %, % listval %, % upper %, % lower %:

Minimum and maximum, list values, uppervalues, and lowervalues defined in standard check

% Rules %:

Validity rule expression defined on the Expression tab of the Rules Properties window

 

Vi. identifier

An identifier is a set of one or more attributes of an object. It uniquely identifies an instance in an object. It should be emphasized that the identifiers in CDM are equivalent to primary keys or candidate keys in PDM. Each entity must have at least one identifier. If an object has only one identifier, it is the primary identifier of the object. If an object has multiple identifiers, one of them is specified as the primary identifier, and the other identifiers are secondary identifiers.

 

6.1 define primary and secondary identifiers

1) double-click an object to display the object Properties dialog box. You can define object identifiers on the identifiers tab. As shown in

2) Select "primary identifier" in the first line, click the attribute button, or double-click "primary identifier" in the first line. The Properties dialog box is displayed,

 

3) Select the "attributes" tab and click "add attributes". In the displayed window, select an attribute as the identifier.

 

VII. Data items

A data item is the smallest unit of information storage. It can be attached to an object as an attribute of an object.

Note: Data items that are not attached to any entity are allowed in the model.

 

7.1 create a data item

1) use the "model" ---> data items menu to display the list of existing data items in the window that appears. Click "add a row" to create a new data item,

 

2) Of course, you can continue to set the code, ype, length, and other information for specific data items. This is not detailed here.

 

7.2 unique code options and reuse options for data items

Use tools ---> modeloptions-> model settings. In the data item group box, define the unique code option (unique code) and reuse option (allow reuse) of the data item ).

 

Note:

If the unique code check box is selected, each data item has a unique code in the same namespace, and allow reuse is selected, a data item can act as the attribute of multiple entities.

 

7.3 add data items to an object

1) double-click an object symbol to open the object attribute window.
2) Click the attributes tab to open the window as shown in

Note: The difference between add adataitem and reuse adataitem is that

When you add a dataitem, select an existing data item. The system automatically copies the selected data item. If the uniquecode option is set, the system automatically generates a unique number for the code of the new data item during the replication process. Otherwise, the code is exactly the same as the selected data item.

  In the case of reuse a dataitem, only references do not add, that is, references existing data items as new object data items.

 

8. Contact

Relationship refers to the connection between the entity set and the instances in the entity set.

  Entities can be associated by association. It corresponds to an object and an object set. A link can also be divided into a link and a contact set. A contact set is a link between an object set, and a link is a link between entities, which is oriented. A contact and a contact set can be referred to as a contact if the meaning is clear.

 

There are four types of links according to the number of instances in the entity type:

One-to-one contact,

One to multiple connections,

Associate to one

Associate to associate ).

 

8.1 establish contacts

In addition to public tools, the CDM tool option Board also includes other object generation tools as shown in.

 

After creating two entities in the graphic window, click the "Create contact between entities" tool, click an entity, drag the cursor to another entity while pressing the left mouse button, and release the left mouse button, in this way, the contact is created between the two entities, right-click the graph window, and release the relationship tool. As shown in

After establishing a contact between the two entities, double-click the contact line to open the contact feature window ,.

 

8.2. four basic connections

One-to-one (one-to-one), one-to-many (one-to-one), multiple-to-one (manyto-one), and many-to-many (one-to-many ).

8.3. Other Special contacts

 

In addition to four basic connections, there are also identify relationship, non-standard relationship, and recursive relationship between the entity set and the entity set ).

8.3.1 calibration contact and non-calibration contact:

Each object type has its own identifier. If there is a link between two entity sets, when one entity type identifier enters another entity type and forms its identifier together with the entity type identifier, this kind of contact is called a calibration contact or a dependency contact. The opposite is called non-standard or non-dependent contact.

 

Note:

In a non-standard relational system, some instances in an entity set depend on instances in another instance set. In this dependency relationship, each entity must have at least one identifier. In the calibration contact, all instances in one entity set depend entirely on instances in another entity set. In this dependency relationship, one entity must have at least one identifier, another entity does not have its own identifier. An entity without an identifier uses its dependent entity identifier as its own identifier.

In other words, in the calibration contact, an entity (Course Selection) depends on one entity (student), then the entity (student) must have at least one identifier, and (Course Selection) an entity may not have its own identifier. An entity without a logo identifier can use the entity (student) identifier as its own identifier.

 

8.3.2 recursive contact:

Recursive link is a link between instances in the entity set. It is usually called an anti-link. The link between different entity sets in the same object type is also called recursive link.

 

For example, there are many employees in the "employees" entity, and there must be a relationship between the leaders and the leaders. Another example is that the entity in the "student" entity contains the "class monitor" and "common student" child body sets. The link between the two child body sets is a recursive link. When creating a recursive link, you only need to click the "Create link between objects" tool to drag a part of the object to another part of the object.

Contact symbol description:

In power designer, a hyphen (horizontal) near the object represents a mandatory constraint, and a hollow circle represents no mandatory constraint, that is, this party can have no object Association; the "non-branch" line represents the relationship of "1", and the "branch" line represents the relationship of "many. The above four symbols can combine 16 types of relationships (including reverse ). Among them, "many to many" relationship 1Therefore, in many concept diagrams, the actual "many to many" relationship does not exist.

 

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.