Professional Documents
Culture Documents
Huong Dan PowerDesign15
Huong Dan PowerDesign15
1
Power Designer T Thc Nhu
Thc th
K tha Mi kt hp
Nhnh lin kt
3
Power Designer T Thc Nhu
2- To thc th (Entity)
SINHVIEN
Thuc tnh Kiu d liu Kch thc Ghi ch
MASV Character 10 Thuc tnh kha
TENSV Character 30
NGAYSINH Datetime
PHAI Boolean
DIACHI Character 50
LOPHOC
Thuc tnh Kiu d liu Kch thc Ghi ch
MALOP Character 10 Thuc tnh kha
TENLOP Character 30
SISO Integer
(1) Click chn biu tng thc th, v click vo trong lc . Click phi kt thc.
(2) Khai bo thng tin ca thc th:
Double-click vo thc th, mt ca s mi m ra cho php chng ta chnh sa thng
tin ca thc th nh: tn ca thc th, thuc tnh ca thc th, cc rule,.
4
Power Designer T Thc Nhu
Th General:
Name Tn thc th. Tn ny hin th trn m hnh
Code Tn tt ca thc th. Tn ny c dng khi chuyn sang CSDL vt l
Comment Din gii v thc th
Number S mu tin s lu tr trong thc th
Generate table c chn nu entity s c chuyn thnh table trong PDM
Th trang Attributes : Khai bo thuc tnh ca thc th
(1) Click chn biu tng Association, v click vo trong lc . Click phi kt thc.
(2) Khai bo thng tin ca mi kt hp: ging nh khai bo thng tin ca thc th.
(3) V nhnh lin kt gia thc th v mi kt hp: Click chn biu tng Link, ko th t
thc th n mi kt hp. Click phi kt thc.
(4) Khai bo bn s (Cardinality) mi nhnh ca mi kt hp: Double click vo ng Link.
Chn hay nhp bn s trong mc Cardinality.
Role :Nhn din gii
vai tr ca link
Identifier: c
chn nu thc th
c kt ni l thc
th ph thuc bi
mt thc th khc
Cardinality: Bn s
mi nhnh ca mi
kt hp.
6
Power Designer T Thc Nhu
4- Khai bo mi kt hp qui:
V d: Khai bo MKH th hin quy tc mi mn hc c th c mt hay nhiu mn hc tin
quyt cn hc trc:
7
Power Designer T Thc Nhu
6- Khai bo mi kt hp cp 2:
V d bn cn biu din mi kt hp cp 2 KETQUAHOCTAP lin kt gia thc th
SINHVIEN, LANTHI, v mi kt hp CHUONGTRINHHOC nh m hnh v tay nh sau:
Cc bc thc hin:
(1) To cc thc th v mi kt hp nh s sau:
8
Power Designer T Thc Nhu
Bn ch cn chn Tools Check Model v b chn khng cho kim tra 2 c trng ny.
9
Power Designer T Thc Nhu
10
Power Designer T Thc Nhu
Property Description
Name Tn gi ca MKH inheritance
Code M ca MKH inheritance
Parent Tn ca loi thc th cha
Mutually Ch nh mt thc th cha ch tng ng vi mt thc th con.
exclusive V d: Loi thc th Person c 2 loi thc th con l Male v Female, mi thc th
children Person hoc l Male hoc l Female.
Chn la ny ch th hin trn h s thit k ch khng th hin khi chuyn sang PDM.
Trang Generation :
Ch nh cch thc chuyn i cu trc k tha sang m hnh PDM
11
Power Designer T Thc Nhu
12
Power Designer T Thc Nhu
Trng hp bn chn c 2:
Khi chuyn sang PDM, Kha chnh ca bng con c kt hp (concatenation) bi thuc tnh
nhn dng ca thc th cha v ca thc th con.
13
Power Designer T Thc Nhu
IV- KIM TRA M HNH:
(1) Chn Tools Check
Model (F4).
Xut hin hp Check
Conceptual Data Model
14
Power Designer T Thc Nhu
Trng hp m hnh c li, bn c th xem chi tit thng bo li hoc chuyn nhanh n i
tng b li bng cch: click phi vo dng thng bo trong hp thoi Result List v chn:
(1) Detail xem chi tit li
(2) Correct m ca s thuc tnh ca i tng b li chnh sa.
(3) Recheck kim tra li m hnh sau khi hiu chnh
V- NH DNG M HNH:
Mc ch thay i hnh thc hin th ca cc i tng bn trong m hnh
Chn ToolsDisplay Preferences
Trong mc Content: Ch nh cc thng tin thuc tnh cn hin th trn mi loi i tng.
Trong mc Format: chn loi i tng, click nt Modify nh dng mu sc, Font ch
cho mi loi i tng.
15
Power Designer T Thc Nhu
16
Power Designer T Thc Nhu
(3) Trang Detail, ch nh cch
t tn Table, cc rng
buc kha chnh, kha ph,
kha ngoi
17
Power Designer T Thc Nhu
VII- TO REPORT:
1- To bo co cc thnh phn ca m hnh bng Report wizard:
(1) M m hnh cn to bo co
(2) Chn Report Report Wizard (CtrlF12). Ln lc khai bo theo tng hp thoi
Hp thoi 1:
t tn report
Chn ngn ng
Hp thoi 2:
Chn nh
dng cho bo
co, file RTF
hoc HTML.
Chn mu
trnh by bo
co
18
Power Designer T Thc Nhu
Hp thoi 3:
Chn thng tin
cn bo co.
Hp thoi 4:
Chn cc i
tng m hnh cn
bo co
19
Power Designer T Thc Nhu
Hp thoi 5:
Preview :
xem trc ni
dung bo co
M mn hnh
thit k bo
co
To file cha
bo co
2- M Report:
Click phi vo tn Report v chn hnh thc :
- Open Diagram: M mn hnh chn la cc i tng cn hin trn bo co. Trn khung
Available Items, Click phi vo i tng cn thm vo Report v chn ADD.
- Generate (HTML hay RTF) dng to file cha bo co.
20
Power Designer T Thc Nhu
(3) Nhn nt
Add Data
Source, ca
s Create
Data Source
xut hin.
21
Power Designer T Thc Nhu
(4) Chn kiu
data source
22
Power Designer T Thc Nhu
(6) Nhn nt
Finish, xut
hin ca s
Create a
new data
source to
SQL Server
- Name: Nhp
tn Data
Source
- Description
khng cn
phi in,
- Server: chn
tn server
(7) Nhn nt
Next, sang
ca s chn
kiu kt ni
n SQL
Server:
23
Power Designer T Thc Nhu
(8) Nhn nt
Next, sang
mn hnh
cho php ch
nh CSDL
cn kt ni:
(9) Ch nh
CSDL cn
kt ni v
nhn tip nt
Next
24
Power Designer T Thc Nhu
(10) mc
nh cc gi
tr ta tip
tc.
Nhn
Finish, th
ca s
ODBC
Microsoft
SQL Server
Setup xut
hin nh
sau:
25
Power Designer T Thc Nhu
(12) Sau ta nhn nt OK lin
tip nhau quay v mn hnh
Connect ban u.
(13) Click nt
Ok
Bc 3:
Chn DatabaseGenerate Database (Ctrl + G), ca s Database Generation xut hin, ca
s ny cho php chng ta la chn mt s tham s cn thit trc khi to database:
26
Power Designer T Thc Nhu
Chn kiu to : To file script cha cc lnh to cc i tng trong CSDL hoc to trc tip
CSDL
27
Power Designer T Thc Nhu
CC I TNG TRONG M HNH QNDL:
Bao gm cc i tng sau:
Object Description
Domain Min gi tr ca mt mc d liu
Data item n v c bn ca thng tin
Entity Person, place, thing, or concept that has characteristics of interest to the
enterprise and about which you want to store information
Entity attribute Elementary piece of information attached to an entity
Relationship Named connection or association between entities
Inheritance link Special relationship that defines an entity as a special case of a more
general entity
28
Power Designer T Thc Nhu
29
Power Designer T Thc Nhu
Ph lc 1: CC KIU D LIU CHUN (Standard Data Types):
1- Numeric data types
Conceptual Code in What it stores Translation example
data type DEF file for SQL Anywhere
Integer I 32-bit integer integer
Short Integer SI 16-bit integer smallint
Long Integer LI 32-bit integer integer
Byte BT 256 values smallint
Number N Numbers with a fixed decimal point numeric
Decimal DC Numbers with a fixed decimal point decimal
Float F 32-bit floating decimal numbers float
Short Float SF Less than 32-bit floating decimal number real
Long Float LF 64-bit floating decimal numbers double
Money MN Numbers with a fixed decimal point numeric
Serial NO Automatically incremented numbers numeric
Boolean BL Two opposing values (true/false; yes/no; 1/0) numeric(1)
2- Character data types
Conceptual data type Code in What it stores Translation example
DEF file for SQL Anywhere
Characters A Character strings char
Variable Characters VA Character strings varchar
Long Characters LA Character strings varchar
Long Var Characters LVA Character strings long varchar
Text TXT Character strings long varchar
Multibyte MB Multibyte character strings char
Variable Multibyte VMB Multibyte character strings varchar
3- Time data types
Conceptual data Code in What it stores Translation example for
type DEF file SQL Anywhere
Date D Day, month, year date
Time T Hour, minute, and second time
Date & Time DT Date and time timestamp
Timestamp TS System date and time timestamp
4- Other data types
Conceptual Code in What it stores Translation example
data type DEF file for SQL Anywhere
Binary BIN Binary strings binary
Long Binary LBIN Binary strings long binary
Image PIC Images long binary
Bitmap BMP Images in bitmap format (BMP) long binary
OLE OLE OLE links long binary
Other * User-defined data type char(10)
Undefined <UNDEF> Not yet defined data type <undefined>
30
Power Designer T Thc Nhu
31
Power Designer T Thc Nhu
32
Power Designer T Thc Nhu
Tn h QT xut hin thanh trng thi
II- 3.2 Khai bo cc c trng ca Table:
Bm p vo k hiu Table hin Table Properties.
ngha:
Property Description
Model Tn m hnh
Origin Tn thc th tng ng trong m hnh CDM
Name Tn Table
Code Tn tham chiu cho table
Label Nhn m t table
Number S dng c th c trong Table. Dng tnh ton kch thc CSDL
Primary key Tn rng buc kha chnh
constraint name
User-defined Biu th tn rng buc l do User t t
Generate table Ch nh to Table trong CSDL
3.3 Thay i danh sch thuc tnh trong table:
Click chn nt Columns
33
Power Designer T Thc Nhu
34
Power Designer T Thc Nhu
36
Power Designer T Thc Nhu
Creation parameters indicate what to generate from the database structure defined by the PDM.
The availability of these parameters depends on the target database. Unavailable parameters display
in gray and you cannot select them.
Drop table If table exists, drop table before creating new table
37
Power Designer T Thc Nhu
Alternate key Generate alternate key index
Other indexes Generate indexes for all key columns with a defined index
Drop index If index exists, drop index before creating new index
Drop view If view exists, drop view before creating new view
Creation parameters indicate what to generate from the database structure defined by the PDM.
The availability of these parameters depends on the target database. Unavailable parameters display
in gray and you cannot select them.
Database parameters
38
Power Designer T Thc Nhu
Drop database If database exists, drop database before creating new database
Drop tablespace If tablespace exists, drop tablespace database before creating new tablespace
Drop storage If storage exists, drop storage before creating new storage
Check Generate check parameters and validation rules for user-define data type
Drop data type If data type exists, drop data type before creating new data type
39
Power Designer T Thc Nhu
S dng cc bng thuc tnh
Bng thuc tnh biu din cc c trng ca cc Object trong PowerDesign
Tiu ca property sheet ghi nh danh ca i tng hin th.
V d: Model Properties hay Table Properties.
Hu ht cc Property sheet u nhm cc properties trn trang:
Definition, Description, Annotation
hin Property sheet ca mt i tng:
- Double click k hiu object trong model hoc
- Click nt Property v click vo k hiu ca object .
cng nhn nhng thay i trn Property sheet th Click nt Apply / Ok. Ngc li click
nt Cancel.
nh danh n
t tn v m cho model.
After you create a model, you can enrich its definition by entering properties and associating objects.
To create a model:
To consolidate a model:
To save a model in a dictionary, you consolidate it.
1 Select FileConsolidate.
The Metaworks window opens and a Connect dialog box appears.
2 Type connection parameters.
3 Click OK.
A Consolidation dialog box appears.
4 Verify model information.
If necessary, type changes to model information.
5 Click OK.
When a dictionary stores a model, you open it by extracting it from the dictionary.
To extract a model:
1 Select FileExtract.
2 Type connection parameters.
3 Click OK.
An Extraction dialog box appears.
4 Select a project from the Project Name list.
Select PDM from the Model Type list.
41
Power Designer T Thc Nhu
Select a model name from the Model Name list.
Type a destination file name for the model.
Type a destination directory for the model.
5 Click OK.
The model window displays the selected model.
2- Creating a Model
A model is the basic work unit in PowerDesigner. Every model is contained within a workspace, and
contains at least one diagram and any number of other objects. Though a model may be split into
packages for organizational reasons or may contain several diagrams, it remains the fundamental
basis for your modeling work.
Creating a project
A project can provide a convenient environment for working with multiple interconnected models
and other files. For detailed information about working with projects, see the Projects and
Framework Matrices chapter.
Creating a model
To create a model
The following table lists the PowerDesigner models that you see in the Model type pane:
42
Power Designer T Thc Nhu
File Backup
Icon Model definition
ext ext
Requirements Model. An RQM is a textual model, which can be used to list
and explain all the customer needs that must be satisfied during a development .rqm .rqb
process
Enterprise Architecture Model. An EAM analyzes high level functions,
.eam .eab
processes, and flows for your organization
Business Process Model. A BPM allows you to identify processes and atomic
.bpm .bpb
tasks and organize them in a hierarchy that you can then implement
Conceptual Data Model. A CDM represents the overall structure of a database,
.cdm .cdb
which is independent of any software or data storage structure
Logical Data Model. An LDM provides a DBMS-neutral picture of a database. .ldm .ldb
Physical Data Model. A PDM specifies the physical implementation of the
.pdm .pdb
database
Information Liquidity Model. An ILM is a design tool to make replication
.ilm .ilb
engine design and configuration easier to use
Object Oriented Model. An OOM uses UML diagrams to let you design a
static conceptual model of a software system using an object-oriented .oom .oob
approach for Java or other object languages
XML Model. An XSM is a graphic representation of an XML file that
.xsm .xsb
provides a global and schematic view of all its elements
Free Model. A FEM allows you to create any kind of chart or diagram, in a
.fem .feb
context-free environment
Multi-Model Report. Not a model, but an automated report that covers more
.mmr .bmr
than one model
Saving a model
Each model is saved in a separate file, with an extension specific to its model type. When you save a
model, PowerDesigner also automatically creates a backup copy.
or
or
43
Power Designer T Thc Nhu
2. Right-click the model and select Close.
44