Vous êtes sur la page 1sur 10

KWIC

9/20/07

KWIC System Architectural Design Specification

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

3.0 Architectural Alternatives


Several different architectural solutions have been proposed for the KWIC problem. They are as follows: 1. Shared Data Data is communicated between components through shared storage. There is one common data store that each component of the system can access. 2. Abstract Data Types (ADT) Data is not directly shared by the process components like the Shared Data solution. Instead, each module provides an interface, through which it exposes its data members. Other components access data only by invoking that interface. This method is called Information hiding. 3. Implicit Invocation Component integration is based on shared data. However, the interface to the data is more abstract like in the ADT system. This is a trigger based system, in which computations are invoked implicitly as data is modified. 4. Pipe & Filter Each component can be modeled as filters, and connectors as pipes. Each filter processes the input data and produces output data. In addition, each filter can run whenever it has data on which to compute. Data sharing between filters is strictly limited to that transmitted on pipes.

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

MASTER CONTROL KWIC JAVA APPLET

INPUT

OUTPUT

LINE STORAGE

CIRCULAR SHIFTER

ALPHABETIZER / SORTER
OUTPUT MEDIUM

INPUT MEDIUM

Figure 1: High-level System Pattern

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.

4.1 Preferred Architecture


The style that we have implemented for the KWIC system is the pipe and filter architecture, which consists of any number of components (filters) that transform or filter data, before passing it on via connectors (pipes) to other components. The filters all work at the same time. The architecture is often used as a simple sequence, but it may also be used for very complex structures. It is a very simple but powerful architecture 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.

Figure 4: KWIC pipe and filter architecture

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

Figure6: Pipe and Filter Pattern

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:

5.0.0 Functional Requirements Traceability


The Input module accordingly accepts lines input by the user and stores it in the appropriate formats in the Line Storage module The Circular Shift module shifts each one of the lines in Line Storage according to the specified Circular Shift algorithm The Alphabetizer module simply alphabetizes the circularly shifted lines output by Circular Shift using an appropriate Sort algorithm The Output module simply displays the lines output by the Alphabetizer to the screen There is also a facility to reset the screen. The user can also exit.

5.0.1 Non Functional Requirements Traceability


We have adopted the J2EE technology to implement our version of KWIC. This facilitates the ease with which a user-friendly GUI (Graphic User Interface) can be built. It also provides an extensive API that simplifies implementation, giving more room for focus on a robust architectural design The Object Oriented style facilitates extensibility, scalability, reliability and performance The User manual that accompanies the highly intuitive user-interface makes this product attractive and very easy to use.

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

Vous aimerez peut-être aussi