СУБД Oracle / Литература / PowerDesigner 9 / CDM_Tutorial
.pdfC H A P T E R 4
'HILQLQJ %XVLQHVV 5XOHV 'RPDLQV DQG 'DWD ,WHPV
About business rules
About data items
About domains
A EXVLQHVV UXOH is a written expression of the way a business operates. When you create a business rule, you refer to the ideas set out in the business description.
There are six types of business rules: facts, definitions, formulas, validations, requirements and constraints:
7\SH RI |
|
|
EXVLQHVV UXOH |
([DPSOH |
|
Fact |
A publisher may publish one or more titles |
|
Definition |
An author is identified by a name and an address |
|
Formula |
The amount of royalties is a percentage of the sales which |
|
|
increases according to the amount of sales |
|
Validation |
The percentage of royalties paid to all authors of a book must |
|
|
add up to 100% of the royalties |
|
Requirement |
The model is designed so that total amount of royalties do |
|
|
not exceed 10% of total sales |
|
Constraint |
The sales start date should be inferior to the end date of the |
|
|
publishing process |
|
|
|
When you use business rules to document the CDM, they are not translated into executable code. Business rules can be implemented as constraints in the PDM.
A GDWD LWHP is an elementary piece of information. For example, this CDM contains data items for author last name and for book titles.
A GRPDLQ defines a standard data structure that you can apply to multiple data items. When you modify a domain you globally update the data items associated with the domain. This makes it easier to standardize data characteristics and modify your model consistently when you need to make changes.
CDM Getting Started |
|
&UHDWH D QHZ EXVLQHVV UXOH
About check parameters
What you will do
&KHFN SDUDPHWHUV specify more precisely what values to allow for a domain or a data item. In a CDM, check parameters define standard parameters, such as minimum, maximum, or accepted values.
In this chapter you will:
♦Create a new business rule
♦Create a domain
♦Create a data item
♦Attach a data item to a domain
+RZ ORQJ ZLOO LW WDNH"
About 20 minutes.
PowerDesigner
&KDSWHU 'HILQLQJ %XVLQHVV 5XOHV 'RPDLQV DQG 'DWD ,WHPV
&UHDWH D QHZ EXVLQHVV UXOH
You will create a business rule that states how to attribute royalties to authors.
1Select 0RGHO→%XVLQHVV 5XOHV.
The List of Business Rules dialog box displays existing business rules.
2Click the $GG D 5RZ tool.
An arrow appears at the start of the first blank line and a default name and code are entered.
$ GHIDXOW QDPH DQG FRGH DSSHDU
When you create a new list item, a default name and code automatically appear for the new item. If the default name is selected it disappears when you start to type the item name. If the default name is not selected, select it and either type the new item name, or delete the default name before typing the new item name.
3Type $XWKRU 3HUFHQW in the Name column.
This is the name of the business rule. The equivalent code is entered in the Code column automatically.
CDM Getting Started |
|
&UHDWH D QHZ EXVLQHVV UXOH
4 Select 9DOLGDWLRQ from the dropdown list in the Rule Type column.
5XOH W\SH FROXPQ LV QRW YLVLEOH
If the rule type column is not visible, click the Customize Columns and Filter tool from the toolbar. A selection box appears listing all the columns displayed in the list. Select the appropriate checkbox for the column that is not displayed, then click OK. The column appears in the list.
This defines the business rule as a validation rule.
5Click $SSO\.
The creation of the new business rule is committed.
1DPHV VRUWHG DOSKDEHWLFDOO\
When you click $SSO\ or 2., all names in the list are sorted alphabetically. The order of appearance of the names in the list will therefore change.
6Click the new business rule line.
An arrow appears at the beginning of the line.
7Click the 3URSHUWLHV tool.
RU
Double click the arrow at the beginning of the line.
|
PowerDesigner |
&KDSWHU 'HILQLQJ %XVLQHVV 5XOHV 'RPDLQV DQG 'DWD ,WHPV
The property sheet for the new business rule appears.
8Click the Notes tab.
The Notes page appears opened to the Description box.
9In the Description box, type 7KH SHUFHQWDJH RI UR\DOWLHV SDLG WR DOO DXWKRUV RI D ERRN DGGV XS WR RI WKH WRWDO UR\DOWLHV.
This text explains the meaning of the business rule.
CDM Getting Started |
|
&UHDWH D QHZ EXVLQHVV UXOH
10Click 2. in each of the dialog boxes.
This validates the creation of the business rule.
What you learned In this section, you learned how to:
♦Use the statement of the business problem to create the description of the business rule
♦Create a business rule
♦Identify a business rule by a name, a code, and a type
|
PowerDesigner |
&KDSWHU 'HILQLQJ %XVLQHVV 5XOHV 'RPDLQV DQG 'DWD ,WHPV
&UHDWH D GRPDLQ
You will create two domains that will define a standardized data type for money amounts and for percentages in the model.
1Select 0RGHO→'RPDLQV from the menu bar.
The List of Domains dialog box displays the existing domains.
2Click the $GG D 5RZ tool.
An arrow appears at the start of the first blank line and a default name and code are entered.
3Type $PRXQW in the 1DPH column.
This is the name of the domain. The equivalent code is entered in the Code column automatically.
4Click $SSO\.
The creation of the domain is committed.
1DPHV VRUWHG DOSKDEHWLFDOO\
When you click $SSO\ or 2., all names in the list are sorted alphabetically. The order of appearance of the names in the list will therefore change with either of these operations.
CDM Getting Started |
|
&UHDWH D GRPDLQ
5Click the domain line.
An arrow appears at the beginning of the line.
6Click the 3URSHUWLHV tool.
RU
Double click the arrow at the beginning of the line. The property sheet for the domain appears.
7Click the Question Mark button next to the 'DWD 7\SH dropdown listbox.
The 6WDQGDUG 'DWD 7\SHV dialog box appears. You use this dialog box to specify the form of the data affected by the domain.
8Click the 0RQH\ radio button.
The domain now has a money data type. A money data type stores numbers with a fixed decimal point. Later, when you apply this domain to the data items that are used to store amounts of money, you will see that they inherit this data type.
'DWD W\SH FRGHV
All data types have a one, two, or three letter code. When you select the Money radio button, MN appears in the Code box. This is the code for a money data type.
|
PowerDesigner |
&KDSWHU 'HILQLQJ %XVLQHVV 5XOHV 'RPDLQV DQG 'DWD ,WHPV
9Type in the /HQJWK box.
The maximum number of figures in a data item attached to this domain will be 8.
10Type in the 3UHFLVLRQ box.
A data item attached to this domain can take two positions after the decimal point.
11 Click 2..
CDM Getting Started |
|
&UHDWH D GRPDLQ
You return to the domain property sheet. The value MN8,2 appears in the Data Type dropdown listbox. MN is the code for a money data type. Eight indicates that an amount of money can have 8 figures. Two indicates that the amount has a decimal precision of 2.
12Click OK.
You return to the List of Domains.
13Click the $GG D 5RZ tool.
An arrow appears at the start of the first blank line and a default name and code are entered.
14Type 3HUFHQW in the 1DPH column.
This is the name of the domain. The equivalent code is entered in the Code column automatically.
15Click $SSO\.
The creation of the domain is committed.
16Click the domain line.
An arrow appears at the beginning of the line.
|
PowerDesigner |