DOC PREVIEW
Toronto CSC 340 - Business Rules

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Page ‹#› 2003 John MylopoulosBusiness Rules -- 1Information Systems Analysis and Design CSC340Business RulesBusiness RulesStructured EnglishStructured EnglishDecision TablesDecision TablesDecision TreesDecision TreesX. Business RulesX. Business Rules 2003 John MylopoulosBusiness Rules -- 2Information Systems Analysis and Design CSC340I Business rules are used to describe the properties of an application,e.g., the fact that an employee cannot earn more than his or hermanager, or that every employee has a unique employee number..I A business rule can be: An integrity constraint on the data of the application, e.g.,“each employee earns less than her manager”; a derivation rule, whereby information can be derived fromother information, e.g., “the price of a train ticket, in Canadiandollars, is given by the distance to be travelled in kilometers,multiplied by 0.2, multiplied by 1.5 for a first class ticket” .Business RulesBusiness RulesPage ‹#› 2003 John MylopoulosBusiness Rules -- 3Information Systems Analysis and Design CSC340Examples of Business RulesExamples of Business RulesConstraints(BR1) The manager of a department must belong to thatdepartment.(BR2) An employee cannot earn more than her manager.(BR3) A department of the Toronto office can only bemanaged by an employee who has ≥ 10yrs experience.(BR4) An employee can only participate in projects associatedwith her department.Derivations(BR5) The budget of a project is the sum of all salaries ofparticipating employees, multiplied by 3. 2003 John MylopoulosBusiness Rules -- 4Information Systems Analysis and Design CSC340I How do we specify business rules? We’ll be looking at severalalternative notations.Natural LanguageNatural Language -- use unrestricted natural language...but suchdescriptions can be highly ambiguousStructured English Structured English -- use a subset of a natural language (bothsyntactically and vocabulary-wise) to minimize ambiguities...thishas been used with some successDecision TablesDecision Tables -- use a table representation of alternativeoutcomes (similar to truth tables)Decision Trees Decision Trees -- use a tree representation of alternativeoutcomesWe need representations that are understandable by end userWe need representations that are understandable by end userSpecifying Business RulesSpecifying Business RulesPage ‹#› 2003 John MylopoulosBusiness Rules -- 5Information Systems Analysis and Design CSC340Looks a lot like pseudocode:Takes some effort to specify, not very readable,Takes some effort to specify, not very readable, too close to an implementation too close to an implementationStructured EnglishStructured EnglishFor each LOAN ACCOUNT NUMBER in the LOAN ACCOUNT FILEdo the following steps:If the AMOUNT PAST DUE is greater than $0.00 thenwhile there are LOAN ACCOUNT NUMBERS for the CUSTOMERNAME do the following:sum the OUTSTANDING LOAN BALANCESsum the MINIMAL PAYMENTSsum the PAST DUE AMOUNTSreport the CUSTOMER NAME, LOAN ACCOUNT on OVERDUECUSTOMER, LOAN ANALYSISFor each LOAN ACCOUNT NUMBER in the LOAN ACCOUNT FILEdo the following steps:If the AMOUNT PAST DUE is greater than $0.00 thenwhile there are LOAN ACCOUNT NUMBERS for the CUSTOMERNAME do the following:sum the OUTSTANDING LOAN BALANCESsum the MINIMAL PAYMENTSsum the PAST DUE AMOUNTSreport the CUSTOMER NAME, LOAN ACCOUNT on OVERDUECUSTOMER, LOAN ANALYSIS 2003 John MylopoulosBusiness Rules -- 6Information Systems Analysis and Design CSC340Another ExampleAnother Example• do while there are more staff in the list• calculate staff bonus• store bonus amount• begin case• case bonus > £250• add name to StarOfTheMonth list• case bonus < £25• print warning letter• end case• end doPage ‹#› 2003 John MylopoulosBusiness Rules -- 7Information Systems Analysis and Design CSC340 Use only nouns and terms defined in the project dictionary Avoid compound sentences because they can be highly ambiguous Avoid undefined adjectives and adverbs (such as “good”, “nice” etc.)unless if clearly defined in the dictionary in terms of value ranges(e.g., “good” ↔ 65-75%) Avoid language that destroys the natural flow of control within theprocess (i.e., goto’s) Use a limited set of flow constructs, such as sequencing, if-then-else,while do etc.Some Rules for Structured EnglishSome Rules for Structured English 2003 John MylopoulosBusiness Rules -- 8Information Systems Analysis and Design CSC340I If there are n parameters (or, conditions) to a decision, each of whichcan take k1, k2,...kn values, then make up a table with k1 * k2 *... * kncolumns and as many rows as there are possible actions (or,outcomes)I For example:I “If the plane is more than half fullmore than half full and the flight costs more than $350flight costs more than $350per seat, serve free cocktailsserve free cocktails, unless it is a domestic flightit is a domestic flight. Charge forCharge forcocktailscocktails in all domestic flightsdomestic flights where cocktails are served, i.e., thosethat are more than half full”conditionsconditionsoutcomesoutcomesDomestic Y Y Y Y N N N N≥ half full Y Y N N Y Y N N≥ $350/seat Y N Y N Y N Y NServe cocktails X X X ? ? ?Free cocktails XDecision TablesDecision TablesPage ‹#› 2003 John MylopoulosBusiness Rules -- 9Information Systems Analysis and Design CSC3401. Identify all conditions and all outcomes2. Create the decision table, with onecolumn for each possible combination ofcondition values and one row for everypossible outcome3. Fill in the table4. Eliminate ambiguities, uncover cases,contradictions, redundancyHow to Construct Decision TablesHow to Construct Decision Tables 2003 John MylopoulosBusiness Rules -- 10Information Systems Analysis and Design CSC340Domestic Y Y Y Y N N N N≥ half full Y Y N N Y Y N N≥ $350/seat Y N Y N Y N Y NServe cocktails X X X X XFree cocktails X XCharge cocktails X X XNo cocktails X X XDomestic Y Y N N N≥ half full Y N * Y N≥ $350/seat * * Y N NFree cocktails X Charge cocktails X XNo cocktails X XCompletionCompletion(includes


View Full Document

Toronto CSC 340 - Business Rules

Documents in this Course
Scoping

Scoping

10 pages

Load more
Download Business Rules
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Business Rules and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Business Rules 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?