Presentation is loading. Please wait.

Presentation is loading. Please wait.

Functional Modeling 081 0. Question How do you know if you have enough information to compute the necessary output values? How do you know if you have.

Similar presentations


Presentation on theme: "Functional Modeling 081 0. Question How do you know if you have enough information to compute the necessary output values? How do you know if you have."— Presentation transcript:

1 Functional Modeling 081 0

2 Question How do you know if you have enough information to compute the necessary output values? How do you know if you have enough information to compute the necessary output values?

3 Functional Models What is a function? What is a function?

4 Steps in constructing Functional Model Identify data (e.g. input and output values) Identify data (e.g. input and output values) Identify transformations (e.g., functions) Identify transformations (e.g., functions) Identify sources and sinks for data Identify sources and sinks for data Draw Diagram Draw Diagram Identify the constraints. Identify the constraints.

5 Data Flow Diagrams: http://www.yourdon.com/strucanalysis/wiki/index.php?title=Chapter_9 Four things in diagrams Four things in diagrams  Processes (ellipses)  Data flows (arrows)  Actors (boxes)  Data stores (“open boxes”, parallel lines) Data store

6 Simple Example DFD Compute Average Compute Grades Names Output Grades Exam Grades exam average Student Names Grade Book Exam Grades Grades

7 Processes Transforms data values Transforms data values Drawn as ellipses with fixed number of in- arrows and out-arrows Drawn as ellipses with fixed number of in- arrows and out-arrows Example: Example: Integer division dividend divisor quotient remainder

8 Levels of detail Level 1: Shows system inputs, outputs, and processes Level 1: Shows system inputs, outputs, and processes Level 2: Shows inputs, outputs, and processes for some Level 1 process Level 2: Shows inputs, outputs, and processes for some Level 1 process Level 3: Shows inputs, outputs, and processes for some Level 2 process Level 3: Shows inputs, outputs, and processes for some Level 2 process program inputs outputs

9 Data Flows Connect processes Connect processes Represent intermediate data Represent intermediate data Values are not changed by data flow Values are not changed by data flow Arrow with name or type of data Arrow with name or type of data integer a copy simple address city zip Aggregation split address city zip street Aggregation join

10 Actors Producers or consumers of data Producers or consumers of data aka “terminators”, “source and sink” aka “terminators”, “source and sink” Drawn as rectangle Drawn as rectangle Customer

11 Data Store Stores data for later use Stores data for later use Has exactly two operations: Has exactly two operations:  Store  Retrieve Not an actor: must have both store and retrieve Not an actor: must have both store and retrieve Drawn as Drawn as Data store

12 Example Periodic Table Find weight element Atomic weight Atomic weights Initialize table Atomic weights

13 Example Price List Find cost Item name Cost

14 Level 1 Process Payroll Employee Records TimeCards Paychecks Accounting Report

15 Level 2: Payroll Process Calculate Withholding Employee Records TimeCards Paychecks Accounting Report Format paycheck Validate TimeCard Calculate GrossPay Format Accounting Emp. Info. Formatted Acct. Inf. Paycheck Info Gross Pay Valid Timecard Info Timecard Info. Formatted Paycheck.

16 Level 2: Calculate Withholding Compute Withholding Rate Emp. Info. Acct. Inf. Paycheck Info Gross Pay Compute Net Rate

17 Notes: Show all possible computation paths for values. Show all possible computation paths for values. Do not show what paths are executed in what order (that’s the job of the dynamic model). Do not show what paths are executed in what order (that’s the job of the dynamic model). There may be many Level N+1 diagrams for each Level N diagram. Level N+1 expands a single node of a Level N diagram. There may be many Level N+1 diagrams for each Level N diagram. Level N+1 expands a single node of a Level N diagram.

18 Things to check in DFDs 1. Is each requirements function represented by a transform in the DFDs? 2. Is each system input and output represented in the DFDs?

19 Things to check in DFDs (cont’d) 5. Are all labels of information flows in the data dictionary? 6. Do all data dictionary entries appear in the DFDs?

20 UML Activity Diagrams Capture Actions and their results Capture Actions and their results Similar to state diagrams Similar to state diagrams  Actions and results show in terms of state changes  Transitions occur when actions are complete (no events)

21 Purposes of Activity Diagrams Capture work (actions) to be performed when an operation executes Capture work (actions) to be performed when an operation executes Capture the internal work in an object Capture the internal work in an object Show how related actions can be performed Show how related actions can be performed Show how an instance of a use case can be performed in terms of actions and objects Show how an instance of a use case can be performed in terms of actions and objects Show how a business works in terms of actors, workflows, and objects Show how a business works in terms of actors, workflows, and objects

22 Activity Diagrams Actions Actions  Something performed to produce a result  An operation may consist of a set of actions  Drawn as rounded-edged rectangles Edges Edges  Do not have events (except for first edge)  May have guard conditions, send-clause, or action expression  Usually have nothing (transition occurs when action is complete)

23 Activity Diagram Elements Show “Printing” in MessageBox Create pdf file Send pdf to printer Remove MessageBox Customer.Print()

24 Activity Diagram Elements Show “Printing” in MessageBox Create pdf file Remove MessageBox Customer.Print() ^Printer.Print(file)

25 Activity Diagram Elements Show “Printing” in MessageBox Create pdf file Remove MessageBox Customer.Print() ^Printer.Print(file) Show Disk Full msg [full] [free space] > disk status 1 1

26 Style Points Each edge leaving a decision point should have a guard Each edge leaving a decision point should have a guard Guards on edges leaving decision points must not overlap (deterministic) Guards on edges leaving decision points must not overlap (deterministic) Guards on edges leaving decision points form a complete set (must be possible to leave the guard) Guards on edges leaving decision points form a complete set (must be possible to leave the guard)  [otherwise] can be used as a fall through case Model guards only if they add value Model guards only if they add value Simplify Guards (see following) Simplify Guards (see following)

27 Three examples of guards [account.balance >= withdraw.amount] [account.balance < withdraw.amount] [false] [true] > [account.balance >= withdraw.amount] [false] [true] Sufficient Balance?

28 More style points Include start and end points Include start and end points Question “black hole” (no output edge) and “miracle” (no input edge) activities Question “black hole” (no output edge) and “miracle” (no input edge) activities Use connectors to avoid hard to follow edges, but make sure they match Use connectors to avoid hard to follow edges, but make sure they match Use numbers on connectors Use numbers on connectors

29 Parallel Actions Initiate Measure Update Display

30 Using Objects to Represent Datastore Initiate Measure Update Display Measured value

31 Specifying Operations in Greater Detail Need a signature Need a signature  Name  Arguments (number, order, types)  Values returned (number, order, types) Need transformations Need transformations  Functions and equations  Tables of values  Pre and post conditions  Decision tables  Pseudo code  Natural language

32 Operations Trivial Trivial  Access: read or write attributes. May not be necessary to show all of these. Non-trivial Non-trivial  Queries: no side effects  Actions: “instantaneous” (atomic)  Activities: duration over time


Download ppt "Functional Modeling 081 0. Question How do you know if you have enough information to compute the necessary output values? How do you know if you have."

Similar presentations


Ads by Google