Tuesday, April 14, 2009

Decision Tree And Structured Engish

Once the data elements are defined in the data dictionary, we begin to focus on the processes. Since bookstores get discounts on books acquired from publishers, we can expect one lower-level process to verify the discount. This is done through a publisher discount policy known to the bookstore in advance. For illustration, let us assume the following discount policy:

A policy statement like this can be time-consuming to describe and confusing to implement. The analyst heeds to use tools to portray the logic of the policy. The first such tool is the decision tree. It simply sketches the logical structure based on the stated policy. In this respect, it is an excellent tool: It is easy to construct, easy to read, and easy to update. It shows only the skeletal aspects of the policy, however, in the sense that it does not lend itself to calculations or show logic as a set of instructions for action. The alternative, then, is the use of a second tool called structured English.

Structured English borrows heavily from structured programming; it uses logical construction and imperative sentences designed to carry out instructions for action. Decisions are made through IF, THEN, ELSE, and so statements. The structured English for our publisher's discount policy is shown

We can actually make structured English more compact by using terms defined in the data dictionary. For example, the process ORDER may have the data element ORDERSIZE, which define four values:


MINIMUM: 5 or fewer copies per book title

SMALL: 6-to 19 copies

COMPUTE-DISCOUNT

Add up the number of copies per book title IF order is from bookstore

and-IF order is for 6 copies or more per book title

THEN: Discount is 25%

ELSE (order is for fewer than 6 copies per book title)

SO: no discount is allowed

ELSE (order is from libraries or individual customers)

order is for 50 copies or more per book title discount is 15%

ELSE IF order is for 20 to 49 copies per book title discount is 10%

ELSE IF order is for 6 to 19 copies per book title discount is 5%

ELSE SO:

(order is for less' than 6 copies per book order) no discount is allowed

MEDIUM: 20 to 49 copies LARGE: 50 or more copies

From these examples we see that when logic is written out in English sentences using capitalization and multilevel indentation, it is structured English. In this tool, the logic of processes of the system is expressed by using the capitalized key words IF, THEN, ELSE, and so. Structures are indented to reflect the logical hierarchy. Sentences should also be clear, concise, and precise in wording and meaning.

No comments:

Post a Comment