APPENDIX A

Answers to Exercises

Answers is a strong word. It implies that I know the answer, as opposed to knowing an answer, which is closer to the truth. In other words, you may have different and possibly better answers than I, and that would be a very a good thing!

You will not find answers to the PowerDesigner exercises here – as the exercises describe your objectives.

I find the analogy that I use most frequently is comparing the data model to a blueprint. Most non-technical friends, family, and neighbors understand this analogy. Just like you need a blueprint to ensure a sound building structure, you need a data model to ensure a sound application. Sometimes I also explain to people that a data model is nothing more than a fancy spreadsheet that contains not just the spreadsheet columns, but also the business rules binding these columns. If both the blueprint and spreadsheet analogies fail, I quickly change the subject to the other person and ask what they do (and hope that they never ask me again!).

Here are the domains for each of the following three data elements.

Based upon information from Wikipedia:

An e-mail address is a string of a subset of characters separated into 2 parts by an @, a local-part and a domain, that is, local-part@domain. The local-part of an e-mail address may be up to 64 characters long and the domain name may have a maximum of 255 characters. However, the maximum length of the entire e-mail address is 254 characters.

The local-part of the e-mail address may use any of these characters:

·         Uppercase and lowercase English letters (a-z, A-Z)

·         Digits 0 through 9

·         Characters ! # $ % & ‘ * + - / = ? ^ _ ` { | } ~

·         Character . (dot, period, full stop) provided that it is not the first or last character, and also provided that it does not appear two or more times consecutively.

·         Additionally, quoted-strings (e.g.: John Doe@example.com) are permitted, thus allowing characters that would otherwise be prohibited, however they do not appear in common practice.

A format domain of Decimal(15,4). Both negative and positive numbers are acceptable.

As part of the ISO 3166-1993 standard, Country Code is two characters in length, and is a list domain consisting of over 200 values. Here is a partial list:

Code

Definition and Explanation

AD

Andorra

AE

United Arab Emirates

AF

Afghanistan

AG

Antigua & Barbuda

AI

Anguilla

AL

Albania

AM

Armenia

AN

Netherlands Antilles

AO

Angola

AQ

Antarctica

AR

Argentina

AS

American Samoa

AT

Austria

AU

Australia

AW

Aruba

AZ

Azerbaijan

ZM

Zambia

ZR

Zaire

ZW

Zimbabwe

ZZ

Unknown or unspecified country

 

Just the codes beginning with ‘A’ or ‘Z’ are shown. ‘ZZ’ is an interesting country, and illustrates how easy it is to circumvent a business rule. That is, if we don’t know the country and Country Code is required, we can always assign a ‘ZZ’, for ‘Unknown’.

Recall the model on the facing page:

The following statements can be made about the business rules, based on the role names specified in the relationships in PowerDesigner. The role names are shown in italics.

Each Employee may process one or more Transactions.

Each Transaction must be processed by one and only one Employee.

Each Transaction must be either an Order, a Credit, or a Debit.

Each Order is a Transaction.

Each Credit is a Transaction.

Each Debit is a Transaction.

Each Employee may contact one or more Customers.

Each Customer must be contacted by one and only one Employee.

Each Customer may place one or more Orders.

Each Order must be placed by one and only one Customer.

Each Order may contain one or more Order Lines.

Each Order Line must belong to one and only one Order.

Each Product may appear on one or more Order Lines.

Each Order Line must reference one and only one Product.

Each Product may contain one or more Products.

Each Product may belong to at most one other Product.

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

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