Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Muhammed Al-MulhemVisual Languages - 2 Visual Programming Languages ICS 539 Diagrams ICS Department KFUPM Sept. 1, 2007.

Similar presentations


Presentation on theme: "1 Muhammed Al-MulhemVisual Languages - 2 Visual Programming Languages ICS 539 Diagrams ICS Department KFUPM Sept. 1, 2007."— Presentation transcript:

1 1 Muhammed Al-MulhemVisual Languages - 2 Visual Programming Languages ICS 539 Diagrams ICS Department KFUPM Sept. 1, 2007

2 2 Muhammed Al-MulhemVisual Languages - 2 Diagrams There are many forms of diagrams to represent programs. Flowcharts are the first and best known diagrams of software. In 1969, researchers at Rand created a language based on Flowcharts [Ellis, 1996] In the early 1970s, researchers at Xerox Parc created the first visual programming environment; namely the Smalltalk environment [Goldberg, 1983]

3 3 Muhammed Al-MulhemVisual Languages - 2 Flowchart Flowcharts are topological, graph-based constructions that often are filled in with program text. The control logic of the program is shown through simple branches and loops. Consider the following example:

4 4 Muhammed Al-MulhemVisual Languages - 2 Start X > 0 Print “yes” Print “no” Stop N N Y Y

5 5 Muhammed Al-MulhemVisual Languages - 2 In some software methodologies, flowcharts are generated by analysts as specification to programmers, who then converts charts into source code. In other cases, flowcharts are generated after the fact, either by hand or automatically. The usefulness of flowcharts has been debated.

6 6 Muhammed Al-MulhemVisual Languages - 2 Flowcharts for large systems tend to get large and messy. In order to work around this problem, extensions to flow charts allow charts to be terminated and resumed on different pages. Still a program with many loops requires return arrows that may span many pages.

7 7 Muhammed Al-MulhemVisual Languages - 2

8 8 Structure Diagrams A structure diagram is a hierarchical, modular breakdown of a program. Between levels on the tree there are links, with symbols to indicate the sort of information that is being passed back and forth. These structures are represented either as trees or as directed acyclic graphs (DAGs). For example look at the next figure.

9 9 Muhammed Al-MulhemVisual Languages - 2 Calculate Payroll Get Employee Record Calculate Net Pay Print Pay Check Calculate Deduction Calculate Gross Pay Employee Record Pay and Date Employee Record Net Pay

10 10 Muhammed Al-MulhemVisual Languages - 2 The structure chart is usually the end result of the activity known as structured analysis, in which the functions of a system are partitioned in a top-down manner. Note the diagrams are purely topological, with labeled edges and nodes. Note also the difficulty apparent in labeling the edges of such a DAG, even on a small example such as the one shown.

11 11 Muhammed Al-MulhemVisual Languages - 2 Nassi-Shneiderman Diagrams In this sort of diagram, hierarchy is shown using the conventions of enclosure and adjacency. Like the others, there is a limit on what they can represent. The figure below shows an example.

12 12 Muhammed Al-MulhemVisual Languages - 2 TRUE FALSE WHILE L1 WHILE L2 IF L1 IF L2 TRUE FALSE S1 S2 S3 S7 S8 S4S5 S6

13 13 Muhammed Al-MulhemVisual Languages - 2

14 14 Muhammed Al-MulhemVisual Languages - 2 Recursion Portrayal Recursion is not an easy concept to teach or understand. Recursion is represented graphically using containment. Look at the next figure.

15 15 Muhammed Al-MulhemVisual Languages - 2 FAC(5) 1 5*FAC(4) 4*FAC(3) 3*FAC(2) 2*FAC(1) 1*FAC(0)

16 16 Muhammed Al-MulhemVisual Languages - 2 Data Flow Graphs A data flow graph is a directed graph consisting of edges, which represent data flow, and nodes, which represent operations. Tokens flow through the graph- when a node has tokens ready on all its incoming edges it will execute. When the node has executed, it puts tokens on its output edges.

17 17 Muhammed Al-MulhemVisual Languages - 2 There is no predetermined sequence to the execution of data flow graph - the data derives the order of execution. Dataflow graphs are often used in conjunction with dataflow machines, computers built to process tokens in parallel. An example is shown next.

18 18 Muhammed Al-MulhemVisual Languages - 2

19 19 Muhammed Al-MulhemVisual Languages - 2 Software Level Charts At a higher level, the functions of a system can be represented in layer diagram. For example the next diagram represents a system where an application can access Motif, X-Lib, a DB API, and a Unix API. Like the others, this only work for simple systems.

20 20 Muhammed Al-MulhemVisual Languages - 2

21 21 Muhammed Al-MulhemVisual Languages - 2 State Transition Diagrams Originated from the study of finite automata. They are used for modeling a variety of event-based computer science domains, including: –Parsing –User Interface –Circuit Design Edges represent transitions from state to state that occur as a result of an input symbol being read. Start and terminating nodes look different.

22 22 Muhammed Al-MulhemVisual Languages - 2 A A A A A B A B B B B B

23 23 Muhammed Al-MulhemVisual Languages - 2 Cell and Arrow Diagrams Cell and arrow diagrams are used to represent data structures. Most often these diagrams are used for teaching programming or for program documentation. The diagrams themselves do not contain enough information to execute from. An example is shown next.

24 24 Muhammed Al-MulhemVisual Languages - 2 ((1 2) 3 4) 12 34


Download ppt "1 Muhammed Al-MulhemVisual Languages - 2 Visual Programming Languages ICS 539 Diagrams ICS Department KFUPM Sept. 1, 2007."

Similar presentations


Ads by Google