Top Level Design for

The FORCE

 
 

Table of Contents:

1.0 Introduction
1.1 References
2.0 The Major Components
2.1 The User:
2.2 THE UI
2.3 The Graph
2.4 The Code Generator
2.5  The Code
3.0  Dependency Diagram
 

1.0 Introduction :

This document contains the top level design for the FORCE, a visual tool for creating C-language programs.
This design begins with an  overview of major system components. It then describes the classes contained within each component.
Finally it gives a dependency graph for all of the major classes involved in the program.

1.1 References :

  This design is based on the specifications given here.
   It is also based on the requirements that are detailed here..
 

2.0 The Major Components:


There are five major components in this design:

Each component represents  a conceptual entity within the structure of the program. They all play distinct roles within it. A component is not a code package.

The Following diagram describes the flow of control within the program between the major components

The basic flow of control in this program is cyclical . It  goes from the UI to the graph to the the CodeGenerator to the Code and then back to the UI . The user uses the UI to specify the graph which is then used by the  CodeGenerator to produce lovely C code. This C-code, when executed, then  communicates back to the program using some networking protocol and gets the UI to animate its execution which looks cool to the user

2.1 The User:

    The User is not actually a piece of code but nevertheless, its abstraction plays a major role in the design of our program .  The user component is where everything starts and ends. The user initiates everything via the UI and is the ultimate receiver of all the other functionality contained within this program .

2.2 THE UI:


    The UI  is the bridge between the user and the rest of the program. It represents everything the user sees and interacts with. This component contains all of the functionality pertaining to :


The major class in the  UI is the GUI which contains all of the various windows used for viewing and specifying the nodes of  a FORCE graph. The other classes in this package, with the exception of FCodeAnimator are all physical entities from within the GUI.
The FWin will be an abstract superclass containing functionality common to all FORCE windows.
The FNodeSelectWin will be a toolbar containing various predefined node types that the user can drag and drop into his graph.  These Nodes include all of the subclasses of FNode other than the identifiers (See Section 2.3 below).
The FVariableWin will be a small window with a scrollable list that represent the contents of FVariableList (See Section 2.3 below).  The user can add variables to the list from here or drag preexisting ones out to the graph.
The FGraphWIn will be the major window where the user connects his various nodes into a functional program.
The FMethodWin will be a small scrollable list just like the FVariableWin which will contain the names of all the functions available to the user. The User will be able to drag and drop any of these onto the main graph or by double clicking select one for editing.  Editing a function, or creating a new one, will replace the contents of the FGraphWin with the SubGraph representing that function.  The user can then return to the main graph by selecting the main() function from the  function list.
The FCodeAnimator is different than the rest of the classes in this component in that it does not have a physical incarnation. Rather this class receives network messages from the code being executed and determines how to animate them in the FGraphVisualizer.
The FgraphVisualizer is an intermediary object between the visual aspect of the program and the graph that represents the data. The FGraphVisualizer represents a wrapper around the regular Fgraph. It contain information pertinent to the display of a node in the FGraphWin.
FNodeVisualizer and FEdgeVisualizer are wrappers around FNode and FEdge respectively. They contain information such as raster location, color, shape, and any other property pertinent to their display.

2.3 The Graph

The Graph component contains all of the classes that pertain to the FORCE visual language. It describes all of the various types of nodes and the rules that determine how  these nodes can be connected.
The Node class represents a a particular language feature. Exactly which feature is obvious from the nodes class name. Each node has information in it that determine what types of node it accepts as parameters and which type it outputs.
Edges then connect the various nodes outputs and  inputs. Edges confirm whether the types are compatible and if not disallow the connection

2.4 The Code Generator



        The Code generator consist of an abstract superclass that represents a procedural language.  This class represents an interface between a language and the rest of force. This type of abstraction allows us to support more languages with the force than just C. In this program, though, there will be only one implementation for the Code Generator Interface. That is the C-language code generator.
 

2.5  The Code

Like the user this component is not actually part of the compiled code for this program. Rather this component represents the finished product of FORCE.  The code though does not sit around idly, though.  If produced with certain options set in the code generator, the code will contain special functions in it that communicate back with the FORCE program and allow for it to animate the codes execution.
 
 
 
 

3.0  Dependency Diagram:



The FApp is the main controlling component that represents the FORCE. It instantiates the other main components like the GUI, the CodeGenerator and the  Graph. The Gui then instantiates all of the windows. The windows then create Nodes via the NodeFactory and then send them off to be packaged by the GraphVisualizer. The GraphVisualizer then passes the pure node along to the Graph object to be stored and checked for validity in its connections. Finally the CodeGenrator can be run at any point to create a program based on the contents of the Graph object.