Académique Documents
Professionnel Documents
Culture Documents
9/20/07
By Team Members: Version: Faisal Azizullah, Bhavana Mathur, Shveta Mupparapu 1.0
KWIC
09/20/2007
Table of Contents
1.0
1.0 Overview
This document describes the architecture of Key Word In Context (KWIC) system. The KWIC system takes in an ordered set of lines, where each line is an ordered set of words, and each word is an ordered set of characters. Any line can be circularly shifted by repeatedly removing the first word and appending it at the end of the line. The KWIC index system will output a list of all circular shifts of all lines in ascending alphabetical order.
2.0 Purpose
The purpose of this document is to describe the architectural design specification for the KWIC system. The document discusses the different architecture styles and then a
Architecture Specification
KWIC
09/20/2007
preferred architecture style is chosen. It also discusses the major components of system architecture, namely: 1. Components 2. Connections 3. Constraints 4. Style 5. Pattern 6. Rationale
4.0 ADT
This solution includes encapsulating data representations and their associated operations in abstract data types. Additionally, it is a highly intuitive, logical and organized approach to any software problem. This following diagram provides an overview into the components and connectors of the architecture.
Architecture Specification
KWIC
09/20/2007
INPUT
OUTPUT
LINE STORAGE
CIRCULAR SHIFTER
ALPHABETIZER / SORTER
OUTPUT MEDIUM
INPUT MEDIUM
Components
The various components of the architecture are: Input module This module includes the operations of accepting the input lines which the user enters and tokenizes them into separate strings. For example, it reads the lines that the user inputs, and tokenizes each line into words, and further, each word into characters. Line storage module This module is responsible for storing the lines accepted into the system. It stores lines in the form of words and characters. Circular shift module This is the core module of the system which actually produces the requested lines by circularly shifting the input line. Sorter/Alphabetizer module This module sorts the generated lines in alphabetic order. Output module This module outputs the circularly shifted and sorted lines to the screen.
Connections
The connections which bind the different components together are: Saving lines input in the input module by the Line storage module. Accessing lines from Line storage module by the Circular shift and the Alphabetizer module. Output module accessing the lines from the Alphabetizer module after sorting. Heres a more detailed diagram of the ADT representation of the KWIC system.
Architecture Specification
KWIC
09/20/2007
Figure 2: Detailed Diagram As shown in the above diagram, each module like the Characters, Circular Shift, and the Alphabetizer modules, makes interfaces available to other modules for data access.We can see that Circular shift uses the Char and Word interfaces of Characters module, and the Alphabetizer uses the Char and Word interfaces of the Circular Shift module.
Constraints
The KWIC system has the following constraints: The Input module has to finish reading in all the input by the user, before the Circular Shift can process it. The Circular Shift needs to finish all the circular shifts of all the input lines, before the Alphabetizer can sort it. The Alphabetizer needs to completely sort all the circularly shifted lines, before the Output module can output it.
Pattern
The pattern of the KWIC architecture is outlined in Figure 1. It follows a very straightforward pattern of modules, with their own functionalities, interconnected through object-oriented interfaces for data access.
Style
The style of this architecture is clearly the Abstract Data Type (ADT) style.
Architecture Specification
KWIC
09/20/2007
Figure 3: Pipe and filter architecture This architecture is great if there are a lot of transformations to perform and where flexibility is required in using them, yet they should be robust. The application links together all inputs and outputs of the filters by pipes, and then spawns separate threads for each filter to run in.
Architecture Specification
KWIC
09/20/2007
Figure 5: KWIC architecture The overall processing in the pipe and filter architecture is decomposed into a sequence of steps. Reading the input Making the circular shifts Alphabetize Output
In the Input step the lines are read and are passed to circular shift. The circular shift step reads the input makes the circular shifts and passes the input to the alphabetizer. The alphabetizer reads the lines and puts them in an alphabetical order. In the output step the output is printed.
4.1.0 Components
The components of this architecture style are filters. The filter transforms or filters the data it receives via the pipes with which it is connected. A filter can have any number of input pipes and any number of output pipes. Input: Input gets data from the input medium Circular Shift: Circular Shift gets the set of lines from Line Storage and generates the set of circular shifted lines. Sort Alphabetizer gets the set of lines from the Circular Shift and sorts the set of lines in the defined order. Output: Output lists the result through output medium
4.1.1 Connections
The connections are the pipes. The pipe is the connector that passes data from one filter to the next. It is a directional stream of data that is usually implemented by a data buffer to store all data, until the next filter has time to process it. Module Pipe (from Input to Circular Shift): transfer the input string from Input to Circular Shift. Module Pipe (from Circular Shift to Sort): transfer the circulated string from Circular Shift to Sort
Architecture Specification
KWIC
09/20/2007
Module Pipe (from Sort to Output): transfer the Sorted string from Output
4.1.2 Constraints
As in the case of all architectures, our implementation of the KWIC system has the following constraints: The Input module has to finish reading in all the input by the user, before the Circular Shift can process it. The Circular Shift needs to finish all the circular shifts of all the input lines, before the Alphabetizer can sort it. The Alphabetizer needs to completely sort all the circularly shifted lines, before the Output module can output it. Data is communicated between neighboring filter through pipes connecting them
4.1.3 Pattern
Pe ip Ss m y te I/O
4.1.4 Style
The style of the architecture is clearly pipe & filter.
4.1.5 Rationale
We have used the pipe and filter architecture for the KWIC system due to the following reasons: Advantages: The nonrational flow of processing is maintained.
Architecture Specification
KWIC
09/20/2007
Each filter is independent and new filters can be added for new functions. It is easy to modify since the change of function on one filter does not affect the other filter.
Disadvantages: This architecture style is inconvenient for interactive systems. Space inefficiency.
5.0 Traceability
Well designed software architecture should be traceable to the Requirements specification. This architecture traces back to the functional and non-functional requirements as follows:
Architecture Specification
KWIC
09/20/2007
6.0 Conclusion
This architectural specification serves as a highly effective guideline for the subsequent software phases such as detailed design and implementation. It includes both high-level and low-level architectural design decisions.
Architecture Specification
10