CHAPTER 10

How can we work within the PowerDesigner environment?

Objects, Symbols, Links

GUIDs, properties, methods

There’s always a way

In this chapter, we introduce you to the essential components and features of PowerDesigner for data modeling and general model management. After you have read this chapter, followed us in the ‘Your Turn’ sections, and finished the Exercise, you’ll be ready to do some real work in PowerDesigner.

If you only use PowerDesigner occasionally, or need to refresh your knowledge, come back to this chapter and work through it again. The PowerDesigner interface will look familiar if you’ve used other major data modeling tools before, but there are some important differences that may not be apparent at first.

This book contains a lot of information about ways of doing things in PowerDesigner. In the exercise and ‘Your Turn’ sections, you may prefer to focus on the fundamental knowledge and techniques first. Please, feel free to practice the fundamental techniques in place of more advanced ones, and try out the advanced techniques when you have more experience with using PowerDesigner. The fundamental techniques are highlighted by the PowerDesigner symbol for a Requirements model (). Here is a list of sections containing fundamental information – each entry in the list is the relevant heading in the book. They are listed in the order in which you’ll find them in the table of contents.

The building blocks

Renaming objects and symbols

Quickest way to create a primary id

Not just a load of symbols

Showing and hiding symbols

CDM settings

Names and codes in objects

Menus depend on models

LDM settings

Interface overview

Workspaces

Linking the LDM to other data models

Organizing views

Creating a model

PDM settings

The toolbox

Backup files

Approaches for creating a PDM

Contextual menus

Opening a model, project, or workspace

Creating a reference from the palette

Object property sheets

Finding things again

Creating a view

Common properties

Drawing new entities

Denormalization in PowerDesigner

Do not generate me

Creating entities in the browser

Reverse-engineering databases

Object lists

Object property sheets

Keeping model and database in synch

Moving, copying and deleting objects

Standard properties for data elements

Compare and merge

Undoing things

Data items in PowerDesigner

Checking a model

Working with diagrams

Attributes and columns in PowerDesigner

Impact and lineage analysis

Working with symbols

Creating candidate identifiers

 

 

 

When you start the PowerDesigner application, you’re presented with the Welcome Page (shown in Figure 10.1), which provides you with quick access to all your recent work, a range of helpful materials, and the ability to open or create models or projects. This screen will be presented every time you start PowerDesigner, unless you suppress it by selecting the ‘Do not show this page again’ checkbox. You can view the Welcome Screen any time you choose, via an option on the ‘View’ menu, or by pressing <Alt+3>.

Figure 10.1 The Welcome Page

If you launch PowerDesigner by opening a model via Windows Explorer, you won’t see the Welcome Page.

Model objects are the building blocks of your models. They are listed as items in the Browser and may also appear as symbols in your diagrams.

There are two main types of objects:

·         Ordinary Objects – such as tables and entities, which are self-sufficient, and can be created in isolation from other objects

·         Link Objects – such as relationships or references, which link two ordinary objects, and cannot be created in isolation

Some objects can only exist ‘inside’ another object. We call these ‘sub objects’. For example, attributes within an entity, or columns within a table. The parent objects are called ‘composite objects’.

You can create objects:

·         Directly in your diagram using a Toolbox tool (only for objects that have symbols). See Chapter 11 for more information.

·         From the Browser.

·         From a list of objects.

In Chapter 8, we discussed the key differences between a drawing tool and a data modeling tool. If you’ve never used a data modeling tool before, you may not have encountered the distinction between a symbol on a diagram and the underlying definition of the object. In some drawing tools, the symbol does not have an underlying object definition: delete the symbol, and the object is lost forever.

Each type of PowerDesigner diagram supports certain specific types of objects, and each object created in a diagram is represented by a symbol. In fact, anything that appears on a diagram is a symbol. Most PowerDesigner objects can be represented on diagrams, so they have their own symbols. Links between objects also have symbols. The most common symbols you’ll see in this book are Entities and Relationships. Some objects, such as Data Items and Domains, cannot appear on PowerDesigner diagrams, so they do not have symbols.

The majority of symbols on your diagrams will link to objects, the others are what we call ‘decorative’, though they may not be just for decoration. Notes, text boxes, and rectangles, for example, are very useful for providing additional information to the reader of a diagram.

In PowerDesigner, you can create a model by drawing symbols on diagrams, or by creating the object definitions first, and then drawing diagrams. For example, you can import a cartload of objects from Excel into a new model, and then create new diagrams containing symbols of those objects, manually. The Excel import can also create symbols on your current diagram for you.

An object can appear on many diagrams, and the object’s symbol can look completely different on every diagram, if you want it to. The same object can be represented by many symbols. Objects can also appear as shortcuts or replicas in other models. So a symbol on a diagram in Model A could represent an object in Model B.

Every PowerDesigner object, including models and diagrams, has a name and a code. The name of an object identifies the object within the PowerDesigner model. The code is the technical name for the object, automatically managed by PowerDesigner when you create or rename an object. The code is used when external objects are generated by PowerDesigner.

Put simply, the name is the ‘business name’ for an object, and the code is the name for the object when it is subject to constraints imposed by technology, such as a DBMS or XML Schema language.

This is a different approach from the other major data modeling tools, which generally have a ‘logical’ name (for entities and attributes, etc) and a separate ‘physical’ name (for tables and columns, etc). Table 10.1 demonstrates the differing approaches using a simple example, an entity called Customer Address.

Table 10.1 Alternative naming approaches

Object

PowerDesigner Object Name (and Code)

Object Name in other tools

Entity (Logical Data Model)

Customer Address

CUSTOMER_ADDRESS

Customer Address

Table (Physical Data Model

Customer Address

CUSTOMER_ADDRESS

CUSTOMER_ADDRESS

Table (SQL File)

CUSTOMER_ADDRESS

CUSTOMER_ADDRESS

PowerDesigner applies uniqueness checks on the names and codes of objects. The namespace defines an area in which the name and the code of an object of a given type must be unique. For all data models, the entire model is, by default, a single namespace - PowerDesigner applies checks on uniqueness at the model level. For Data Items and Relationships, the rules can be relaxed slightly, as we’ll see later.

PowerDesigner allows you to partition your model using the Package concept, borrowed from the UML standard; see Packages later in this chapter to see how this can impact the uniqueness of names and codes.

By default, the object codes automatically mirror the object names. For example, the default code for an object called ‘Ice Cream’ could be ‘ICE_CREAM’ or ‘IceCream’. The format of the name and code are determined by the naming conventions set for the model. The conventions also describe the way in which codes are generated from names. If you make changes to these conventions in the model options, names and codes will change accordingly.

You can override the mirroring process in several ways:

·         To override the mirroring for a single object, deselect the ‘equals sign’ button, circled in Figure 10.2, in the ‘General’ tab on the object property sheet. This also works in a list of objects, if you have the code column displayed.

·         To replace the mirrored code for an object, just overtype the code in an object property sheet or a list of objects. Mirroring will be automatically suspended when you do this, though you can (via the model options) re-impose the naming conventions.

·         To reverse the Name to Code mirroring for a single object, select the ‘equals sign’ button to the right of the name field in the ‘General’ tab on the property sheet, or in a list of objects.

Figure 10.2 Name-Code mirroring buttons

Within the General Options (on the ‘Tools’ menu), the ‘Dialog’ tab allows you to disable Name to Code Mirroring. If you do this, the code will mirror the name of the object given when it is created, and it will not subsequently be altered by PowerDesigner if you change the name of the object. You are strongly advised NOT to disable Name to Code mirroring in data models.

When you generate one model from another, you can influence the way in which codes are generated using conversion scripts. You do have the option to convert Codes into Names if you choose to - this would be appropriate when ‘reverse-engineering’ from a physical view of data to a business view.

See Chapter 20 for more on the topic of naming conventions.

  Naming Conventions (Core Features Guide)

The PowerDesigner interface contains panes that provide various views of your modeling project. Most of these panes can be closed or moved around the interface, so you can customize the interface to suit the way you work and the environment in which you’re working. A typical view of the interface is shown in Figure 10.3. The user interface was re-written in Version 16, so expect it to look a little unfamiliar if you have experience with earlier versions of PowerDesigner.

In the upper part of Figure 10.3 you can see the PowerDesigner general title bar and the menu bar. Below the general menus, you can display any of eight customizable toolbars.

The labels in Figure 10.3 identify the key views available within PowerDesigner.

Figure 10.3 The PowerDesigner interface

·         The Browser view - displays your models and the objects belonging to them, and allows you to rapidly navigate between them. The Browser also has a tab that shows you the contents of your repository-based Glossary. The third tab gives you access to a PowerDesigner repository, where you can store all your models and associated files.

·         The Canvas view - the primary pane that displays your current model diagram or report outline. Note the series of tabs that allow you to select which of the open diagrams you wish to view.

·         The Toolbox view - provides graphical tools to help you quickly build model diagrams. The tools available will change depending on the type of diagram. The Toolbox provides a single location for all the tools you need to add content to your model diagrams. Introduced in PowerDesigner Version 16, the Toolbox replaces the old palette and predefined symbols toolbar.

The Toolbox and Toolbars can be opened, closed, and moved in much the same way as the dockable views. In addition, you can customize toolbars and toolboxes, or create new ones.

·         The Output view - shows the progress of any PowerDesigner process, such as checking in a model or generating or reverse engineering a database.

·         The Result List view - displays the results of a search or a model check.

In addition, the bottom line of the PowerDesigner window is used to display information about current objects, such as:

·         The file name and path for a model, when a model is selected in the Browser

·         Progress messages when opening or saving a model

·         The ‘language’ for a model, such as the DBMS for a PDM, the process language for a Business Process Model, or the XML Schema Language for an XML model

You can show, hide, organize, and customize the PowerDesigner toolbars to suit your workflow.

·         To move a toolbar in the toolbar tray, click and hold on the four dots on the left edge of the toolbar and drag it to the desired position.

·         To show a hidden toolbar or hide a visible toolbar, right-click the toolbar tray, select Toolbars, and check or uncheck the toolbar.

·         To access tools on a toolbar that is not fully visible due to lack of space, click on the down arrow on the right edge of the toolbar.

·         To lock all toolbars to protect them from accidental movements, right-click the toolbar tray and select Toolbars|Lock Toolbars.

·         To add tools to or remove them from a toolbar, or to create new toolbars, right-click the toolbar tray and select Toolbars|Customize Menus and Tools.

  Organizing Toolbars (Custom Features Guide)

The views shown in Figure 10.3 can be moved, grouped, split, hidden, floated or auto-hidden. You can also carry out the same actions, in a more limited fashion, for diagram tabs in the Canvas.

There are two key techniques for manipulating views – mouse-clicking and dragging.

All views, apart from the Canvas, have a set of icons on the title bar that can be used to change the view’s behavior. Right-clicking the title bar, or left-clicking the drop-down arrow (circled in Figure 10.4) displays the menu shown in Figure 10.4.

Figure 10.4 A view menu

·         Float - promote the view to an independent window.

·         Show - disable auto-hiding (you can also click the sideways pin symbol to pin the view open).

·         Dock as Tabbed Document - add the view to the Canvas as a new tab.

·         Auto Hide - hide the view as a small tab on the side of the screen that re-expands when you hover over it (or click the vertical pin to unpin the view).

·         Hide - remove the view from your window. To show a hidden view, select View|View Name on the menu bar.

If you click the pin symbol in Figure 10.4, the view will auto-hide. The name of the view will appear on a tab, on the nearest edge of the PowerDesigner window. In Figure 10.5 all of the views have been auto-hidden, and the tabs for the views have been ringed. Hover the mouse over one of these tabs, and the view will appear; move the mouse away and the view will hide again. To stop the view from hiding away, use the Show option on the menu in Figure 10.4, or click the sideways pin symbol to pin the view open.

Before we move on, take another look at the bottom right-hand corner of Figure 10.5. The current diagram is an XML diagram, so the XML Schema Language is displayed here.

Figure 10.5 All views auto-hidden

You can move any view (as long as it isn’t auto-hidden) to anywhere in the PowerDesigner window. Drag the title bar of any view with the mouse, and ‘docking selectors’ appear; release the view on one of these docking selectors to select the new location for the view. Figure 10.6 shows the docking selectors (circled) that appeared when the Output view was dragged away from the foot of the PowerDesigner window.

Note: The Browser is a single view with up to three sub-views (Local, Glossary, and Repository). These sub-views cannot be moved independently. The same applies to the tabs in the Output view.

There are two types of docking selectors shown in Figure 10.6, the four-way selector in the center, and one-way selectors on the edges of the window. Drop the Output view onto one of the one-way selectors, and it will extend the full height or breadth of the PowerDesigner window.

Figure 10.6 Docking selectors

In Figure 10.7 you can see the result of docking the Output view at the foot of the PowerDesigner window, and docking the Result List on the right-hand side.

Figure 10.7 Docked at the foot and the side

When you drag the Output view over any of the other views, the four-way selector appears; in Figure 10.6 it appears over the Canvas, but it could also appear over the Browser or the Toolbox. Drop the Output view over any of these selectors, and it will be grouped with that view.

Here’s how it works - when you drag the Output view onto a docking selector, the new location for the view is highlighted. In Figure 10.8, the view has been dragged onto the circled docking selector; if the view is dropped here, it will occupy the shaded area in the Canvas.

Figure 10.8 Where the view would be dropped

Figure 10.9 shows the result. The Output window is now in its own section of the Canvas.

Figure 10.9 The result

To group a view with another view – drag it over the view, then drop it on the central dock selector, shown on the right. For example, you could drag the output window into the Toolbox – see the result in Figure 10.10.

 

Figure 10.10 Grouping two views together

The dropped view is stacked on the other view, and each has a tab at the top of the group to select it. To separate the views, just drag one of the tabs to another location. To place the view next to, above, or below another view - drop it on the left, right, top, or bottom dock selector.

To promote a view to an independent window, drop it anywhere except on a dock selector. You can move this window anywhere in your Windows real estate, even onto a different display.

You can restore a window that is no longer displayed via the menu. Select View|window name (Browser, Output, Result List, Toolbox, or Welcome Page).

Windows are restored into their most recent position on the screen.

You can change the size of windows using the mouse pointer. Hover the mouse over the edge of the window; when the pointer changes into a double-headed arrow, you can drag the edge of the window to resize it. Other windows are adjusted to match. Figure 10.11 illustrates this.

Figure 10.11 Using the double-headed arrow to drag a window

  Organizing Views (Custom Features Guide)

The ‘View’ Toolbar contains tools to show or hide some of the standard windows, and to change your view of the current diagram. See Figure 10.12.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset