TeamF::CGTMain Page | About | Help | FAQ | Special pages | Log in

Category: Documentation

Software Design Description 2

From TeamF::CGT

Contents

Abstract

This document contains the design aspects of the Corporate Governance Toolkit project. It provides both the high-level architectural design of the system as well as the detailed design description.

Introduction

Purpose

The purpose of this document is to provide an easy-to-follow design for the the Corporate Governance Toolkit (CGT). It shall provide the programmers of this system with a guide to the user interface design and its internal functionalities.

This document is also based on the requirements elicited in the Software Requirements Specification (SRS). Hence, the aim is to provide the complete design based on the final version of the SRS.

Also, this document serves as:

This document is assisted by the following complimentary documents:

1. Software Quality Assurance Plan (SQAP)

2. Software Requirements Specifications (SRS)

3. Software Architecture Design Document (SADD)

Intended Audience

The intended audience of this document includes the following teams:

Scope

This document incorporates the chosen architectural design method in the SADD and provides a complete overview of the system. It will also show a detailed design of the system along with its major dependencies among the 3 subsystems i.e toolkit, data layer, and user application. Detailed design down to a functional unit level is also provided.

Acronyms and Abbreviations

References

Product Description

The CGT system is a toolkit allowing Risk Wizard to create a customised corporate governance application. The main aim of the system is to allow users to create a customised corporate governance applications by stepping through the toolkit.

Architectural Design


Overview

The proposed system is divided into two applications:

  1. The User Application
  2. The Toolkit, which will be used to set up the configuration of the User Application.

The Data Flow Diagram below shows how these two applications will relate to each other. In the Toolkit the TA (Toolkit Administrator) will build the configuration that will be used in the User Application. What this "configuration" refers to is:

To view a formal description of the configuration, see the configuration class diagrams. Upon completion of building the configuration in the toolkit, all of the configuration will be stored as XML. In addition, a SQL script will be generated in order to create the database will which store the buisness data.

The database will need to be manually created onto a server by an administrator by running the SQL script. This could be done either by Risk Wizard, or by the UAA (User Application Administrator) who is an administrator for the buisness/organization that will be using the product. Once this is done the UAA will run the User Application and use it to enter initial records into the database. Once the database has been set up properly it will available for use by the UAUs (User Application Users) who will be the employees/members of the buisness/organization.

When the user application is run it will read in the configuration from the XML file, read in records from the database and provide the customized application to the end user.

To formally clarify the entire process:

  1. The TA sets up the configuration using the Toolkit
  2. Toolkit exports an XML file and an SQL script
  3. The database is set up on a server by running the SQL script
  4. The UAA runs the User Application to create initial buisness records in the database
  5. The UAUs (and UAA) uses the User Application (for corporate governance, risk management, or which ever purpose the system is intended to be used for).

The following diagram illustrates this process:

Overall Data Flow Diagram
Overall Data Flow Diagram

In addition to this the Toolkit will also provide the facility of loading an XML file back into to it to make modifications to a configuration. The current scope of this project does not include modification to an already existing database by the Toolkit, hence if an XML file is re-loaded into the Toolkit for further modification a new database will need to be created for the changed configuration.

Overall System Design

The CGT system has been design to statisfy the requirements of the SRS. The system has been design in an object orient (OO) fashion, and all aspect of the design will reflect this. A Three Tiered (layers) architecture was choosen to define the overall system. The rational behind the decision of the basic architecture of the system is given below.

Design Rationale

A number of various software architctures of desgin patters were researched before the design was made to adopt the Three Tiered Architecture. Listed below are other architecture that could have been chosen instead of Three Tiered.

Model-View-Controller

Client Server

Dependencies between Layers

Dependencies between Data Layer and Toolkit

The Toolkit interacts with these classes in the Data Layer:

Refer to Configuration Library Module.

Dependencies between Data Layer and User Application

The User Application interacts with these classes in the Data Layer:

Refer to Database Library Module.

Modular Decomposition


Data Layer Decomposition

Overview of Data Layer

Data Layer is the bottom layer in our three-tier architecture. It is distinct from other layers in a sense as it serves both the Toolkit and the User Application.

The Purpose and Functions of the Data Layer: Data Layer provides all the functionalities necessary to store and retrieve data for both the Toolkit and the User Application. In particular, there are two types of data, classified on the basis of nature of their storage:

  1. Persistent Data
  2. Temporary Data

Persistent Data: The persistent data relates to the configuration that describes the structure of the User Application such as the database schema and relationship between information. They will be stored in a xml configuration file. Other persistent data relates to the business data that the User Application needs to store. This will be stored in a database.

Temporary Data: Temporary data refers to data retrieved from a file or database and stored in the memory for either the Toolkit or the User Application to manipulate. They must be in memory for faster access. The Data Layer provides the means for the Toolkit and the User Application to access and save them either in a database or in a file.

The high level functionalities of the data layer is shown below:

 High Level Functionalities of the Data Layer
High Level Functionalities of the Data Layer

Data Layer is decomposed into number of inter-related entities that provide distinct functionalities to achieve a particular purpose as shown in the following figure:

Configuration Class Diagram
Configuration Class Diagram

Module Description

Identification: RiskWizard.Cgt.Config.GlobalConfiguration


Identification: RiskWizard.Cgt.Config.Table


Identification: RiskWizard.Cgt.Config.Attribute

Identification: RiskWizard.Cgt.Config.Operation


Identification: RiskWizard.Cgt.Config.DataType

Identification: RiskWizard.Cgt.Config.ConfigWriter


Identification: RiskWizard.Cgt.Config.ConfigReader

Identification: RiskWizard.Cgt.Config.XmlDOM


Identification: RiskWizard.Cgt.Config.XmlDOMReader

Identification: RiskWizard.Cgt.Config.XmlDomWriter


Identification: RiskWizard.Cgt.Config.ConfigFile

Identification: RiskWizard.Cgt.Config.DatabaseHandler

Identification: Database

Modular Dependencies

The following diagram shows the interactions between the modules of the data layer for high level functions:

Load DB Schema:

Read Data from Database:

Toolkit Decomposition

Overview of Toolkit

The Toolkit is the application which the TA (toolkit administrator) will use to set up the configuration for the User Application. The Toolkit will be a windows application in the form of a wizard, where the TA will be asked to customize various features of the User Application.

These customizable features are as follows:

The Toolkit Form will contain the following components

  1. Toolkit Form
  2. File Handling
  3. Setup Database
  4. Table Property Form
  5. Attribute Property Form
  6. DataType Property Form
  7. Linked Attribute Property Form
  8. Calculated Attribute Property Form
  9. Tree Constraints Property Form

Toolkit Form

Toolkit Form is the main WinForm the TA will be using. It contains the other classes and creates each of them based on TA’s operation.

The TA will be able to use Toolkit Form to initiate a template, open/read a template, create configuration templates and save the template.

File Handling

File Handling will be the first option displayed for TA, which includes the following feature:

Setup Database

Setup Database component is called every time the user creates a new configuration without definition of the database type and connection string. In this component user is able to:

Table Property Definition

Table Property Definition is used to define the table for Global Configuration. For each table the TA will need to specify the:

Attribute Property Definition

Attributes Property Definition is used to define the attribute for each table created by Table Property Definition. For each attribute the TA will need to specify the:

DataType Property Form

Once an attribute is defined as normal attribute, TA will need to specify the data type based on the database selection made earlier. The following option will be enabled for TA:

Linked Attribute Property Form

Once an attribute is defined as linked attribute, TA will need to specify:

Tree Constraints Property Form

Increment 1: The TA will devise the structure of the tree in the User Application. The tree in the User Application is a tree of all records from all tables in the database so the tree constraints simply define which tables the child nodes are allowed to come from, for any given node.

Increment 2: The TA will be able to create multiple tree constraints for the configuration. Each tree constraints will allow the User Application to add different tree views into the database

Calculated Attribute Property Form

The TA will specify the details of all the CALCULATED attributes which were defined in Attributes Property Definition. A calculated attribute of a table will not be an actual attribute within the database - rather it is operation performed on other attributes, possibly from other tables. The TA will need to define all the attributes and tree constrains before add in the Calculated Attribute, and specify the Attribute’s operation.

There are 2 types of operations the TA can choose for:

Components decomposition diagram

Toolkit Modular Decomposition Diagram
Toolkit Modular Decomposition Diagram

Components Description

Identification: ToolkitForm

Identification: SetupDatabase

Identification: FileHandling

Identification: TablePropertyForm

Identification: AttributePropertyForm

Identification: DataTypePropertyForm

Identification: LinkedAttributePropertyForm

Identification: CalculatedAttribute

Identification: TreeConstraints

User Application

Overview

The User Application is used by Risk Wizards's clients. It is used to record, monitor and control various types of business related information (e.g. risks, workgroups and etc).

It essentially provides an organization with a centralized database that holds information from all the different divisions and the filtering ability to examine certain specific information.

User App Screen Shot
User App Screen Shot

Detailed Design


Data Layer Design

Configuration Library Module

Functionalities
Detailed Methods of ConfigurationSystem
Detailed Methods of ConfigurationSystem
Class Dependencies
Class Diagram of Configuration Library Classes
Class Diagram of Configuration Library Classes

ReadFromXmlDocument(XmlDocument document):

 Sequence Diagram for method ReadFromXmlDocument()
Sequence Diagram for method ReadFromXmlDocument()

WriteToXmlDocument(GlobalConfiguration config):

 Sequence Diagram of WriteToXmlDocument()
Sequence Diagram of WriteToXmlDocument()
Detailed Class Design

ConfigurationReader: Refer to online documentation for class details.

Detailed Class Diagram of ConfigurationReader Class
Detailed Class Diagram of ConfigurationReader Class

ConfiguartionWriter: Refer to online documentation for class details.

Detailed Class Diagram of ConfigurationWriter Class
Detailed Class Diagram of ConfigurationWriter Class

GlobalConfiguration: Refer to online documentation for class details.

Detailed Class Diagram of GlobalConfiguration Class
Detailed Class Diagram of GlobalConfiguration Class

Tree: Refer to online documentation for class details.

Detailed Class Diagram of Operation Class
Detailed Class Diagram of Operation Class

Table: Refer to online documentation for class details.

Detailed Class Diagram of Table Class
Detailed Class Diagram of Table Class

Attribute: Refer to online documentation for class details.

Detailed Class Diagram of Attribute Class
Detailed Class Diagram of Attribute Class

Operation: Refer to online documentation for class details.

Detailed Class Diagram of Operation Class
Detailed Class Diagram of Operation Class
Configuration File Format

The details of the configuration file are to be kept internal to the Data Layer. The Data Layer needs to provide access service to both the Toolkit and the User Application, for reading from and writing to configuration files.

Diagrams:

Root Element
Root Element
Tree Complex Type
Tree Complex Type
Table Complex Type
Table Complex Type
Attribute Complex Type
Attribute Complex Type
Operation Complex Type
Operation Complex Type

Schema File:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="CgtConfig">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Connection">
          <xs:complexType>
            <xs:attribute name="TargetDbSystemName" type="xs:string" use="required"/>
            <xs:attribute name="ConnectionString" type="xs:string" use="required"/>
          </xs:complexType>
        </xs:element>
        <xs:element name="Schema">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Table" type="TableType" minOccurs="0" maxOccurs="unbounded">
                <xs:key name="AttributeNameIsKey">
                  <xs:selector xpath="Attribute"/>
                  <xs:field xpath="@Id"/>
                </xs:key>
              </xs:element>
              <xs:element name="Tree" type="TreeType" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                  <xs:documentation>This defines multiple trees.</xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
          <xs:key name="TableNameIsKey">
            <xs:selector xpath="Table"/>
            <xs:field xpath="@Id"/>
          </xs:key>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="TableType">
    <xs:sequence>
      <xs:element name="Attribute" type="AttributeType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Id" type="xs:string" use="required"/>
    <xs:attribute name="Name" type="xs:string" use="required"/>
    <xs:attribute name="DisplayName" type="xs:string" use="required"/>
    <xs:attribute name="IsRoot" type="xs:boolean" use="required"/>
  </xs:complexType>
  <xs:complexType name="AttributeType">
    <xs:sequence>
      <xs:element name="Link" minOccurs="0">
        <xs:annotation>
          <xs:documentation>This implements the concept of linked attributes.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:attribute name="TableId" type="xs:string" use="required"/>
          <xs:attribute name="AttributeId" type="xs:string" use="required"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="Operation" type="OperationType" minOccurs="0">
        <xs:annotation>
          <xs:documentation>This implements the virtual concept of derived attributes.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="Id" type="xs:string" use="required"/>
    <xs:attribute name="Name" type="xs:string" use="required"/>
    <xs:attribute name="DisplayName" type="xs:string" use="required"/>
    <xs:attribute name="DataType" type="xs:string" use="required"/>
    <xs:attribute name="IsUnique" type="xs:boolean" use="required"/>
    <xs:attribute name="IsNullable" type="xs:boolean" use="required"/>
  </xs:complexType>
  <xs:complexType name="OperationType">
    <xs:sequence>
      <xs:element name="Method">
        <xs:complexType>
          <xs:attribute name="Id" type="xs:string" use="required"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="ParamTable">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="ParamAttribute" maxOccurs="unbounded">
              <xs:complexType>
                <xs:attribute name="Id" type="xs:string" use="required"/>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="Id" type="xs:string" use="required"/>
        </xs:complexType>
        <xs:key name="ParamAttributeNameIsKey">
          <xs:selector xpath="ParamAttribute"/>
          <xs:field xpath="@Id"/>
        </xs:key>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="TreeType">
    <xs:sequence>
      <xs:element name="Constraint" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name="ParentTableId" use="required"/>
          <xs:attribute name="ChildTableId" use="required"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="Id" type="xs:string" use="required"/>
    <xs:attribute name="Name" type="xs:string" use="required"/>
  </xs:complexType>
</xs:schema>

Database Library Module

Functionalities

The Database System is responsible for retrieving data from and saving data in the database. It needs to serve both the Toolkit and User Application. It needs to translate the methods calls from the Toolkit and User Application into appropriate SQL queries and perform the actions on the database.

Typically the following steps occur:

  1. Method calls are received from Toolkit or User Application.
  2. Translate them into appropriate SQL query based on the type of database system used (for example, MSSQL-Server or Oracle).
  3. Make a connection to the database.
  4. Retrieve data from the database and return information to the User Application or Toolkit or save data in the database and notify the User Application or Toolkit.

The detailed methods are shown in below:

Detailed Methods of DatabaseSystem
Detailed Methods of DatabaseSystem
Class Dependencies

The following diagram shows dependency between the different classes:

Class Diagram of DatabaseSystem
Class Diagram of DatabaseSystem

The following diagrams show how various classes interact together. The interactions are shown for all the detailed methods to be implemented.

GetChildNodes():

Sequence Diagram for GetChildNode() Method
Sequence Diagram for GetChildNode() Method

InsertChildNode():

Sequence Diagram for InsertChildNode() Method
Sequence Diagram for InsertChildNode() Method

GetSingleNode():

Sequence Diagram for GetSingleNode() Method
Sequence Diagram for GetSingleNode() Method

UpdateSingleNode():

Sequence Diagram for UpdateSingleNode() Method
Sequence Diagram for UpdateSingleNode() Method

DeleteSingleNode():

Sequence Diagram for DeleteSingleNode() Method
Sequence Diagram for DeleteSingleNode() Method

CreateTables():

Sequence Diagram for CreateTables() Method
Sequence Diagram for CreateTables() Method

GetDataTypes():

Sequence Diagram for GetDataTypes() Method
Sequence Diagram for GetDataTypes() Method
Detailed Class Design

SqlScriptWriter: Refer to online documentation for class details.

Class Diagram of SqlScriptWriter Class
Class Diagram of SqlScriptWriter Class

UserAppLogic: Refer to online documentation for class details.

Class Diagram of UserAppLogic Class
Class Diagram of UserAppLogic Class

DatabaseSystemRegistry: Refer to online documentation for class details.

Class Diagram of DatabaseRegistry Class
Class Diagram of DatabaseRegistry Class

DataType: Refer to online documentation for class details.

Class Diagram of DataType Class
Class Diagram of DataType Class

IDatabaseSystem: Refer to online documentation for class details.

Class Diagram of Interface IDatabaseSystem
Class Diagram of Interface IDatabaseSystem

MsqlDatabaseSystem:

Class Diagram of MsqlDatabaseSystem Class
Class Diagram of MsqlDatabaseSystem Class

CommandExecuter:

Class Diagram of CommandExecuter Class
Class Diagram of CommandExecuter Class

Detailed Documentation File

Detailed Documentation in Help file format

Toolkit Design

Toolkit System Class Diagram

Toolkit System Class Diagram
Toolkit System Class Diagram
ToolkitMain Class Diagram
ToolkitMain Class Diagram
ToolkitMain Class Diagram
ToolkitForm Class Diagram
ToolkitForm Class Diagram
ToolkitForm Class Diagram
ErrorCheck Class Diagram
ErrorCheck Class Diagram
ErrorCheck Class Diagram
FileProperty Class Diagram
FileProperty Class Diagram
FileProperty Class Diagram
SetupDatabase Class Diagram
SetupDatabase Class Diagram
SetupDatabase Class Diagram
TableProperty Class Diagram
TableProperty Class Diagram
TableProperty Class Diagram
AttributeProperty Class Diagram
AttributeProperty Class Diagram
AttributeProperty Class Diagram
DataTypeProperty Class Diagram
DataTypeProperty Class Diagram
DataTypeProperty Class Diagram
LinkedAttributeProperty Class Diagram
LinkedAttributeProperty Class Diagram
LinkedAttributeProperty Class Diagram
CalculatedAttributeProperty Class Diagram
CalculatedAttributeProperty Class Diagram
CalculatedAttributeProperty Class Diagram
TreeConstraintsProperty Class Diagram
TreeConstraintsProperty Class Diagram
TreeConstraintsProperty Class Diagram

Toolkit System GUI diagrams


ToolkitForm GUI Diagram
ToolkitForm GUI Diagram
ToolkitForm GUI Diagram
IconLibrary GUI Diagram
IconLibrary GUI Diagram
IconLibrary GUI Diagram
FileProperty GUI Diagram
FileProperty GUI Diagram
FileProperty GUI Diagram
SetupDatabase GUI Diagram
SetupDatabase GUI Diagram
SetupDatabase GUI Diagram
TableProperty GUI Diagram
TableProperty GUI Diagram
TableProperty GUI Diagram
AttributeProperty GUI Diagram
AttributeProperty GUI Diagram
AttributeProperty GUI Diagram
DataTypeProperty GUI Diagram
DataTypeProperty GUI Diagram
DataTypeProperty GUI Diagram
LinkedAttributeProperty GUI Diagram
LinkedAttributeProperty GUI Diagram
LinkedAttributeProperty GUI Diagram
CalculatedAttributeProperty GUI Diagram

Calculated Attribute: Column Operation

CalculatedAttributeProperty GUI Diagram
CalculatedAttributeProperty GUI Diagram

Calculated Attribute: Row Operation

CalculatedAttributeProperty GUI Diagram
CalculatedAttributeProperty GUI Diagram
TreeList GUI Diagram
TreeList GUI Diagram
TreeList GUI Diagram
TreeConstraintsProperty GUI Diagram
TreeConstraintsProperty GUI Diagram
TreeConstraintsProperty GUI Diagram

Toolkit System Event Flow Charts

Startup:

Startup flow chart
Startup flow chart

New Configuration Event:

New Configuration flow chart
New Configuration flow chart

Open File Event:

Open Configuration flow chart
Open Configuration flow chart

Save File Event:

Save Configuration flow chart
Save Configuration flow chart

Close Configuration Event:

Close Configuration flow chart
Close Configuration flow chart

Toolkit System Detailed Documentation

Detailed Documentation in Help file format

User Application Design

Login Webpage

Overview

All the account management issues involved in the End-system are handled by the login class.

Fields and Methods
Database background

login table

A login table will be predefined in the Toolkit Application and included in the End-system database.

This table contains four attributes, namely, "username", "password", "accountType", "status".


login table attribute "accountType"

The attribute "accountType" specifies whether this is an administrator account or a normal user account.

accountType=1 => administrator account ; accountType=0 => normal user account

An administrator account will be created by default at the beginning by the Toolkit Application to manage all the account related issues. Also, the last administrator account in the database can not be deleted.


login table attribute "status"

The attribute "status" specifies whether this account is active or has been deleted.

status=1 => active ; status=0 => disabled

The reason for having this "status" attribute is, the client does not want any data to be deleted in the End-system. Hence all delete method will actually disable the targeted data instead of permanently deleting.

The reason "int" is used as the attribute type for both "accountType" and "status" instead of "bool", is to provide the room for possible future development, as there may be more account access levels as well as more account status.


Reasons for both administrator accounts and user accounts are recorded in the same database table

All usernames have to be unique. If this two types of accounts were recorded in different database table, whenever account information are required, in the most cases, two SQL queries will be required to perform the task instead of one SQL. Plus the result of this two SQL queries may also need to be concatenated. (i.e. During login process, two SQL will be required to search for the given username if the accounts are recorded separately.). By removing this extra validation, the implementation can be simplified.

User Application Configuration

Overview

During the initial(not postback) load of the UserApp the configuration created from the CGT toolkit will be read in. The location and file name of the configuration file will be stored in the web.config, so that the configuration file can be changed by just changing the value through a simple text editor. The value will be stored in the appSettings section, under a the CGTConfiguration key. The value will be a relative path to base of the website.

Properties and Methods

UserApp Webpage

Overview

UserApp webpage contains two main parts which are the "Navigation Tree" and "Display Content".

In terms of the navigation tree, there is the basic tree and the filtered tree. The following classes form the code-behind:

For the display content, the following classes form the code-behind:

User Application Page Lifecycle

Life cycle of the user application is as follows:

To view information from a node

To add a node

To save a node

To edit a node

userapp.aspx.cs

When displaying the information from the database, different information will be displayed different. The information can be one of the following:

When displaying normal attributes in the add and edit form, the UserApp.aspx.cs runs the methods createAddForm and createEditForm, the methods will run a foreach loop which goes through each normal attribute and render it as textbox. Otherwise, when viewing the content, normal attributes is rendered directly to HTML.

When displaying linked attributes, when the UserApp.aspx.cs runs the methods createAddForm and createEditForm, and finds a linked attribute it will be display a linked drop down list populated with all relevant records to choose from. When populating the drop down box, the linked value is recursively taken by getting a dataset via the parent table of the linked attribute. Then, the attribute is checked whether it is null or not. If it is not null, then the linked attribute will be added as a control. If the linked attribute is also a calculated attribute, the linked attribute will be calculated recursively first before adding it as a control. The text entry in the drop down box will display the display attribute so that it is readable.

In terms of rendering calculated attributes, the toolkit has column operations (sum, product, average, max, count, and min) and row operations (add, subtract, multiply, divide and concatenate). The user application, when running through the methods createViewForm and finds a calculated attribute (if attribute.Operation is not null), the user app will call the calculator and perform the operation on the row or the column.

If a row operation is being done, Calculator.PerformRowOperation will calculate the right value based on the attr.Operation.ParamAttributeList before displaying the attribute.

If a column operation is being done, the dataset of all the records will be received before the Calculator.PerformColumnOperation and perform it on the right column in the set before displaying the attribute.

Fields and Methods
ControlCreator

The ControlCreator class is creates the controls for the user application.

ControlDecorator

The ControlDecorator class decorates the controls

InputValidator

The InputValidator class validates inputs entered into the User Application.

Navigation Tree

The main page of the User Application will contain a tree in the top left corner of the page. This will allow users to navigate through the records and select the desired record to be displayed. The tree will be of type RadTreeView consisting of RadTreeNodes. The following methods will be used to construct the tree.

This tree is able to handle multiple trees. In the UserApp.aspx.cs, there are three methods, createViewForm, createEditForm and createAddForm. When viewing the tree, it displays the parent records (via the display attribute) so that different trees can be shown under the same tree. When editing and adding, these records are drop-down boxes which is populated with possible parent records for the current record that is selected.

TreeBuilder

The TreeBuilder class is a static class that will build a given branch of the tree. The Class will perform two operations. Firstly it will build a RadTreeNode from the given datarow and secondly it will recursively work its way down the tree and get the datarows of the children of the current node.

Condition

The Condition class is a static class that allows the user application to be able to set conditions for the filter.

ConditionOperators

The ConditionOperators class is a static class that form the condition operators for the user application.

Filter

The Filter class is a internal class that serves a filter.

Filter

Overview

The filter will be used to apply conditions to the records that will be displayed in the tree. The user will be able to apply any number of conditions to any number of tables in the application. To explain precisely how the filter will operate on the tree, the following example is used:

Let's say the user chooses to apply a filter onto only table T with condition Cs:

  1. The filter is only applied to records of table T. The records from other tables are displayed as normal.
  2. In the tree we will display all root records of all tables which are not from table T, and all root records from tables T, as long as they match conditions Cs.
  3. However with the records that are from T that do NOT match conditions Cs, we may still want to display these records in the tree. Let's say we have a root record R which is from table T, and does not match conditions Cs - then we will want to display this record if there are any descendants of R that are from table T and DO match condition Cs. This ensures that all records from table T that match conditions Cs will be displayed in the tree, so the user does not miss out on any records.
  4. In this case we will display record R as "greyed". If a record is greyed it means that it did not match the filter conditions, but we still need to display it because there is a record in one of its descendants that does match the filter conditions.
  5. Because R is greyed, we only display it's children nodes that we need in order to display those records of R's descendants that do match the filter conditions Cs. In other words, only display the children of R that are ancestors of those records that need to be displayed (because they are from table T and match conditions Cs) or are those records themselves.

The final result is that we get a tree that shows ALL records from table T that match the conditions Cs, and only shows records from table T that don't match conditions Cs if we need them in order to show any descendants of those records that are from table T and do match conditions Cs. The algorithm for this process can be found here.

Classes

The following class diagram shows the classes that will be used for the functioning of the filter:


Image:SDD-TreeFilters.png


Filter

A filter is a set of conditions applied to a particular table within the database. In the CGT user application, the user will be able apply a filter to any number of tables. The reason why there is only a single condition within the filter class is because the set of conditions is stored as a linked list.

Condition

A condition takes an attribute from the table it belongs to and will apply a comparison operator to a constant value. The comparison operator will obviously depend on the datatype of the attribute. If the attribute is an int then the available comparison operators will be >, <, =>, <=, =. The datatype of Value must be the same as the datatype of the attribute.

As stated above, multiple conditions are stored for tables through a linked list. The reason for this is that it allows for a very simple algorithm to evaluate a complex set of conditions connected with either AND's or OR's. The connector member specifies whether to connect this condition to the rest of the list with an AND or an OR. So for example the following three connected conditions with the connectors:

is evaluated as

If the connector is FINAL then no further nested conditions are allowed.

Operators

This class is used to store the comparison operators that the conditions will use to evaluate records. The reason why a separate class is used to store these operators is for extendibility. To add another comparison operator that the user can use for filtering only this class needs to be modified.

The set of operators will be stored as enums, one enum for each datatype that will be used. As can be seen in the diagram the NumberOperators enum contains all the standard integral comparison operators. The evaluate() method will execute the comparison and check whether two values satisfy the condition.

Tree building algorithm

The following diagram illustrates the algorithm for building the tree, given that there may be filters. The Load() method is takes a datarow and will appropriately load all of the datarow's children, recursively.

Image:SDD-flowchart-TreeBuildingAlgorithm.png

GUI controls

The following diagram shows the user interface for the filter:

Image:SDD-gui-UserAppFilter.png

treeViewFilter

buttonApply

buttonAddCondition

buttonRemoveCondition

buttonClear

newConditionDialogue

buttonNewConditionDone

Telerik Controls

Overview

Telerik Treeview control is used for data navigation.

Telerik Menu control is used to provide functionalities such as add/modify/delete and etc.

Telerik Dock control is used to adjust the position of different controls in the User App.

Retrieved from "http://www.erichuang.info/projects/cgt/wiki/index.php?title=Software_Design_Description_2"

This page has been accessed 6,831 times.
This page was last modified 01:59, 27 October 2006.
Content is available under Attribution-NonCommercial-ShareAlike 2.5.


Find
Browse
Main Page
Current events
Recent changes
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Log in / create account
Special pages
New pages
File list
Statistics
Bug reports
More...