Software Design Description - DOC

Document Sample
Software Design Description - DOC Powered By Docstoc
					             Software Design Description

Project 1: KWIC Software Architecture Analysis




 Document Version: 1.3
 Last printed 9/2/2009 6:00:00 PM
 D:\Docstoc\Working\pdf\e3def331-d4f1-49af-a137-15d1ee44892f.doc
 Department of Computer Science – University of Texas at Dallas
Overview
The Software Design Description (SDD) details the chosen software architecture and the justification for
selecting that architecture. In this project the team was tasked with architecting and implementing a KWIK
Software System. Available design alternatives were limited to those covered in class; Pipe and Filter,
Shared Data, Abstract Data Type/Object Oriented and Implicit Invocation.

Target Audience
     Dr. Renee Steiner
     Shan Shan

Project Team Members
     John Lundborg
     Bruce Phillips

Version Control History
    Version               Primary Author(s)          Description of Version      Date Completed
    1.0                   John Lundborg              Initial document            08/29/2007
                                                     structure
    1.1                   John Lundborg              Added content to            09/15/2007
                                                     Overview & sections 1,
                                                     2, 4, 5
    1.2                   Bruce Phillips             Added content to            09/15/2007
                                                     sections 1, 2, 3, 4, 5
    1.3                   John Lundborg              Additional minor edits to   09/16/2007
                          Bruce Phillips             finalize document




                                                Page 2 of 9
1      INTRODUCTION .................................................................................................................................................4
    1.1 Design Overview .............................................................................................................................................4
    1.2 Requirements Traceability ..............................................................................................................................4
2      SYSTEM ARCHITECTURAL DESIGN ..............................................................................................................5
    2.1 Chosen System Architecture ...........................................................................................................................5
    2.2 Discussion of Alternative Designs ..................................................................................................................6
    2.3 System Interface Description ..........................................................................................................................6
3      DETAILED DESCRIPTION OF COMPONENTS ...............................................................................................6
    3.1 KwicApplet class.............................................................................................................................................6
    3.2 Controller class ................................................................................................................................................6
    3.3 LineStorage class.............................................................................................................................................6
    3.4 CircularShifter class ........................................................................................................................................6
    3.5 Alphabetizer class ...........................................................................................................................................6
4      USER INTERFACE DESIGN ..............................................................................................................................7
    4.1 Description of User Interface ..........................................................................................................................7
       4 .1 .1 Screen Images ........................................................................................................................................7
       4 .1 .2 Objects and Actions ...............................................................................................................................7
5      ADDITIONAL MATERIAL .................................................................................................................................9
    5.1 Definitions, Acronyms and Abbreviations ......................................................................................................9
    5.2 Appendices ......................................................................................................................................................9




                                                                             Page 3 of 9
1 INTRODUCTION
1.1   Design Overview
      The Key Word In Context (KWIC) system is an applet that runs in a standard internet browser. It
      accepts text input in the form of sentences. The words within the sentences are then shifted to
      form a new line of words. These new lines are then alphabetized and presented to the user.

      The KWIC system easily lends itself to the Abstract Data Type/Object Oriented (ADT/OO)
      architecture. The Model/View/Controller pattern was also used to separate data tasks from user
      interface (UI) tasks. The components are the controller, line storage, circular shifter, alphabetizer,
      and the KWIC UI. A diagram of the system can be seen in section 2.1.

      The KWIC system is made up of five classes, representing the five components listed above. The
      KwicApplet class serves as the UI and the Controller class serves as the controller as its name
      implies. The LineStorage class is the model or data. The UI receives the text to be processed and
      passes it to the Controller which stores it in a LineStorage object. The Controller then passes the
      text to the CircularShifter object, which creates all of the possible lines for each submitted line,
      returning the modified LineStorage object to the Controller. The Controller then calls the
      Alphabetizer object, passing the LineStorage object. The Alphabetizer, as its name implies,
      alphabetizes the lines within the LineStorage object, returning the modified object. The Controller
      then passes the modified LineStorage object to the UI for display to the user.

1.2   Requirements Traceability


                                                                              KwicApplet (UI)




                                                                                                                           CircularShifter

                                                                                                                                             Alphabetizer
                                                                                                             LineStorage
                                                                                                Controller
        # Functional Requirement



          KWIC shall accept an ordered set of lines, where each line is
        1 an ordered set of words, and each word is an ordered set of           X
          characters
          Input will be characters only, including uppercase and lower
        2                                                                       X
          case
        3 Input will be in the form of text input by the user                   X
          KWIC system shall also provide ability to input text using
        4                                                                       X
          copy/paste

        5 Each line should be circularly shifted by repeatedly removing                                                      X
          the first word and appending it at the end of the line

        6 KWIC shall output a list of all circular shifts of all lines in                                                                     X
          ascending alphabetical order, where a<A<b<B<...<y<Y<z<Z
        7                                                                       X
            Alphabetical list of circular lines should be displayed online




                                                Page 4 of 9
                                                                             KwicApplet (UI)




                                                                                                                          CircularShifter

                                                                                                                                            Alphabetizer
                                                                                                            LineStorage
                                                                                               Controller
       # Non-Functional Requirement



       1    KWIC sytem   shall be easily understandable                        X
       2    KWIC sytem   shall be portable                                     X
       3    KWIC sytem   shall be enhanceable                                                   X            X              X                X
       4    KWIC sytem   shall be reusable with good performance                                X            X              X                X
       5    KWIC sytem   must be user-friendly                                 X
       6    KWIC sytem   must be responsive                                    X                X            X              X                X
       7    KWIC sytem   must be adaptive                                                       X            X              X                X

2 SYSTEM ARCHITECTURAL DESIGN
2.1   Chosen System Architecture
      The ADT/OO architecture was chosen for its modifiability, enhanceability, and reusability
      strengths while not taking too big a hit on performance. Processing algorithms and data
      representation for a particular module can be changed with minimal impact as long as the
      interfaces don’t need to change. Enhancements can also be accomplished with minimal impact
      for similar reasons. Each module doesn’t need to know how another module performs its
      assigned task. Team familiarity with object oriented programming should also reduce the
      implementation effort.

                                   KwicApplet (UI)


                           -jbtProcessTextActionPerformed()




                                      Controller


                                 +createKwicIndex()




       LineStorage
                                    CircularShifter                Alphabetizer
      -lineList
      +addLine()
                              +circularShiftLines()            +alphabetizeLines()
      +toArrayList()
                              -convertArrayListToString()
      +toString()




                                                 Page 5 of 9
2.2   Discussion of Alternative Designs
      The Pipe and Filter architecture was also considered for its advantages in modifiability,
      enhanceability, and reusability. However, this architecture was determined to be much more
      difficult to implement in Java. This approach was abandoned fairly early due to the likely increase
      in implementation effort.

2.3   System Interface Description
      The KWIC system is a Java based applet. It consists of a jar file and an html file. The html is
      invoked by use of an internet browser. The Java Swing library is used to implement the graphical
      user interface.

3 DETAILED DESCRIPTION OF COMPONENTS
3.1   KwicApplet class
      The KwicApplet class serves as the user interface, it is responsible for accepting and displaying
      what the user inputs, providing the user with a means to start processing, and displaying the final
      results of that processing.

3.2   Controller class
      The Controller class, as its name implies, is responsible for controlling the process of building a
      KWIC index from the text input by the user. It creates a LineStorage object for storage of the input
      then passes that object to the CircularShifter and Alphabetizer for processing. The content of the
      modified LineStorage object is then passed back to the UI for display to the user.


3.3   LineStorage class
      The LineStorage class is an abstract data type designed to act as the model portion of the MVC
      pattern. It is a container responsible for maintaining the strings input by the user. It also maintains
      the output of the processing.


3.4   CircularShifter class
      The CircularShifter class is responsible for creating all of the variations of a shifted line and
      storing them in a LineStorage object. It is called by the Controller and passed the LineStorage
      object containing the user input. It operates on each line of text that was input, shifting each word
      from the beginning to the end of the line, creating a new line for each shift which is then added to
      the LineStorage object. This process is repeated until all of the words in each line of input has
      been shifted. When completed, it returns the LineStorage object to the Controller


3.5   Alphabetizer class
      The Alphabetizer class is responsible for alphabetizing a LineStorage object. It is called by the
      controller and passed the LineStorage object that was output by the CircularShifter object. It
      should be noted that the Alphabetizer is highly decoupled, and as such doesn’t really care about
      what it is passed, as long as it is a LineStorage object. It is a rather independent class.




                                               Page 6 of 9
4 USER INTERFACE DESIGN
4.1   Description of User Interface
      The KWIC Software System will be implemented as a Java Applet accessible through one of the
      team member’s UTD home page. The user interface consists of two text fields for input/output
      text and a button to kick of the KWIC index build process.

4.1.1 Screen Images




4.1.2 Objects and Actions
      The Input Text area allows the user to enter the text they want to create KWIC index for. The user
      can either enter the text by using copy/paste or by entering text directly in the field.




                                             Page 7 of 9
Selecting the Process Text button begins the process of creating the KWIC index which is then
displayed in the Output Text area.




                                      Page 8 of 9
      If no text is input before the Process Text button is pushed, an error message instructs the user to
      ‘Please enter text before selecting process.’




5 ADDITIONAL MATERIAL
5.1   Definitions, Acronyms and Abbreviations
      KWIC            Key Word In Context
      ADT/OO          Abstract Data Type/Object Oriented
      MVC             Model/View/Controller

5.2   Appendices
      Appendix A – User Manual (attached)




                                              Page 9 of 9