Unified Control-Data Flow Diagrams (UCDF) ReferenceBasic blocksRelations and flows123Module, Device,SystemCode or Process(in general sense)Data or ProductHolderFileCollection DocumentInformational Contentof any flow in general senseCommentComment line or a line to a functional description, Any relation not explicitly defined in code, mapping. For example:Order linefunctionLegendOther elements1threadXTODO&^ORcollection123In detailControl blockf()Control Block is any executable piece of software code (or any process). Control blocks are connected by control flow lines.Any block grants chance of execution to its sub-blocks through a separate control line.15int x = 6;{ int y; y = g(x+2);}log.print(y);return;A function is shown as a code blockAny operator is a code block6A scope is a code blockAny chunck of code can be a code blocklog.print(x);button.text(x);2// x = amend(x);Code commented out also can be a block3Placeholder4Even an empty string can be a block.It is useful when providing help for a libraryint y;y = g(x+2);12Control (execution) is passed from blockto block along the ordered line whichdefines a control flow. By nature of software, any block returnsback to the node. Not every piece of codemay be shown, only important ones. If the order is unknown, or the calls are asynchronous numbering is absent. Numbering may be also absent when it is not important. Likewise, not every codecomponent has to be shown.Any code block may have its own control line or lines.Gint g(int)This means "operator y = g(x+2) calls the function g(int) of the module G"12A function has its own control flow lineHere is an example of a function call.More about it later.Higher Level, or abstractionAll diagrams can be abstracted further, showing the structure on the higher level. Here, it is shown without details that the function f() calls g() of the module G.f()int g(int)Further abstraction:f()Control flow is a flow of timeIn UCDF, control flow is understood as a flow of time granted by a processor to a unit to execute its instructions. A unit may distribute this "flow" into its components. Control flow order line labels can be timestamps, absolute or relative. Parallel processes have their own timelines.19:30.2519:31.3319:35.02Modules can "call" each other.FControl flow linesControl flow lines (time-lines)are shown with the thin rectangular line(never curved!)It is preferred that the line starts at the right or bottom sides, and ends at the left and top sides.Documents as control blocksAs instructions, documents may serve as control blocks. Symbol of a human operator and/or a window may be omitted.click a buttonOnButtonClick()Software blockas a systemFrom theoretical perspective every software block has two kinds of inputs and outputs:control and data, in other words, time and information. Essentially, what any informational and control system doesis transformation of time into information and information into time.Code, while is being executed in a machine, distributes, allots time between the machinecomponents to receive and update information in the machine's internal or external data holders.codetimeinformationtimeinformationWhile using order lines for time flows,it is understood that the control is passedto a block from a node, and then is receivedby the same node. This is how most modern computer systems operate. It is notnecessary to show the arrow back to the node, though it is assumed. For how it is done duringexception handling and if-statements(conditional execution) refer to the appropriate sections of this reference.Advantage of the order line is that on the samediagram we can show a function with its structure called from different places in the code. We are not lost.f()1int x = 6;log.print(y);return;3log.print(x);button.text(x);2endThe order line representing control flow is essentially thisWhy order lineLet us take the conventional flowchart. Let blocks A, B, and C be executed sequentially.Then, later, we want to show sub-blocks of the Block B, namely Block B1 and B2. Now, how would we know that B1 is actually a sub-block?There is no way, especially if the diagram is a bit more complicated. It is ambiguous.Block ABlock BBlock CBlock B1Block B2While with order lines there is no ambiguity. The diagram can expand showing more or lessdetails as needed. How conditional executionaffects order see the appropriate section.Block ABlock BBlock CBlock B1Block B213213Order is one of the most fundamental mathematical properties of systems. It pays to show it explicitly.Flexibility withblocksCode blocks do not have to correspond precisely to operators, {} blocks, and functions. They can be flexible describing any group of code, or virtual, similar to pseudo code if it helps to achieve the diagram's clarity. For example:A();int x = X();int y = Y();B();132A()Retrieving coordinatesB()12int x = X();int y = Y();wWinMain// Message Loopmessage==WM_QUITendShortening of control lineOften an internal block exits from the containing function. It can be shown with the "end" of order line. A dashed line can illustrate continuity of the order line. Dashed line can be used in any place where the order line is too long and winding. It is to show a shorter path. The order line is distinguished from other lines as being always orthogonal: vertical or horizontal with the right angle bends.132465see "informational content of a control line" or a content of any flow like a product, moving particles, etc.order in timelogical order or order in spacehow many times a call is madeendGGGFthread1123thread2123Operations departmentGretaJimlink to another diagramororInformational content of a data holder or an exampleTimingTime required for execution can be shown at the control lineA();int x = X();int y = Y();B();132A()Retrieving coordinatesB()12int x = X();int y = Y();Difference between a module and a code blockWe use a module block when the complexity of the block's system is emphasized, and a regular code block if a description of the system action as a single unit is enough. The same system can be depicted as a module or a simple block depending on surrounding diagram elements. See the example. It is a bit contrary to what usually is understood by a module (a unit of some complexity with which a more complex system can be built), but a function is not called a module either.To simplify things, we do not have an abbreviation for the very top level system. It is a module too. Well, aren't they on a larger scale?myExemain()Win32static contructors1global variablesSoCRobotNetworkInstallation AmyExe2Usually a library is a module. A class is assumed to be a module too. Any collection of code elements can be a module when unified in some sense and used in multiple ways. A function usually is a code block, but it can be a module, when it calls to other code which can generate a multitude of exceptions which are caught outside of the function and we have to diagram it all.Try-CatchHere is the typical control flow when exception handling is implemented and should be shown.n+1last+1lastntryCode within the try-blockcatch1Code below try-blocklast+2Code within the catch-blockthrow or exceptionLines through missing blocks Intermediate control blocks connected by control lines as well as with other lines, like dataflow lines, can be omitted for clarity. If it is important to show that the flow is not direct, a dashed line can be used. This feature is under consideration. Diagramming should reflect the important withoutovercomplication.ABCACACAabequivalentababequivalentFile1File2different"virtual" blocks may be highlighted by, for example, a dashed line.If one want to show that intermediate codeblocks or datahodlers exists, it can be shown with small unnamed block.ACf()NAIf the source or target of any block is unknown, and we want to show it, it also can be done with a small block. ACA small module block can be used to show that the calls between are complexNetwork(Network is a module, but often a special, long box is useful)FGQuantity of calls or dataflows from any block to any block can be shown as a numberThere is no ambiguity when UCDF order lines are used.Block ABlock BBlock B1Another example. Here is the conventional flowchart. Block B1 (a function) is called from B and B2. If a diagram is intricate enough, how can we know that B->B1->C and B2->B1->C2?Block CBlock A2Block B2Block C2Block ABlock BBlock B1Block CBlock A2Block B2Block C2132132Order lines allow representation of control flows of any complexity.This is the fundamental idea behind UCDF: information processes are transformations of time flows into information flows (i.e. data flows) and information flows into time.What is time (control) flow? When a processor grants execution time to a component, it means "time flows into", while execution is performed inside the component, it is its time content, when execution moves out of the component, it means "time flows out". This abstraction allows unified classification of all components (data and instructions) and flows (information flow and control (time) flow) and more.1Control contentof a data flowNextControl FlowData Flowcreate or destroyhas"is" or "example of"points toor index ofTHE SAMEState TransitionhasElements of the same collectionhas24hashas23ms78ms7-124ms15ms3mshashashas8