You are on page 1of 116

Sybase®

PowerDesigner®
Conceptual Data Model

Getting Started

Version 9.0
38085-01-0900-01
Last modified: November 2001
Copyright © 2001 Sybase, Inc. All rights reserved.
Information in this manual may change without notice and does not represent a commitment on the part of
Sybase, Inc. and its subsidiaries.
Sybase, Inc. provides the software described in this manual under a Sybase License Agreement. The software may
be used only in accordance with the terms of the agreement.
No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic,
mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc.
Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of
DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.
Sybase, SYBASE (logo), ADA Workbench, Adaptable Windowing Environment, Adaptive Component Architecture,
Adaptive Server, Adaptive Server Anywhere, Adaptive Server Enterprise, Adaptive Server Enterprise Monitor,
Adaptive Server Enterprise Replication, Adaptive Server Everywhere, Adaptive Server IQ, Adaptive Warehouse,
AnswerBase, Anywhere Studio, Application Manager, AppModeler, APT Workbench, APT-Build, APT-Edit, APT-
Execute, APT-FORMS, APT-Translator, APT-Library, ASEP, Backup Server, BayCam, Bit-Wise, Certified
PowerBuilder Developer, Certified SYBASE Professional, Certified SYBASE Professional Logo, ClearConnect,
Client-Library, Client Services, CodeBank, Column Design, ComponentPack, Connection Manager, Convoy/DM,
Copernicus, CSP, Data Pipeline, Data Workbench, DataArchitect, Database Analyzer, DataExpress, DataServer,
DataWindow, DB-Library, dbQueue, Developers Workbench, Direct Connect Anywhere, DirectConnect,
Distribution Director, e-ADK, E-Anywhere, e-Biz Integrator, E-Whatever, EC-GATEWAY, ECMAP, ECRTP,
eFulfillment Accelerator, Electronic Case Management, Embedded SQL, EMS, Enterprise Application Studio,
Enterprise Client/Server, Enterprise Connect, Enterprise Data Studio, Enterprise Manager, Enterprise SQL Server
Manager, Enterprise Work Architecture, Enterprise Work Designer, Enterprise Work Modeler, eProcurement
Accelerator, eremote, Everything Works Better When Everything Works Together, EWA, Financial Fusion, Financial
Fusion Server, First Impression, Formula One, Gateway Manager, GeoPoint, iAnywhere, iAnywhere Solutions,
ImpactNow, Industry Warehouse Studio, InfoMaker, Information Anywhere, Information Everywhere,
InformationConnect, InstaHelp, Intellidex, InternetBuilder, iremote, iScript, Jaguar CTS, jConnect for JDBC,
KnowledgeBase, Logical Memory Manager, MainframeConnect, Maintenance Express, MAP, MDI Access Server,
MDI Database Gateway, media.splash, MetaWorks, MethodSet, ML Query, MobiCATS, MySupport, Net-Gateway,
Net-Library, New Era of Networks, Next Generation Learning, Next Generation Learning Studio, O DEVICE,
OASiS, OASiS logo, ObjectConnect, ObjectCycle, OmniConnect, OmniSQL Access Module, OmniSQL Toolkit,
Open Biz, Open Business Interchange, Open Client, Open ClientConnect, Open Client/Server, Open Client/Server
Interfaces, Open Gateway, Open Server, Open ServerConnect, Open Solutions, Optima++, Partnerships that Work,
PB-Gen, PC APT Execute, PC DB-Net, PC Net Library, PhysicalArchitect, Power++, Power Through Knowledge,
power.stop, PowerAMC, PowerBuilder, PowerBuilder Foundation Class Library, PowerDesigner, PowerDimensions,
PowerDynamo, Powering the New Economy, PowerJ, PowerScript, PowerSite, PowerSocket, Powersoft, PowerStage,
PowerStudio, PowerTips, Powersoft Portfolio, Powersoft Professional, PowerWare Desktop, PowerWare Enterprise,
ProcessAnalyst, Rapport, Relational Beans, Report Workbench, Report-Execute, Replication Agent, Replication
Driver, Replication Server, Replication Server Manager, Replication Toolkit, Resource Manager, RW-DisplayLib,
RW-Library, S Designor, S-Designor, SAFE, SAFE/PRO, SDF, Secure SQL Server, Secure SQL Toolset, Security
Guardian, SKILS, smart.partners, smart.parts, smart.script, SQL Advantage, SQL Anywhere, SQL Anywhere Studio,
SQL Code Checker, SQL Debug, SQL Edit, SQL Edit/TPU, SQL Everywhere, SQL Modeler, SQL Remote, SQL
Server, SQL Server Manager, SQL SMART, SQL Toolset, SQL Server/CFT, SQL Server/DBM, SQL Server SNMP
SubAgent, SQL Station, SQLJ, Stage III Engineering, Startup.Com, STEP, SupportNow, S.W.I.F.T. Message Format
Libraries, Sybase Central, Sybase Client/Server Interfaces, Sybase Development Framework, Sybase Financial
Server, Sybase Gateways, Sybase Learning Connection, Sybase MPP, Sybase SQL Desktop, Sybase SQL Lifecycle,
Sybase SQL Workgroup, Sybase Synergy Program, Sybase Virtual Server Architecture, Sybase User Workbench,
SybaseWare, Syber Financial, SyberAssist, SybMD, SyBooks, System 10, System 11, System XI (logo),
SystemTools, Tabular Data Stream, The Enterprise Client/Server Company, The Extensible Software Platform, The
Future Is Wide Open, The Learning Connection, The Model For Client/Server Solutions, The Online Information
Center, The Power of One, Transact-SQL, Translation Toolkit, Turning Imagination Into Reality, UltraLite,
UNIBOM, Unilib, Uninull, Unisep, Unistring, URK Runtime Kit for UniCode, Viewer, Visual Components,
VisualSpeller, VisualWriter, VQL, WarehouseArchitect, Warehouse Control Center, Warehouse Studio, Warehouse
WORKS, Watcom, Watcom SQL, Watcom SQL Server, Web Deployment Kit, Web.PB, Web.SQL, WebSights,
WebViewer, WorkGroup SQL Server, XA-Library, XA-Server and XP Server are trademarks of Sybase, Inc. or its
subsidiaries.
All other trademarks are property of their respective owners.
Contents

About This Book.................................................................v

1 About the CDM Tutorial .....................................................1


What you will do........................................................................ 2
How long it will take ............................................................ 2
What you will learn ............................................................. 3
Setting up .................................................................................. 4

2 Stating the Business Problem...........................................5

3 How to Begin the CDM Tutorial.........................................7


Start PowerDesigner ................................................................. 8
Open a new CDM ..................................................................... 9
Use the tools in the tool palette............................................... 10
Open the tutorial CDM ............................................................ 16
Define CDM preferences and options..................................... 17
Define CDM properties ........................................................... 22
Save the tutorial CDM ............................................................. 23

4 Defining Business Rules, Domains, and Data Items .....25


Create a new business rule .................................................... 27
Create a new domain.............................................................. 31
Create a new data item ........................................................... 36
Attach a data item to a domain ............................................... 40

5 Defining Entities...............................................................43
Create a new entity ................................................................. 45
Create an associative entity.................................................... 49
Define entity attributes ............................................................ 50
Add data items to an entity ............................................... 50
Create a new entity attribute............................................. 53
Designate an identifier ............................................................ 56
Attach a business rule to an entity .......................................... 60

iii
6 Defining Relationships ....................................................63
Create a relationship............................................................... 65
Define roles in an optional relationship ................................... 67

7 Using Packages and Shortcuts.......................................71


Create a package ................................................................... 72
Open a diagram for the package ............................................ 74
Add objects to the package .................................................... 76
Accessing a target object from a shortcut .............................. 78

8 Defining Inheritance.........................................................79
Create an inheritance link ....................................................... 80
Define inheritance properties .................................................. 82

9 Organizing the Display ....................................................87


Add a title box ......................................................................... 88
Change the color of the title box ............................................. 89
Change the color of the window.............................................. 90
Arrange the symbols ............................................................... 91
Center the model on the page ................................................ 93
Print the model........................................................................ 94

10 Generating the PDM from the CDM.................................95


Generate the PDM .................................................................. 97
Save and close the PDM ...................................................... 101
Exit PowerDesigner .............................................................. 102

Glossary.......................................................................... 103

Index ............................................................................... 105

iv
About This Book

Subject This book contains step-by-step tutorials for the PowerDesigner Conceptual
Data Model modeling environment. It shows you how to do the following:
♦ Build a Conceptual Data Model (CDM)
♦ Use business rules and other model objects
♦ Generate a Physical Data Model (PDM)

Audience This book is for anyone who will be building data models with
PowerDesigner. Some familiarity with relational databases, SQL, and design
methodology is helpful, but not required. For more information, see the
Bibliography section at the end of this chapter.

Documentation The PowerDesigner modeling environment supports four types of models:


primer
♦ Conceptual Data Model to model the overall logical structure of a
database, independent from any software or data storage structure
considerations. A valid CDM can be converted to a PDM or an OOM
♦ Physical Data Model (PDM) to model the overall physical structure of
a database, taking into account DBMS software or data storage structure
considerations. A valid PDM can be converted to a CDM or an OOM
♦ Object Oriented Model (OOM) to model a software system using an
object-oriented approach for Java or other object languages. A valid
OOM can be converted to a CDM or a PDM
♦ Business Process Model (BPM) to model the means by which one or
more processes are accomplished in operating business practices

This book only contains the basics of the Conceptual Data Model. For
information on other models or aspects of PowerDesigner, consult the
following books:

General Features Guide To get familiar with the PowerDesigner


interface before learning how to use any of the models.

v
About This Book

Conceptual Data Model User’s Guide To build a CDM.

Physical Data Model Getting Started To learn the basics of the PDM.

Physical Data Model User’s Guide To build a PDM.

Object Oriented Model Getting Started To learn the basics of the


OOM.

Object Oriented Model User's Guide To build an OOM.

Business Process Model Getting Started To learn the basics of the


BPM.

Business Process Model User's Guide To build a BPM.

Reports User’s Guide To create reports for any or all models.

Repository User’s Guide To work in a multi-user environment using a


central repository.

Typographic PowerDesigner documentation uses specific typefaces to help you readily


conventions identify specific items:
♦ monospace text (normal and bold)
Used for: Code samples, commands, compiled functions and files,
references to variables.
Example: declare user_defined…, the
BeforeInsertTrigger template.
♦ UPPER CASE
Object codes, reversed objects, file names + extension.
Example: The AUTHOR table appears in the Browser. Open the file
OOMAFTER.OOM.
♦ bold text
Any new term.
Example: A shortcut has a target object.
♦ SMALL CAPS
Any key name.
Example: Press the ENTER key.
♦ EROGLWDOLF
Tabs, buttons, commands.
Example: Click the 6HOHFWLRQ tab. Select )LOH!2SHQ.

Bibliography Information engineering

vi
About This Book

James Martin, Prentice Hall, 1990, three volumes of 178, 497, and 625 pages
respectively; clothbound, ISBN 0-13-464462-X (vol. 1), 0-13-464885-4 (vol.
2), and 0-13-465501-X (vol. 3).

Data Modeling Essentials


Graeme Simsion, Van Nostrand Reinhold, 1994, 310 pages; paperbound;
ISBN 1850328773

Celko95
Joe Celko, Joe Celko’s SQL for Smarties (Morgan Kaufmann Publishers,
Inc., 1995), 467 pages; paperbound; ISBN 1-55860-323-9.

vii
About This Book

viii
C H A P T E R 1

About the CDM Tutorial

This tutorial is a series of lessons in which you learn how to use


PowerDesigner to build a Conceptual Data Model (CDM).
In this tutorial, you complete the CDM delivered in the tutorial file. This
model is based on a real-life example of an information system. It provides a
context for the exercises. As you build onto this model, you learn how to
create all the basic elements of a CDM. You can then apply your knowledge
to creating a CDM to suit your needs.
What is a CDM? A CDM represents the overall structure of an information system. It describes
the conceptual relationships of different types of information rather than their
physical structures. A CDM is independent of a particular database
management system (DBMS).
Why build a CDM? In a CDM, you can put design issues first because you do not have to worry
about the details of physical implementation. You deal principally with
entities and their relationships. These are easy to understand and to
manipulate.
Through a simple generation procedure, you can transfer the solid design
framework of the CDM to the Physical Data Model (PDM). The PDM adapts
your design to the specifics of a DBMS and puts you well on the way to
complete physical implementation.

1
What you will do

What you will do


Chapter 2 You begin by preparing a business description and stating the business
problems to solve. You will refer to this statement in order to decide what
business rules, data items, and entities you need to create.
Chapter 3 You will open the tutorial CDM. This CDM presents the conceptual structure
of a publishing enterprise.
You will specify model preferences and properties, then save the model
under a new name.
Chapter 4 You will create business rules, domains, and data items to complete the
CDM.
Chapter 5 You will add entities to the tutorial model. You will define entity attributes
and designate an identifier. You will also attach a business rule to an entity.
Chapter 6 You will create relationships between entities. You will create relationships
with different cardinalities, as well as mandatory and dependent relationships.
Chapter 7 You will create a package in which you will add a shortcut to an entity in the
global model
Chapter 8 You will create an inheritance link.
Chapter 9 You will use the display options and tools to organize the model. You will
insert a title box and change its color. You will use the alignment tools to
align symbols and straighten relationship lines.
Chapter 10 You will generate a Physical Data Model (PDM) from the CDM. You will
define the generation parameters, generate the PDM, then save and close the
PDM.

How long it will take


You can do the CDM tutorial in one sitting in about 1½ hours. You can stop
after any chapter and continue at another time.

2
Chapter 1 About the CDM Tutorial

What you will learn


You will learn basic PowerDesigner techniques for creating a CDM,
including:
♦ How to create the basic elements of a CDM: domains, data items,
business rules, and entities
♦ How to create different types of relationships between entities
♦ How to create packages and add objects to a package
♦ How to create an inheritance
♦ How to use the display functions to arrange symbols and to center the
model on the page
♦ How to generate a Physical Data Model (PDM) from a CDM

3
Setting up

Setting up
Before you begin, make sure that the files you need for the exercises are on
your hard disk. When you install PowerDesigner, these files are installed in
the PowerDesigner 9\Examples\Tutorial directory . When you have finished
with this tutorial you can delete them if you want.
The CDM tutorial uses the following files:

File Description
CDMBEFOR.CDM Starting tutorial CDM
CDMAFTER.CDM Finished tutorial CDM

4
C H A P T E R 2

Stating the Business Problem

The first step to creating a Conceptual Data Model (CDM) is to formulate a


statement of the business problems that the CDM will address. To do this,
you draw up a description of business activities. This helps you decide:
♦ What information you need to store
♦ What entities are involved in the business
♦ How the business operates
When the way the business operates is clear, you can begin to develop the
CDM.
Business You will start this tutorial with a CDM that is the conceptual model of the
description information system for a publishing company.
A business description indicates that the entities involved in the business
include titles, authors, book stores, and discounts. It indicates the details
related to each of these entities: from international standard book numbers
(ISBN) for titles to store addresses.
Business problem In the course of the CDM tutorial, you will solve three business problems:
♦ Royalties for multiple authors Keep track of different royalty
percentages for authors of the same book
♦ Author pictures and biographies Identify and store author pictures
and biographies for use on book covers
♦ Title categories Classify each title as a periodical or a non-periodical
and save related information
On the basis of these business problems, you will extend the tutorial model to
manage additional data. For example, you will add an entity for pictures and
you will create a data item to store information about percentages of royalties
that a particular author receives.

5
Stating the Business Problem

6
C H A P T E R 3

How to Begin the CDM Tutorial

You will begin the tutorial by running PowerDesigner. You will learn how to
use the tool palette.
You will open the tutorial file and assign it preferences, options, and
properties. Next, you will save it under a different name so that you can go
back and use the original model again if you want to repeat the exercises.
What you will do In this chapter you will:
♦ Start PowerDesigner
♦ Use the tools in the tool palette
♦ Open the tutorial CDM
♦ Define CDM preferences and options
♦ Define CDM properties
♦ Save the tutorial CDM

+RZORQJZLOOLWWDNH"
About 10 minutes.

7
Start PowerDesigner

Start PowerDesigner
♦ Click the 3RZHU'HVLJQHU program icon.
The PowerDesigner main window appears. It contains an object browser
window docked to the left, and an output window docked to the bottom
of the main window.

The object browser window shows the contents of the workspace in a


tree view. You can use the object browser to organize the objects in each
of your models.
The workspace is the name for the current PowerDesigner session.
Workspace is the default node in the object browser tree view. The new
CDM that you will open will be created and saved in a workspace.
The output window shows the progression of any process that you run
from PowerDesigner, for example the process of generating a PDM from
a CDM is shown in this window.

<RXUVFUHHQORRNVGLIIHUHQW
All the screen captures in this book were taken in a Windows NT4
environment, with an 800x600 screen resolution. The appearance and
proportions of the images which appear on your screen may be
slightly different.

8
Chapter 3 How to Begin the CDM Tutorial

Open a new CDM


1 Select )LOH→1HZ.
A selection window appears. It lists the types of models that you can
open in the PowerDesigner main window.
2 Select &RQFHSWXDO'DWD0RGHO.
3 Click 2..
A CDM model window appears. It contains a diagram window (as yet
empty), a palette, and the Browser and Output windows are docked to
the left and bottom of the screen respectively.

9
Use the tools in the tool palette

Use the tools in the tool palette


The buttons in the CDM tool palette enact all major functions needed to build
and modify a CDM.

The following table indicates the names and functions of each tool in the
palette:

Tool Name Action


Pointer Selects symbol

Lasso Selects symbols in an area

Grabber Selects, moves and resizes all symbols

Zoom In Increases view scale

Zoom Out Decreases view scale

Open Package Diagram Display diagram for selected package

Properties Display property sheet for selected symbol

Delete Delete symbol

Package Insert package symbol

Entity Insert entity symbol

Relationship Insert relationship symbol

10
Chapter 3 How to Begin the CDM Tutorial

Tool Name Action


Inheritance Insert inheritance symbol

Association Insert association symbol

Association Link Insert association link symbol

File Insert a file symbol

Note Insert note symbol

Link/Extended Draws a graphical link between symbols in


Dependency the diagram
Draws a note link between a Note and an
object
Draws an extended dependency between two
objects that support extended dependencies
Title Insert title symbol

Text Insert text

Line Draw a line

Arc Draw an arc

Rectangle Draw a rectangle

Ellipse Draw an ellipse

Polyline Draw a jagged line

Polygon Draw a polygon

So that you know how to use these tools before you begin creating the CDM,
you will create a few objects using the tool palette.
1 Click the (QWLW\WRRO in the tool palette.
The cursor takes the form of an entity when it is moved into the diagram.
2 Click anywhere in the CDM diagram.

11
Use the tools in the tool palette

An entity symbol appears at the click position. The entity has the name
Entity_n, where n is a number assigned to the entity in the order of
creation of objects.

3 The Entity tool is still active, so click again in the CDM diagram to
create another entity.
There are now two entities in the CDM diagram.

4 Click the 5HODWLRQVKLSWRRO in the tool palette.


The Entity tool is now released and the Relationship tool is active.
5 Click inside the ILUVWHQWLW\ and while continuing to hold down the mouse
button, drag the cursor to the second entity. Release the mouse button
inside the second entity.
This creates a relationship.

6 Click the ULJKWPRXVHEXWWRQ.


You release the relationship tool.

7RUHOHDVHDWRRO
A tool remains active until you release it. You can release a tool, by
selecting another tool or by clicking the right mouse button. By
default, when you click the right mouse button, the Pointer tool is
activated.

7 Click the /DVVR tool in the palette.


The Lasso tool is now active.
8 Click the cursor above a corner of the first entity and while continuing to
hold down the mouse button, drag the cursor so that you draw a
rectangle around the two entities.
Release the mouse button.

12
Chapter 3 How to Begin the CDM Tutorial

The entities and the relationship are selected. Handles appear around the
lasso selection to show that they are selected.
9 Drag the entities to a new position.
The relationship moves with the entities.
10 Click the 7H[W tool in the palette.
The Text tool is now active.
11 Click the cursor under the relationship.
Some text appears in the area indicated by the rectangle.
12 Click the ULJKWPRXVHEXWWRQ.
You release the Text tool.
13 Double-click the text.
A text box appears.
14 Type a short text into the text box.
15 Click 2..
The text appears in the diagram. Handles appear around the text.

16 Click a handle at the right edge of the text and while continuing to hold
the mouse button, drag the cursor to the right until all the text appears.
Release the mouse button.
Click on the diagram background.
The handles around the text disappear.

17 Click the 3RLQWHU tool in the palette.


You will use this tool to select and delete one of the symbols.
18 Click on one of the entity symbols.
This selects the object you want to delete.
19 Press the DEL key.

13
Use the tools in the tool palette

The Confirm Deletion message box appears, asking you how you want to
delete the selection.

Deleting objects
If you select Delete object, you erase the graphic symbol and delete
the object from the model. If you select Delete Symbols Only, you
erase the graphic symbol, but keep the object in the model.

Confirm deletion box is not visible


If that box does not appear when you want to delete an object, select
Tools→General Options from the menu bar then select the Confirm
Object Deletion check box.

20 Click 2..
The entity and associated relationship are removed from the diagram.
The objects are also deleted from the model.
21 Click in the remaining entity.
Press SHIFT while you click the text.
The two objects are selected.
22 Press the DEL key, and click 2. when the deletion message appears.
The remaining entity and text are erased.

14
Chapter 3 How to Begin the CDM Tutorial

What you learned In this section, you learned how to use some of the tools in the tool palette.
You now know how to:
♦ Select a tool
♦ Release the active tool either by selecting another tool or by clicking the
right mouse button
♦ Select all objects of a particular type
♦ Move graphic objects
♦ Create text to document the CDM
♦ Delete objects

15
Open the tutorial CDM

Open the tutorial CDM


To perform the rest of the tutorial, you must open the tutorial file. The
tutorial file is installed in the directory PowerDesigner 8\Examples\Tutorial.
1 Select )LOH→2SHQ.
A file selection window appears.
2 Select or browse to the 78725,$/ directory.
Select the &'0%()25&'0 file.
Click 2..
PowerDesigner displays the model in the CDM diagram.
3 If you can only see part of the model, click the =RRP2XW tool in the
toolbar and click anywhere in the diagram window.
This displays the whole model in the CDM diagram. The model may not
look exactly like the one shown below.

Adjust display scale


You can choose the display scale most comfortable for your eyes, by
selecting View→Scale and choosing a scale.

16
Chapter 3 How to Begin the CDM Tutorial

Define CDM preferences and options


Before you begin working, you will define certain display preferences and
model options for the CDM.
$ For a complete description of all CDM preferences and options, see the
appropriate PowerDesigner user’s guide.
1 Select 7RROV→'LVSOD\3UHIHUHQFHV from the menu bar.
The Display Preferences dialog box opens to the General page.
2 Select the (QWLW\ node, under the 2EMHFW9LHZ node, in the &DWHJRU\ tree
view.
The Entity page appears.
3 Select or clear check boxes and radio buttons so the dialog box looks
like the one shown below:

For each entity symbol, these preferences display all entity attributes,
and identify all attributes that are defined in entity identifiers.
4 Select the 5HODWLRQVKLS node, under the 2EMHFW9LHZ node, in the &DWHJRU\
tree view.
The Relationship page appears.

17
Define CDM preferences and options

5 Select the 5ROH check box and clear all other check boxes, so the dialog
box looks like the one shown below.

6 Click the )RUPDW node.


The Format page appears.
7 Click the 0RGLI\ button at the bottom right of the page.
The Symbol Format page appears.

18
Chapter 3 How to Begin the CDM Tutorial

8 Verify that the $XWRDGMXVWWR7H[W check box is selected as shown below


(this is the default selection).

9 Click 2.in each of the dialog boxes.


You return to the PowerDesigner main window.
10 Select 7RROV→0RGHO2SWLRQV from the menu bar.
The Model Options dialog box appears. The Model node is selected by
default in the Category tree view.

19
Define CDM preferences and options

11 Select or clear check boxes so that the dialog box looks like the one
shown below.

'RPDLQGLYHUJHQFH
Selecting the Data type check box, without selecting the Enforce
check box, allows divergence between a domain definition and the
data items attached to it. However, when there is divergence,
PowerDesigner will propose to update the data type in all data items
using the domain

12 Select the 1DPLQJ&RQYHQWLRQ node.


The Naming Convention page appears.

20
Chapter 3 How to Begin the CDM Tutorial

13 Select the 1DPH radio button as shown below.

Object names are displayed in the object symbols in the CDM diagram.
14 Click 2..

21
Define CDM properties

Define CDM properties


1 Select 0RGHO→0RGHO3URSHUWLHV from the menu bar.
The Model property sheet appears.
2 Type 7XWRULDO in the Name box.
This is the name of the CDM. The code CDM_BEFOR appears by
default in the Code box. The dialog box should appear as shown below.

3 Click 2..

22
Chapter 3 How to Begin the CDM Tutorial

Save the tutorial CDM


You will save the tutorial CDM in another file. This leaves the original
tutorial CDM intact so you can use it again if you want to redo the exercises.
1 Select )LOH→6DYH$V.
The File Save As dialog box appears.
2 Type 78725,$/&'0 in the File Name box.
This is the name of the file in which you will work and save your
modifications.
3 Click 6DYH.
This saves your model in the TUTORIAL.CDM file.

6DYH\RXUZRUN
Save your work periodically while doing these exercises by selecting
File→Save.

23
Save the tutorial CDM

24
C H A P T E R 4

Defining Business Rules, Domains, and


Data Items

About business A business rule is a written expression of the way a business operates. When
rules 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:

Type of
business rule Example
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.
About data items A data item is an elementary piece of information. For example, this CDM
contains data items for author last name and for book titles.
About domains A domain 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.

25
Create a new business rule

About check Check parameters specify more precisely what values to allow for a domain
parameters or a data item. In a CDM, check parameters define standard parameters, such
as minimum, maximum, or accepted values.
What you will do In this chapter you will:
♦ Create a new business rule
♦ Create a new domain
♦ Create a new data item
♦ Attach a data item to a domain

+RZORQJZLOOLWWDNH"
About 20 minutes.

26
Chapter 4 Defining Business Rules, Domains, and Data Items

Create a new business rule


You will create a business rule that states how to attribute royalties to
authors.
1 Select 0RGHO→%XVLQHVV5XOHV.
The List of Business Rules dialog box displays existing business rules.
2 Click the $GGD5RZ tool.

An arrow appears at the start of the first blank line and a default name
and code are entered.

A default name and code appear


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.

3 Type $XWKRU3HUFHQW in the Name column.


This is the name of the business rule. The equivalent code is entered in
the Code column automatically.

27
Create a new business rule

4 Select 9DOLGDWLRQ from the dropdown list in the Rule Type column.

Rule type column is not visible


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.


5 Click $SSO\.
The creation of the new business rule is committed.

1DPHVVRUWHGDOSKDEHWLFDOO\
When you click $SSO\ or2., 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.

6 Click the new business rule line.


An arrow appears at the beginning of the line.

28
Chapter 4 Defining Business Rules, Domains, and Data Items

7 Click the 3URSHUWLHV tool.

or
Double click the arrow at the beginning of the line.
The property sheet for the new business rule appears.

8 Click the Notes tab.


The Notes page appears opened to the Description box.

29
Create a new business rule

9 In the Description box, type 7KHSHUFHQWDJHRIUR\DOWLHVSDLGWRDOO


DXWKRUVRIDERRNDGGVXSWRRIWKHWRWDOUR\DOWLHV.
This text explains the meaning of the business rule.

10 Click 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

30
Chapter 4 Defining Business Rules, Domains, and Data Items

Create a new domain


You will create two domains that will define a standardized data type for
money amounts and for percentages in the model.
1 Select 0RGHO→'RPDLQV from the menu bar.
The List of Domains dialog box displays the existing domains.
2 Click the $GGD5RZ tool.

An arrow appears at the start of the first blank line and a default name
and code are entered.

3 Type $PRXQW in the 1DPH column.


This is the name of the domain. The equivalent code is entered in the
Code column automatically.
4 Click $SSO\.
The creation of the new domain is committed.

1DPHVVRUWHGDOSKDEHWLFDOO\
When you click $SSO\ or2., 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.

31
Create a new domain

5 Click the new domain line.


An arrow appears at the beginning of the line.
6 Click the 3URSHUWLHV tool.

or
Double click the arrow at the beginning of the line.
The property sheet for the new domain appears.

7 Click the Question Mark button next to the 'DWD7\SH dropdown listbox.
The 6WDQGDUG'DWD7\SHV dialog box appears. You use this dialog box to
specify the form of the data affected by the domain.
8 Click 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.

'DWDW\SHFRGHV
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.

32
Chapter 4 Defining Business Rules, Domains, and Data Items

9 Type  in the /HQJWK box.


The maximum number of figures in a data item attached to this domain
will be 8.
10 Type  in the 3UHFLVLRQ box.
A data item attached to this domain can take two positions after the
decimal point.

11 Click 2..

33
Create a new domain

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.

12 Click OK.
You return to the List of Domains.
13 Click the $GGD5RZ tool.

An arrow appears at the start of the first blank line and a default name
and code are entered.
14 Type 3HUFHQW in the 1DPH column.
This is the name of the domain. The equivalent code is entered in the
Code column automatically.
15 Click $SSO\.
The creation of the new domain is committed.
16 Click the new domain line.
An arrow appears at the beginning of the line.

34
Chapter 4 Defining Business Rules, Domains, and Data Items

17 Click the 3URSHUWLHV tool.

or
Double click the arrow at the beginning of the line.
The property sheet for the new domain appears.
18 Click the Question Mark button next to the 'DWD7\SH dropdown listbox.
The 6WDQGDUG'DWD7\SHV dialog box appears. You use this dialog box to
specify the form of the data affected by the domain.
19 Click the 6KRUWLQWHJHU radio button.
The code SI indicates that the Percent domain has a short integer data
type. The Length and Precision boxes are not available because you do
not need to specify a length and precision for the short integer data type.
20 Click 2. in each of the dialog boxes.

'HIDXOWGDWDW\SH
When you do not define a data type for a domain, it receives the
default data type. You can designate a default data type by selecting
Tools→Model Options.

What you learned In this section, you learned how to:


♦ Look for data items storing similar types of data, and create a domain to
standardize the data characteristics of these data items
♦ Identify a domain by a name and a code
♦ Specify the data type, length, and precision of the domain

35
Create a new data item

Create a new data item


To manage books with multiple authors, you will create data items for the
percentage of royalties for each author and for the order of an author’s name
in the list of authors.
1 Select 0RGHO→'DWD,WHPV from the menu bar.
The List of Data Items displays existing data items.
2 Click the $GGD5RZ tool.

An arrow appears at the start of the first blank line and a default name
and code are entered.

3 Type 7LWOH$XWKRU3HUFHQW in the 1DPH column.


This is the name of the data item. The equivalent code is entered in the
Code column automatically.
4 Click $SSO\.
The creation of the new data item is committed.

1DPHVVRUWHGDOSKDEHWLFDOO\
When you click $SSO\ or2., 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.

36
Chapter 4 Defining Business Rules, Domains, and Data Items

5 Click the new data item line.


An arrow appears at the beginning of the line.
6 Click the 3URSHUWLHV tool.

or
Double click the arrow at the beginning of the line.
The property sheet for the new data item appears.

7 Select 3HUFHQW from the 'RPDLQ dropdown listbox in the bottom part of
the dialog box.
This applies the data type of the Percent domain to the new data item. In
the Data Type column, SI indicates a short integer.
8 Click OK.
You return to the List of Data Items.

37
Create a new data item

9 Click the $GGD5RZ tool.

An arrow appears at the start of the first blank line and a default name
and code are entered.
10 Type 7LWOH$XWKRU2UGHU in the Name column.
This is the name of the data item. The equivalent code is entered in the
Code column automatically.
11 Click $SSO\.
The creation of the new data item is committed.
12 Click the new data item line.
An arrow appears at the beginning of the line.
13 Click the 3URSHUWLHV tool.

or
Double click the arrow at the beginning of the line.
The property sheet for the new data item appears.

14 Click the 4XHVWLRQ0DUN button next to the Data Type dropdown listbox.
The Standard Data Types dialog box appears.

38
Chapter 4 Defining Business Rules, Domains, and Data Items

15 Click the ,QWHJHU radio button.


This gives the TitleAuthor Order data item an Integer data type.

16 Click 2. in each of the dialog boxes.


You return to the model window.
What you learned In this section, you learned how to:
♦ Refer to the statement of the business problem to decide what additional
information you need to be able to manage
♦ Create data items to reflect these needs
♦ Identify a data item by a name, a code, and a data type
♦ Select a data type by attaching a data item to a domain
♦ Select a data type for a specific data item

39
Attach a data item to a domain

Attach a data item to a domain


You will attach the AMOUNT domain to all data items that store amounts of
money and the PERCENT domain to all data items that store percentages.

1 Select 0RGHO→'DWD,WHPV from the menu bar.


The List of Data Items dialog box appears.
2 Click the number of the data item $XWKRU$GYDQFH.
Press &75/ while you click the number of the data item 5R\DOW\$PRXQW.
Press &75/ while you click the number of the data item 6DOH$PRXQW.
Press &75/ while you click the number of the data item 7LWOH3ULFH.
These data items are selected.

3 Scroll to the right until the 'RPDLQ column appears.

List column is not visible


If a list 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.

4 Click in the 'RPDLQ column for the line Author Advance.


A down arrowhead appears at the end of the line. This indicates that a
dropdown list is available for the Domain column. The list contains all
the domains available in the model.

40
Chapter 4 Defining Business Rules, Domains, and Data Items

5 Click the down arrowhead and select $PRXQW from the list as shown
below.

Amount automatically appears in the Domain column for each of the


other selected data items. When you assign a property to a selected item
in a list, all other selected list items are automatically assigned the same
property.
The data items inherit the data type of the domain. MN8,2 appears in the
Data Type column. This code indicates a money data type with a length
of 8 and a precision of 2.

41
Attach a data item to a domain

The data items Author Advance, Royalty Amount, Sales Amount, and
Title Price which before had different data types, now inherit a
standardized data type from the Amount domain.

6 Click the number of the data item 'LVFRXQW3HUFHQW and select 3(5&(17
from the dropdown listbox in the Domain column.
7 Click 2..

What you learned In this section, you learned how to ensure data consistency by attaching data
items to domains.
It is good practice to attach data items to domains. By doing so, when you
modify a domain you can globally update the characteristics of the attached
data items.

42
C H A P T E R 5

Defining Entities

About entities An entity is an object about which you want to store information. For
example, in the tutorial model the AUTHOR entity groups information like
author name and address.
Why create an The business problem indicates which entities you need to create. For
entity example, to identify and store pictures of authors, you will create a
PICTURE entity that contains all information related to pictures.
Why create an To respond to another business problem, you need to keep track of the
associative entity percentage of royalties received by each author of each title.
One title may be written by many authors, and one author may have many
titles to his or her credit. This is called a many-to-many relationship.
Because each author must be unique in the Author entity, and each Title must
be unique in the Title entity, you will create an associative entity that has a
unique occurrence for each title-author combination. You will then be able to
attach a percentage to each unique case.
About entity An entity attribute is an elementary piece of information (data item) which
attributes you attach to an entity. For example, Last Name is an attribute of the
AUTHOR entity because it provides information about an author. You will
add a biography attribute to the AUTHOR entity.
About entity An entity identifier is made up of one or more attributes unique to the entity,
identifiers such that each value of the identifier corresponds to one, and only one,
occurrence of the entity. For example, ISBN is the identifier of the TITLE
entity because an ISBN uniquely identifies a title. You will assign a picture
identification number as the identifier of the PICTURE entity.

43
Create a new entity

Attaching business You attach a business rule to an entity as a reminder of the conditions
rules to entities attached to the entity. You will attach the business rule you created in the
preceding lesson to one of the entities.
What you will do In this chapter you will:
♦ Create an entity
♦ Create an associative entity
♦ Define entity attributes
♦ Designate an identifier
♦ Attach a business rule to an entity

+RZORQJZLOOLWWDNH"
About 15 minutes

44
Chapter 5 Defining Entities

Create a new entity


You will create an entity that contains information related to pictures, an
entity that associates titles to authors, and two entities that differentiate title
categories: periodicals and non-periodicals.
1 Click the (QWLW\ tool in the tool palette.
2 Click an empty space in the diagram.
An entity symbol appears at the click position.

At creation, an entity is named Entity_n where n is a number assigned to


the entity in the order of creation of objects.
3 Click the 3RLQWHU tool in the tool palette.
4 Double-click the symbol of the HQWLW\ you just created.
The entity property sheet appears.
5 Type 3LFWXUH in the 1DPH box.

45
Create a new entity

This is the name of the entity. The equivalent code is entered in the Code
column automatically.

6 Click 2..
The new entity displays the name Picture.

You created this entity by first creating its symbol, then identifying it
from a property sheet. You can also create entities from the list of
entities.
7 Select 0RGHO→(QWLWLHV.
The List of Entities dialog box displays existing entities.
8 Click the $GGD5RZ tool.

An arrow appears at the start of the first blank line and a default name
and code are entered.
9 Type 3HULRGLFDO in the 1DPH column.
The code is automatically set equal to the name.
10 Click $SSO\.

46
Chapter 5 Defining Entities

The creation of the new entity is committed.

1DPHVVRUWHGDOSKDEHWLFDOO\
When you click $SSO\ or2., 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.

11 Click the $GGD5RZ tool.

An arrow appears at the start of the first blank line and a default name
and code are entered.
12 Type 1RQSHULRGLFDO in the 1DPH column.
13 Click $SSO\.
The creation of the new entity is committed.
The new entities appear on the list.

14 Click 2..
The new entities appear in the CDM.

47
Create a new entity

0RYLQJHQWLW\V\PEROV
When you create entities from the list, they will not be arranged as
shown above. You do not control the insert position of the symbols.
You can move an entity symbol by selecting it and dragging it to a
new position.

What you learned In this section, you learned how to:


♦ Use the statement of the business problem to decide what entities you
need to create
♦ Create an entity by inserting an entity symbol and assigning a name and
code from its property sheet
♦ Create an entity on the list of entities

48
Chapter 5 Defining Entities

Create an associative entity


You will replace the existing relationship between AUTHOR and TITLE
with an associative entity. This associative entity will have a unique
occurrence for each title-author combination so that you can attach a royalty
percentage to each unique case.
1 Right-click the UHODWLRQVKLS that links Author and Title entities.
A relationship contextual menu appears.
2 Select &KDQJHWR(QWLW\→6WDQGDUG from the contextual menu.
A new entity is inserted between Author and Title entities.

49
Define entity attributes

Define entity attributes


You will define entity attributes for the entities TITLEAUTHOR, PICTURE,
PERIODICAL, and NONPERIODICAL by attaching one or more data items
to each entity.
You will create entity attributes by:
♦ Adding data items to an entity
♦ Creating a new entity attribute

Add data items to an entity


You will attach existing data items to the entities TITLEAUTHOR,
PICTURE, PERIODICAL, and NONPERIODICAL.
1 Double-click the 7LWOH$XWKRU entity.
The Entity property sheet appears.

2 Click the $WWULEXWHV tab.

50
Chapter 5 Defining Entities

The Attributes page appears. It lists the attributes associated with the
entity. The list is empty because the entity does not have any associated
attributes.

Click the Add Data Item tool.

A selection box appears. It lists all the data items available in the model.
3 Click the &RGH column heading.
This sorts the list of code items alphabetically.

51
Define entity attributes

4 Select the 7LWOH$XWKRU2UGHU checkbox.


Select the 7LWOH$XWKRU3HUFHQW checkbox

5 Click 2..
The data items appear in the list of attributes for the TitleAuthor entity.

6 Click 2..

52
Chapter 5 Defining Entities

In the CDM diagram, the TITLEAUTHOR entity displays its attributes.

7 Repeat steps 1-6 for entities PICTURE (Picture and Picture ID data
items), PERIODICAL (Periodical Format and Periodical Pub Frequency
data items), and NONPERIODICAL (Book Collection data item).
The CDM displays these entities with their attributes.

Create a new entity attribute


You will create a new Biography attribute for the text of the author’s
biography.
1 Double-click the $87+25 entity symbol.
The Entity property sheet appears.
2 Click the $WWULEXWHV tab.
The Attributes page appears. It lists the attributes belonging to the
Author entity.
3 Select the $XWKRU$GYDQFH attribute.
4 Click the ,QVHUWD5RZ tool.

53
Define entity attributes

A blank line is inserted above the Author Advance line. A default name
is entered.

5 Type $XWKRU%LRJUDSK\ in the Name column.


This is the name of the attribute. The equivalent code appears in the
Code column automatically.
6 Scroll to the right and click the Domain column.
Select /21*B127(6 from the Domain dropdown list.

54
Chapter 5 Defining Entities

The text data type (TXT) appears in the Data Type column.

7 Click 2..
The Author entity displays its new attribute.

What you learned In this section, you learned how to:


♦ Add existing data items to an entity to create entity attributes
♦ Create a new entity attribute
♦ Identify an entity attribute by a name, a code, and a data type

55
Designate an identifier

Designate an identifier
An identifier is an entity attribute that uniquely identifies each occurrence of
the entity.
You will designate Picture ID as the identifier of the PICTURE entity.
1 Double-click the 3,&785( entity symbol.
The Entity property sheet appears.
2 Click the $WWULEXWHV tab.
The Attributes page appears.

3 Click the 3LFWXUH,' attribute.


An arrow appears at the beginning of the line.

56
Chapter 5 Defining Entities

4 Click the 3URSHUWLHV tool.

or
Double click the arrow at the beginning of the line.
The Picture ID property sheet appears.
5 Select the 3ULPDU\,GHQWLILHU checkbox in the bottom part of the dialog
box.

6 Click 2..
You return to the Attributes page.
7 Scroll to the right until the 0 (mandatory) and 3 (primary identifier)
columns are visible.

List column is not visible


If a list column is not visible, click the Customize Columns and Filter
tool from the toolbar. A selection box appears listing the all the
columns that be displayed in the list. Select the appropriate checkbox
for the column that is not displayed, then click OK. The column
appears in the list.

57
Designate an identifier

In the Picture ID line, checks in the P column and the M column indicate
that this attribute is a primary identifier and a mandatory attribute,
respectively.

8 Scroll back to the Name column.


9 Click the 3LFWXUH attribute.
An arrow appears at the beginning of the line.
10 Click the 3URSHUWLHV tool.

or
Double click the arrow at the beginning of the line.
The Picture property sheet appears.
11 Select the 0DQGDWRU\ checkbox in the bottom part of the dialog box.
12 Click OK.
You return to the Attributes page.
13 Scroll to the right until the M column is visible.
A check appears in the M column of the Picture attribute. This means the
attribute is mandatory. In other words, each occurrence of the Picture
entity must include a picture.
14 Click 2..

58
Chapter 5 Defining Entities

The Picture ID attribute is underlined in the PICTURE entity symbol to


indicate that it is the identifier.

What you learned In this section, you learned how to:


♦ Designate an entity attribute as an identifier
♦ Make an entity attribute mandatory

59
Attach a business rule to an entity

Attach a business rule to an entity


You will attach the Author Percent business rule to the TITLEAUTHOR
entity to remind you of the role of this entity in the calculation of author
royalties.
1 Click the 3URSHUWLHV tool in the tool palette.
Click the 7LWOH$XWKRU entity symbol.
The Entity property sheet appears.
2 Click the 5XOHV tab.
The Rules page appears. It lists the business rules associated with the
entity. The list is empty.
3 Click the $GG5XOHV tool.

A selection box appears. This lists all the available business rules.
4 Select the $XWKRU3HUFHQW checkbox.

5 Click 2..

60
Chapter 5 Defining Entities

You return to the Rules page. Author Percent appears in the list.

6 Click 2..
The business rule is attached to the entity. You return to the model
window.
What you learned In this section, you learned how to:
♦ Attach a business rule to a particular entity in the CDM
♦ Use a business rule as a reminder of the role of an object in solving a
business problem

61
Attach a business rule to an entity

62
C H A P T E R 6

Defining Relationships

About relationships A relationship is a named association between entities. It expresses the fact
that two entities are somehow related. For example, in the tutorial model, a
relationship links the entities PUBLISHER and TITLE because publishers
publish books. An entity can have a relationship with itself, called a reflexive
relationship.
About cardinality Cardinality indicates the maximum number of instances (one or many) of
one entity in relation to another. To determine the cardinality of a
relationship, ask the following question about each entity in the relationship,
"Can more than one occurrence of this entity exist for one occurrence of the
other entity?"
For example, in a relationship of author-to-picture, the cardinality can be set
to many because one author can be shown in several pictures. In the
direction picture-to-author, the cardinality can be set to one because a picture
can only show one author. This type of relationship is called a one-to-many
relationship. The steps to establishing these relationships are in the Create a
relationship section of this chapter.
About mandatory You can define a relationship as mandatory from the point of view of one or
relationships both of its entities. To determine if a relationship is mandatory, ask the
following question about each entity in the relationship, "Does an occurrence
of this entity require an occurrence of the other entity?"
For example, the relationship for DISCOUNT to STORE is mandatory
because all discounts must be associated with a specific store. On the other
hand, the relationship from AUTHOR to PICTURE will be optional because
an author may not have any pictures on file.
About dependent In a dependent relationship one entity depends on another to uniquely
relationships identify it. For example, there are dependent relationships from
TITLEAUTHOR to TITLE and to AUTHOR because a unique occurrence of
TITLEAUTHOR is formed by the combination of one author and one title.

63
Create a relationship

What you will do In this chapter you will:


♦ Create a one-to-many relationship
♦ Define roles in an optional relationship

+RZORQJZLOOLWWDNH"
About 10 minutes.

64
Chapter 6 Defining Relationships

Create a relationship
You will create a relationship between AUTHOR and PICTURE entities.
1 Click the 3RLQWHUWRRO in the tool palette.
2 Drag the 3LFWXUH entity symbol below the AUTHOR entity symbol.

3 Click the 5HODWLRQVKLSWRRO in the tool palette.


4 Click inside the AUTHOR entity and while continuing to hold down the
mouse button, drag the cursor to the PICTURE entity. Release the mouse
button inside the PICTURE entity.
This creates a relationship between the two entities.

The contact points of the relationship indicate that the cardinality of the
relationship from AUTHOR to PICTURE is one-to-many, as follows:
♦ A single contact point on AUTHOR indicates that there is only one
author for each picture

65
Create a relationship

♦ Three contact points (a crow’s foot) on PICTURE indicates that the


same author can have more than one picture
The circles before both termination points indicate that both sides of the
relationship are optional.

Relationship properties
Relationships that you create using the relationship tool are one-to-
many and optional. You can change these and other properties from
the relationship property sheet.

What you learned In this section, you learned how to:


♦ Translate the links between objects in the information system into
relationships between entities
♦ Ask appropriate questions to help you decide the cardinality of a
relationship

66
Chapter 6 Defining Relationships

Define roles in an optional relationship


You will define an optional relationship between AUTHOR to PICTURE. An
author does not have to have a picture. A picture does not have to be of an
author.
1 Click the 3RLQWHU tool in the tool palette.
2 Double-click the UHODWLRQVKLS line between AUTHOR and PICTURE.
The relationship property sheet appears:

3 Type $XWKRU3LFWXUH in the 1DPH box.


This is the name of the relationship. The code is automatically set equal
to the name.
4 Click the 'HWDLO tab.

67
Define roles in an optional relationship

The Detail page appears.

5 Type LVVKRZQLQ in the Role box in the "Author" to "Picture" groupbox.


This label indicates that an author is shown in a picture.
6 Type VKRZV in the Role box in the "Picture" to "Author" groupbox.

68
Chapter 6 Defining Relationships

This label indicates that a picture shows an author.

7 Click 2..

69
Define roles in an optional relationship

The relationship appears in the model.

Display relationship roles


You can display roles by selecting Tools→Display Preferences and
selecting the Role checkbox in the Relationship category.

What you learned In this chapter you learned how to:


♦ Create a one-to-many relationship
♦ Define roles in an optional relationship

70
C H A P T E R 7

Using Packages and Shortcuts

A package is a defined section of a model. A package can contain the same


types of objects that are available in a model. Using packages can help you
manage large models. For example, portions of a model representing
different tasks and subject areas, can be divided up into packages which can
be used by different development teams working on the same project.
You can create new objects in a package or use objects that exist in the
global model. When you use existing objects, you create a shortcut in the
package which references the actual object in the global model. A shortcut is
a symbol that represents and references an object in another model or
package. The referenced object is called the target object.
You can access the properties of a target object from its shortcut. This allows
you to modify the target object in the same way that you would in the global
model.
$ For more information on packages and shortcuts, see the General
Features Guide.
You will create a package containing shortcuts to the entities TITLE,
PERIODICAL, and NONPERIODICAL.
What you will do In this chapter you will:
♦ Create a package
♦ Add objects to the package

+RZORQJZLOOLWWDNH"
About 5 minutes.

71
Create a package

Create a package
You will start by creating a package.
1 Click the 3DFNDJH symbol in the Palette.

2 Click an empty space in the diagram.


The Package symbol appears in the diagram.

3 Right-click the PRXVHEXWWRQ to release the 3DFNDJHWRRO.


4 Double-click the new package symbol.
The package property sheet appears. A default name and code are
entered.

A default name and code appear


When you create a new object, a default name and code are
automatically entered in the property sheet . If the default name is
selected it disappears when you start to type the object name. If the
default name is not selected, select it and either type the new object
name, or delete the default name before typing the new object name.

5 Type 7LWOH&DWHJRULHV in the 1DPH box.

72
Chapter 7 Using Packages and Shortcuts

6 Click 2..

You return to the diagram. The new name for the package appears in the
symbol.

73
Open a diagram for the package

Open a diagram for the package


At creation a package is simply a named object in the model. To be useful
you need to open a diagram in the package. In the diagram you can create and
use existing objects in the same way that they are used in the global diagram.
You will open a new diagram for the package and arrange the two diagram
windows horizontally in the main window.
1 Right-click the 3DFNDJHV\PERO
A contextual menu appears.
2 Select 2SHQ'LDJUDP from the contextual menu.
A new diagram appears in the Main window.
3 Select :LQGRZ→7LOH+RUL]RQWDOO\ from the menu bar.
The diagram for the Tutorial diagram (global model diagram) and the
new empty package diagram are arranged horizontally. Everything that is
created or added to the Tutorial Package diagram is contained within the
package represented by the package symbol in the Tutorial Diagram.

74
Chapter 7 Using Packages and Shortcuts

Using the object browser


All the objects that are contained in the current workspace are
represented in the Browser tree view. For this tutorial you are
working with the graphical tools and the diagram windows. However,
you can also use the Browser to create, delete, and manipulate model
objects. For more information on using the Browser, see the General
Features guide.

What you learned In this section, you learned how to:


♦ Create a package starting with one of the objects in the global model
♦ Identify a package by a name and a code
♦ Open a new diagram for the package
♦ Arrange the global model diagram and the package diagram windows
horizontally to make it easier to work with the two diagrams

75
Add objects to the package

Add objects to the package


You will add shortcuts for the TITLE, PERIODICAL and
NONPERIODICAL entities to the package.
1 Click in the Tutorial diagram (the global model diagram).
This makes the Tutorial diagram active.
2 Use the VFUROOEDUV to position the Tutorial diagram so that the TITLE,
PERIODICAL and NONPERIODICAL entities are visible.

3 Click the 7,7/(3(5,2',&$/ and 1213(5,2',&$/ entities while


holding down the SHIFT key.
Handles appear around the three entities.
4 Select (GLW→&RS\ from the menu bar.
5 Click in the 7LWOH&DWHJRULHV diagram.
This makes the package diagram the active diagram.
6 Select (GLW→3DVWHDV6KRUWFXW from the menu bar.

76
Chapter 7 Using Packages and Shortcuts

The TITLE, PERIODICAL and NONPERIODICAL shortcut symbols


appear in the Title Categories diagram.

7 Arrange the shortcut symbols. The arrow at the bottom left corner
indicates that the symbol is a shortcut.

What you learned In this section, you learned how to:


♦ Select the objects you want to include in a package
♦ Add the objects to the package

77
Accessing a target object from a shortcut

Accessing a target object from a shortcut


You can access the property sheet of a target object from its shortcut. This
allows you to modify the target object from within a package.
1 Double-click the VKRUWFXW V\PERO for the 7,7/( table.
The shortcut property sheet appears.

2 Click the 3URSHUW\ button next to the 1DPH box.

The property sheet for the TITLE table appears.


3 Click &DQFHO.
You return to the shortcut property sheet.
4 Click &ORVH.
You return to the package diagram.
Select :LQGRZ→&'078725,$/',$*5$0 to return to the Tutorial
diagram.
or
Minimize the package diagram window
Select the tutorial diagram window to make it the active window.
Maximize the tutorial diagram window.

78
C H A P T E R 8

Defining Inheritance

Inheritance allows you to define an entity as a special case of a more general


entity. For example, you will define periodicals and non-periodicals as
special cases of titles.
About parent The general entity is known as the parent (or supertype) entity, and contains
entities all of the common characteristics. In this tutorial, you will use TITLE as the
parent entity.
About child entities The special case entity is known as the child (or subtype) entity, and contains
all of the particular characteristics. In this tutorial, you will create two child
entities, PERIODICAL and NONPERIODICAL, because they are special
cases of titles with specific attributes.
Making children You can make an inheritance mutually exclusive. When an inheritance is
mutually exclusive mutually exclusive it means that there cannot be an occurrence of both child
entities at the same time.
For example, a title can be a periodical or a non-periodical. Because it cannot
be both, it is a mutually exclusive inheritance.
What you will do In this chapter you will:
♦ Create an inheritance link
♦ Define inheritance properties

+RZORQJZLOOLWWDNH"
About 10 minutes.

79
Create an inheritance link

Create an inheritance link


You will define an inheritance from the TITLE entity to the PERIODICAL
and NONPERIODICAL entities.
1 Select the ,QKHULWDQFH tool in the tool palette.
2 Click inside the 7,7/( entity and while continuing to hold down the
mouse button, drag the cursor to the 1213(5,2',&$/ entity. Release the
mouse button inside the 1213(5,2',&$/ entity.
An inheritance link appears between these entities. The link has a
semicircle in the middle, and an arrow that points to TITLE, which is the
parent entity. NONPERIODICAL is the child entity.

3 Click the VHPLFLUFOH and while continuing to hold down the mouse
button, drag the cursor to the 3(5,2',&$/ entity. Release the mouse
button inside the 3(5,2',&$/ entity.
The inheritance symbol changes accordingly.

80
Chapter 8 Defining Inheritance

3RVLWLRQLQKHULWDQFHV\PERO
To arrange the position of the inheritance symbol, select the
semicircle then select Symbol→Disposition→Arrange Symbols. The
inheritance symbol moves to the center of gravity of the symbols it
connects.

What you learned In this section, you learned how to:


♦ Identify entities which are special cases of other entities
♦ Create an inheritance link between entities

81
Define inheritance properties

Define inheritance properties


You will assign a name to the inheritance, make it mutually exclusive, and
define its generation mode.
1 Click the 3RLQWHU tool in the tool palette.
2 Double-click the VHPLFLUFOH in the middle of the inheritance link.
The Inheritance property sheet appears.
3 Type 7LWOHLQKHULWDQFH in the Name box.
This is the name of the inheritance.
4 Select the 0XWXDOO\H[FOXVLYH checkbox.
This indicates that the inheritance is mutually exclusive because a title is
either a periodical or a non-periodical, never both.

5 Click the *HQHUDWLRQ tab.


The Generation page appears.

82
Chapter 8 Defining Inheritance

6 Clear the *HQHUDWHFKLOGUHQ checkbox in the *HQHUDWLRQ0RGH groupbox.


The choices you make in the Generation Mode groupbox indicate how
the inheritance will be generated in the Physical Data Model (PDM).
Selecting only Generate Parent means only one table will be generated
for all titles. In this case, you will need a specifying attribute to
differentiate occurrences of each child.
7 Type 3HULRGLFDO in the 1DPH column in the 6SHFLI\LQJ$WWULEXWHV
groupbox.
Periodical is the name of the specifying attribute. This specifying
attribute will generate a column named Periodical in the TITLE table
that will result from generation. This column will indicate whether a title
is a periodical or not.

8 Click in the 'DWD7\SH column.


A dropdown list arrow appears.
9 Click the dropdown list arrow.
A dropdown listbox appears.

83
Define inheritance properties

10 Select %/ from the dropdown listbox.

You define a Boolean (BL) data type for the specifying attribute because
there are only two possible choices: periodical or not.
11 Scroll to the right until the 0 checkbox appears.
This is the Mandatory checkbox. When selected it indicates that when
the column Periodical is generated it can not contain NULL values.
12 Select the 0 checkbox.
13 Click 2..
A cross appears in the semicircle to indicate that the inheritance is
mutually exclusive.

84
Chapter 8 Defining Inheritance

What you learned In this section, you learned how to:


♦ Identify an inheritance by a name
♦ Express the fact that only one child entity can exist at a time by making
the inheritance mutually exclusive
♦ Select a generation mode to indicate what tables to generate for the
inheritance
♦ Define a specifying attribute to identify subtypes in the same table

85
Define inheritance properties

86
C H A P T E R 9

Organizing the Display

When you finish creating the CDM, you can organize the model using the
graphic display options.
What you will do In this chapter you will:
♦ Add a title box
♦ Change the color of the title box
♦ Change the color of the window
♦ Arrange the symbols
♦ Center the model on the page
♦ Print the model

+RZORQJZLOOLWWDNH"
About 15 minutes.

87
Add a title box

Add a title box


You will add a title box to the model. The title box contains the essential
information about the model.
1 Click the 7LWOHWRRO from the Palette.

2 Click an empty space in the diagram.


A title box appears in the diagram.

3 Drag the WLWOHER[ to the top of the model.


4 Right-click the title box.
5 Select 6KDGRZ from the contextual menu.
A shadow appears behind the title box. You can apply shadow to any
symbol in the model.

What you learned In this section, you learned how to:


♦ Display the model properties in a title box
♦ Apply shadow to a title box

88
Chapter 9 Organizing the Display

Change the color of the title box


1 Right-click the WLWOHER[.
2 Select )RUPDW from the contextual menu.
The Symbol Format dialog box appears.
3 Click the )LOO tab.
The Fill page appears.
4 Select a FRORU in the palette.
5 Click 2..
The title box background changes to the selected color.
$ For information on setting default colors for symbols in the diagram,
see the General Features Guide.

89
Change the color of the window

Change the color of the window


By changing the window color, you can change the background color of the
model.
1 Select 7RROV→'LVSOD\3UHIHUHQFHV.
The Display Preferences dialog box opens to the General page.

2 Click the down arrowhead at the end of the :LQGRZ&RORUGURSGRZQ


OLVWER[.
A dropdown color palette appears.
3 Select a FRORU from the palette.
4 Click 2..
The model background changes to the selected color.

90
Chapter 9 Organizing the Display

Arrange the symbols


You will align the entity symbols on the left of the model.
1 Using the 3RLQWHUWRRO draw a rectangle encompassing the
TITLEAUTHOR, AUTHOR and PICTURE entity symbols.

6HOHFWLQJVHYHUDOV\PEROVDWRQFH
You can also select more than one symbol at a time by pressing the
SHIFT key while you click each symbol in turn.

2 Select 6\PERO→$OLJQ→&HQWHURQ9HUWLFDO$[LV from the menu bar.


This aligns the selected symbols along a central vertical axis.

3 Use the $OLJQ menu to align the other symbols.

91
Arrange the symbols

You can align your model as follows:

92
Chapter 9 Organizing the Display

Center the model on the page


1 Select 9LHZ→3DJH9LHZ→&XUUHQW3DJH.
This displays the entire current page in the work area. Your model may
be spread over two pages, or may be off-center.

2 Click the *UDEEHUWRRO in the tool palette.


3 Click the GLDJUDP.
This selects the whole model.
4 Drag the model to the center of the page.

93
Print the model

Print the model


You can now print the finished model.
1 Select )LOH→3ULQW.
The Print Graphics dialog box appears. One page is selected for printing.

2 Click 2..

6HOHFWSDJHVWRSULQW
When a model is spread over several pages you can select and
deselect pages for printing by clicking them. Selected pages display a
turned down corner.

94
C H A P T E R 1 0

Generating the PDM from the CDM

In this lesson you will generate a Physical Data Model (PDM) from a
Conceptual Data Model (CDM).
What happens You generate a PDM for a particular Database Management System
when you generate (DBMS). Before you generate the PDM, you must select the DBMS referred
a PDM to as the target database. PowerDesigner translates the data types specified in
the CDM into the physical data types which the target database supports.
The correspondence between conceptual and physical data types is defined in
a DBMS definition file. There is a DBMS definition file for each type of
target database.
Shared DBMS You will use a DBMS definition file that is shared with a master DBMS file
in .XML format stored in the DBMS library. This file can be used by any
number of models. Any modifications to the master DBMS definition file are
available to all models using the DBMS in share mode.
Copy DBMS A copy of the master DBMS definition file is saved with the model. Any
definition modifications made to the DBMS are only available to the current model.
PDM translation When you generate a PDM, PowerDesigner also translates the following
conceptual objects into the following physical objects:

Conceptual object Physical object


Entity Table
Entity attribute Table column
Primary Identifier Primary key
Relationship Reference
Identifier Alternate key

What you will do In this lesson you will:


♦ Generate the PDM
♦ Save and close the PDM
♦ Save CDM and exit PowerDesigner

95
Generate the PDM

+RZORQJZLOOLWWDNH"
About 5 minutes.

96
Chapter 10 Generating the PDM from the CDM

Generate the PDM


1 Select 7RROV→*HQHUDWH3K\VLFDO'DWD0RGHO.
The PDM Generation Options box appears.
2 Select 6\EDVH$6$Q\ZKHUH from the DBMS dropdown listbox.
The dialog box proposes TUTORIAL as the default name for the PDM
file. It is the same as the CDM file name but with the extension .PDM.
3 Select the 6KDUH radio button.
You indicate to use the DBMS definition file stored in the DBMS
library.
The PDM General page should appear as shown below.

4 Click the 'HWDLO tab.


The Detail page appears.

97
Generate the PDM

5 Verify that the 'HWDLO page appears as shown below.

The model will be verified by the Check Model before generation. The
Save Generation Dependencies option determines that PowerDesigner
saves the object identification tag for each object in the model. This
option is mainly useful when merging two PDM generated from the same
CDM.
6 Select the 6HOHFWLRQ tab.

98
Chapter 10 Generating the PDM from the CDM

The 6HOHFWLRQ page appears. It lists all the objects in the CDM. By
default, all object checkboxes are selected.

7 If all the object checkboxes are not selected, click the Select All tool.

8 Click 2..
A Result List window displays warning messages indicating that the
CDM reuses certain data items for more than one entity. These warnings
are informational and do not prevent PowerDesigner from generating the
PDM.
9 Close the 5HVXOW window when the generation process has finished.

99
Generate the PDM

The PDM appears in the model window.

Crowded PDM
If your PDM is difficult to read because tables display too much
information, you can reduce the amount of information displayed by
selecting Tools→Display Preferences and clearing checkboxes for the
appropriate object.

Three inheritance entities resulted in one table


In the CDM, you defined the inheritance Title Inherit to generate the
parent only. In the PDM, the resulting table, Title, includes a column,
Periodical, that indicates if a title is a periodical or not. It also
includes columns related to periodicals or non periodicals.

What you learned In this section, you learned how to:


♦ Define generation parameters according to how you want to generate
objects in the PDM
♦ Generate a PDM from a CDM

100
Chapter 10 Generating the PDM from the CDM

Save and close the PDM


You will save the generated PDM.
1 Select )LOH→6DYH$V from the menu bar.
The File Save As dialog box appears.
2 Type *(1787253'0 in the File Name box.
This is the new name for the generated PDM file.
3 Click 2..
This saves your model in the GENTUTOR.PDM file.
4 Select )LOH→&ORVH from the menu bar.
This closes the PDM window and returns you to the CDM window.

101
Exit PowerDesigner

Exit PowerDesigner
You will save and close the CDM, then exit PowerDesigner.
1 Select )LOH→6DYH.
This saves the CDM.
2 Select )LOH →&ORVH.
This closes the model.
3 Select )LOH→([LW.
A confirmation box asks you if you want to save the Workspace.
4 Click the 1R button.
You exit the PowerDesigner application. You have now completed the
CDM tutorial.

102
Glossary

In the Merise modeling methodology an association is a connection between


association
entities

business rule Written statement specifying what the information system must do or how it
must be structured to support business needs

column Data structure that contains an individual data item within a row in a PDM
Entity-relationship diagram that models the information system without
Conceptual Data considering the details of physical implementation
Model (CDM)
Named check that enforces data requirements, default values, or referential
constraint integrity on an entity or a entity attribute
Elementary piece of information
data item
Set of values for which a data item is valid
domain
Person, place, thing, or concept that has characteristics of interest to the
entity enterprise and about which you want to store information
Elementary piece of information attached to an entity
entity attribute
Column or columns in a PDM whose values depend on and migrate from a
foreign key primary key, or an alternate key, in another table
Entity attribute, or a combination of entity attributes, whose values uniquely
Identifier identify each occurrence of the entity
Special relationship that defines an entity as a special case of a more general
Inheritance entity
Table-reference diagram that models the information system including the
Physical Data details of physical implementation
Model (PDM)
Column or columns whose values uniquely identify a row in a table in PDM
primary key
Window that displays the properties of an object
property sheet
Link between a parent table and a child table in a PDM. A reference can link
reference tables by shared keys or by specified columns

103
Glossary

Rules governing data consistency, specifically the relationships among


referential integrity primary keys and foreign keys of different tables in a PDM
Named connection or association between entities
relationship
Collection of rows (records) in a PDM that have associated columns (fields)
table

104
Index

CDM (continued)
define 1, 17
display 87
A open 16
add option 17
data item to entity 50 preference 17
object to package 76 property 22
title box 88 save 23, 102
adjust center
display 16 model 93
align symbol 81
symbol 91 check parameter 26
arrange close
symbol 91 CDM 102
association 103 PDM 101
attach code
business rule to entity 43, 60 data type 32
data item to domain 40 color
attribute 103 title box 89
create 53 window 90
define 50 column 103
entity 43 constraint 103
create
business rule 27
data item 36
B domain 31
business rule 25, 103 entity 45, 49
attach to entity 43, 60 entity attribute 53
create 27 inheritance 80
define 25 package 72
fact 25 relationship 65
formula 25
sort 28
validate 25
D
data item 25, 103
add to entity 50
C attach to domain 40
cardinality 63 create 36
one to many 63 diverge 20
relationship 63 sort 37
CDM 103 data type
check parameter 26 code 32
close 102

105
data type (continued) entity (continued)
default 35 define 43
DataArchitect identifier 43
install 4 parent 79
DEF file 95 sort 47
default
data type 35
define
business rule 25 F
CDM 17 foreign key 103
data item 25
domain 25
entity 43
inheritance 79, 82 G
option 17 generate
preference 17 PDM 97
property 22 global model 71
relationship 63, 67 graphic
delete print 94
object 14
symbol 14
designate
identifier 56
I
identifier 103
detach
designate 56
symbol 14
inheritance 103
diagram
create 80
package 74
define 79, 82
display
mutually exclusive 79
adjust 16
property 82
CDM 87
install
organize 87
DataArchitect 4
preference 17
relationship 70
diverge
domain 20 M
domain 25, 103 model
create 31 center 93
data item 40 print 94
diverge 20 move
enforce 20 symbol 48

E N
enforce name
domain 20 identifier 56
entity 103 relationship 67
add 50 new diagram
child 79 open 74
create 45, 49

106
relationship (continued)
O create 65
object
define 63, 67
add to package 76
dependent 63
delete 14
display 70
open
name 67
CDM 16
one-to-many 65
option
optional 66, 67
CDM 17
property 66
define 17
relationship 67
organize
display 87 S
save
CDM 23, 102
PDM 101
P select
package 71
tool 12
add object 76
sort
create 72
business rule 28
open diagram 74
data item 37
palette
entity 47
tool 10
symbol
PDM 1, 103
align 91
close 101
arrange 91
generate 97
center 81
generate from CDM 95
delete 14
save 101
detach 14
PowerDesigner
move 48
open 8
preference
CDM 17
define 17 T
display 17 table 104
primary key 103 title box
print add 88
graphic 94 color 89
model 94 tool
property palette 10
CDM 22 release 12
define 22 select 12
relationship 66
property sheet 103

W
window
R color 90
reference 103
referential integrity 104
relationship 104
cardinality 63

107
108

You might also like