{ SEQ CHAPTER \h \r 1 TC \l1 "

CMSC 345 Fall 2001

System Design Document

The “Perfect Form” System

Version 1.2

Client

Mr. Dennis Frey, CMSC 345

Customer

Ms. Susan Mitchell

Team 2

November 13, 2001

System Design Document

Table of Contents

  1. Introduction...... 3
  2. Purpose...... 3
  3. Scope...... 3
  4. References...... 3
  5. Overview...... 3
  6. Constraints...... 4
  1. System Overview...... 4
  1. System Architecture...... 6
  2. Architectural Description...... 6
  3. Component Decomposition Descriptions...... 7
  4. Architectural Alternatives...... 11
  5. Design Rationale...... 11
  1. Data Design...... 12
  2. Database Description...... 12
  3. Global Data Structures...... 14
  4. Object-Use Description Diagrams...... 14
  1. Component Design...... 15
  2. Controller Object...... 15
  3. AccessDatabaseConnection Object...... 34
  4. AddressBook Object...... 38
  5. Letter Object...... 45
  6. ReturnAddresses Object...... 54
  7. Senders Object...... 59
  8. States Object...... 64
  9. System Object...... 67
  10. Titles Object...... 72
  1. Human Interface Design...... 75
  2. Overview of the User Interface Design...... 75
  3. Screen Images...... 75
  4. Screen Objects and Actions...... 85
  5. Report Formats...... 85
  1. Requirements Matrix...... 85
  1. Resource Estimates...... 87
  1. Definitions, Acronyms, and Abbreviations...... 87

Appendix A: List of Diagrams...... 88

1.INTRODUCTION

1.1 Purpose

This design document is intended to provide a language-nonspecific design specification for the “Perfect Form” system. It contains detailed specifications for the overall system, each subsystem component, the user interface, and the relationships between all components. It is intended for use during implementation, and for explanation to the customer of the overall system architecture.

1.2Scope

This softwarewill complete and print pre-existing form letters. The initial creation of the form letters will take place outside the software. The software will allow the user to import these pre-existing form letters. The information needed to complete the form letter will come from the address book included in the software, or from the user. The user will be able to select a specific group of addressees for which letters and (optionally) corresponding envelopes will be printed. The software will provide methods to perform queries on the information contained in the address book. The user will be able to add, modify, and delete addressees from the address book through this software.

1.3References

This document was assembled using the following references:

System Requirements Specification for the “Perfect Form” system, version 1.6

The System Design Document Template, CMSC 345, Fall 2001

Software Engineering (5th Ed.) by Ian Sommerville, Addison-Wesley 1995

1.4Overview

The remainder of this document contains the following sections and content:

Section 2. System Overview – a general overview of the system and the system’s background.

Section 3. System Architecture – describes the overall architecture for this system.

Section 4. Data Design – describes the data structures used in the system architecture.

Section 5. Component Design – describes each architectural component in detail.

Section 6. Human Interface Design – describes and illustrates the system’s graphical interface.

Section 7. Requirements Matrix – shows how each system requirement is met by the design.

Section 8. Resource Estimates – summarizes the computer resources required by the system.

Section 9. Definitions, Acronyms, and Abbreviations – explains those used in this document.

1.5Constraints

The system is required to run under only Microsoft Windows 98. It will utilize Microsoft Internet Explorer 5.0 or later, and Microsoft Office 2000, therefore both must be installed for the system to run. The system must print to the Hewlett-Packard DeskJet 895Cxi. The database used in the system will be limited to a size of two gigabytes of uncompressed storage. The system will use the following Microsoft-standard components: the Microsoft Windows 98 run-time libraries, the Microsoft Office 2000 Document object, the Microsoft Office 2000 Access Database object, the Microsoft Office 2000 ADO library, and the Microsoft Visual Basic run-time libraries.

2.SYSTEM OVERVIEW

Ms. Susan Mitchell and employees of her dance studio want to produce mass-mailings from pre-existing form letters. They want to maintain an address book of addressees and send letters to a subset of the addressees in a personalized format. This system is designed to meet these needs and provide some additional functionality such as previewing the completed letters, printing envelopes for the letters, supporting queries to the address book, and maintaining information about the letter senders. The overall system design separates each function into a different component to facilitate the testing and maintenance of the system. The system maintains the address book and any system data in a Microsoft Access database. All user interaction with the system is through the provided graphical user interface to the system, which will be built as a native Windows 98 application. The Context Diagram (also included in the System Requirement Specification as referenced in Section 1.3, page 3) summarizes the system roles and scope (see “Context Diagram”, page 5).

3.SYSTEM ARCHITECTURE

3.1Architectural Description

This system is designed using a combination of the repository architecture model and the event-driven architecture model. The system uses a central database to store all the program data and records. Each of the Controller’s sub-objects interface with a unique portion of the database in order to preserve encapsulation; the connection to the database is controlled in the Controller by the AccessDatabaseConnection object (see “AccessDatabaseConnection Object”, page 34). The Controller is responsible for performing all of the system’s functions and maintaining the database. The flow of the system is controlled by the user, accessed through the graphical user interface. User commands are translated by the Event-Controller into a process to be executed in the Controller. The System Architecture Diagram below shows these major subsystems and the interconnections among them.


3.2Component Decomposition Description

The Controller Object has eight member objects: AccessDatabaseConnection, AddressBook, Letter, ReturnAddresses, Senders, States, System, and Titles. The Microsoft Word Document Object, ADO.Connection, and ADO.Recordset Object are predefined Microsoft-standard objects. Actual system functionality is provided by these objects and managed by the Controller. The Object Aggregation Diagram and Object Diagrams below provide details on each object and their interrelations.



3.3Architectural Alternatives

As an alternate to the repository architecture model and the event-driven architecture model combination, a purely object-oriented event-driven architecture was considered. The event-driven architecture was always the best choice, as the tasks the user can perform in the system do not have a definite order. Also, the system is specified to be a Windows 98 application, which is specified by Microsoft to use an event-driven architecture. The purely object-oriented aspect of the alternative design would not have used a central repository, but have stored the data for each object only within that specific object.

3.4Design Rationale

By using a repository architecture model and event-driven architecture model combination, this system can utilize the benefits of a Microsoft Access database as a central data repository, while still keeping object encapsulation by having objects access a unique part of the database for their data members. Access databases allow secured data storage and access, easy reinforcement of database referential-integrity to facilitate maintenance, the return of pre-formatted query strings, and the use of complex data queries without having to build the software foundation for such querying. By using an Access database for the repository, the system can use the benefits of a pre-built component for data storage and querying to reduce system development time.

The set of system functions was broken down into definite components for the architecture, one for each set of related system functions. Rather than having the objects talk between each other and highly-couple the design, the controller manages communication with the objects and uses them specifically in the way that this system needs to use them. Therefore, the controller is the “customized” part of the system, while the objects are more generic and could be re-used in other system designs. All lines of communication between components, except between the user interface and the event-controller, run through the controller, making the controller the central point of coupling between the objects. All lines of communication to external components, such as the database connection, are managed by the controller via one object.

4.DATA DESIGN

4.1Database Description

This system uses a Microsoft Access Database to store all program data. The database will be encrypted with a single username and password for full access. The database username is hard coded into the system to limit database access to only this system. Able to be changed by the user in the system, the database password will double as the system login password. Initially, on system delivery, the password will be set to a blank string.

In the database, the following tables will exist, each with the noted content:

1.) tblAddressBook – contains all of the addressee information, for the AddressBook object.

2.) tblCustomTags – contains all the custom tags and last replacement text for a previously-opened letter, for the Letter object.

3.) tblLetters – contains the information for all previously-opened letters, for the Letter object.

4.) tblReturnAddress – contains all information on the last system return address, for the ReturnAddresses object.

5.) tblSenders – contains all information on previous senders, for the Senders object.

6.) tblStates – contains a listing of all U.S. states used in the system, for the States object.

7.) tblSystem – contains all system variables and their last state, for the System object.

8.) tblTitle – contains all personal titles used in the system, for the Titles object.

The Relational Database Diagram following (page 13) shows the database tables, their fields, and the relationships between the tables. All relationships reinforce referential-integrity on modification and deletion.

1

1

4.2Global Data Structures

The only data structures passed between objects, are the Microsoft Word Document object, the ADO.Recordset object, and a reference to the ADO.Connection object. All of the objects are defined and diagrammed in the Microsoft Word help files, and the Microsoft Developers Network Library. For each object method returning an ADO.Recordset object, the ADO.RecordSet contains the same fields as the database table associated with the object.

4.3Object-Use Description Diagrams

The following Object-Use Diagram illustrates how objects use each other. For details on the methods and members of each object, see the Object Diagrams (section 3.2 Component Decomposition Description, page 14). For details on object aggregation, see the Object Aggregation Diagram (section 3.2 Component Decomposition Description, page 14).


5.COMPONENT DESIGN

This section contains the top-down descriptions of all the design components. Object Diagrams for each component and an Object-Use Diagram are available in section 3.2 (page 14).

5.1Controller Object

Identifier:Controller

Purpose:To provide overall system functionality

Function:Works with the event-controller to provide overall system functionality

Subordinates:AccessDatabaseConnection, AddressBook, Letter, ReturnAddresses, Senders, States, System, Titles, ADO.Recordset, ADO.Connection

Dependencies:Dependent on Microsoft Office 2000 being installed

Interfaces:

addressbookAddRecord(string firstname, string lastname, integer title, string address1, string address2, string address3, string city, integer state, string zipcode, string phone, Boolean student, Boolean tapstudent, Boolean tapcompany, Boolean jazzstudent, Boolean jazzcompany, Boolean balletstudent, Boolean balletcompany, integer id by reference) as boolean

Desc:adds a record to the address book, stores new id in id

addressbookClear() as Boolean

Desc:removes all entries from the address book

addressbookDeleteRecord(integer id) as Boolean

Desc:deletes the specified record from the address book

addressbookGetList() as recordset

Desc:gets the entire address book to display in the address book listing

addressbookGetListSubset(string firstname, string lastname, integer title, string address1, string address2, string address3,string city, integer state, string zipcode, string phone, Boolean student, Boolean tapstudent, Boolean tapcompany, Boolean jazzstudent, Boolean jazzcompany, Boolean balletstudent, Boolean balletcompany) as recordset

Desc:gets a subset of the address book to display in the address book listing, searches where a field is non-null

addressbookModifyRecord(integer id, string firstname, string lastname, integer title, string address1, string address2, string address3, string city, integer state, string zipcode, string phone, Boolean student, Boolean tapstudent, Boolean tapcompany, Boolean jazzstudent, Boolean jazzcompany, Boolean balletstudent, Boolean balletcompany) as Boolean

Desc:modifies the specified address book record

letterAdd(string path, string filename, integer id by reference) as boolean

Desc:adds a new letter to the system, stores id in id

letterClearList() as Boolean

Desc:removes all entries from the list of letters in the system

letterClose() as Boolean

Desc:closes the current letter

letterCreateTagReplacementTable(recordset tagsAndReplacements, recordset addressbookSubset) as boolean

Desc:creates a tag replacement table for the current letter; combines the tagsAndReplacements and the addressbookSubset and sets the letter to use this table

letterDelete(integer id) as Boolean

Desc:deletes the specified letter from the system

letterGetlist() as Recordset

Desc:lists all the letters in the system

letterGetTagList() as Recordset

Desc:gets a list of all the tags for the current letter and any saved replacements

letterOpen(integer id) as Boolean

Desc:opens the specified letter

letterPrint(Boolean printEnvelopes) as Boolean

Desc:prints the current letter

letterPrintPreview() as MSDocumentObject

Desc:print previews the current letter

returnaddressAdd(string address1, string address2, string address3, string city, integer state, string zipcode, integer id by reference) as boolean

Desc:adds a new return address, stores the new id in id

returnaddressClearList() as Boolean

Desc:removes all return addresses from the system

returnaddressGet(integer id) as String

Desc:gets the specified return address

returnaddressGetList() as recordset

Desc:gets a list of return addresses

returnaddressModify(integer id, string address1, string address2, string address3, string city, integer state, string zipcode) as Boolean

Desc:modifies the specified return address

senderAdd(string line1, string line2, integer id by reference) as boolean

Desc:adds a new sender, stores new id in id

senderGet(integer id) as String

Desc:gets the specified sender

senderGetList() as Recordset

Desc:gets a list of senders

senderModify(integer id, string line1, string line2) as Boolean

Desc:modifies the specified sender

senderClearList() as Boolean

Desc:removes all sender records from the system

stateGetList() as recordset

Desc:gets a list of states

systemChangePassword(string old, string new1, string new2) as Boolean

Desc:changes the system password, i.e. the datasource password

systemGetPreviousFileList() as Recordset

Desc:gets a list of previously opened files

systemGetPrintEnvelopeReturnAddress() as Boolean

Desc:gets whether to print a return address on the envelope

systemGetReturnAddress() as integer

Desc:gets the id of the currently set return address

systemGetSender() as integer

Desc:gets the id of the currently set sender

systemLogin (String password) as Boolean

Desc:logs the user into the system, estabilished datasource links for all objects

systemLogout() as Boolean

Desc:logs the user out of the system, saves and destroys all objects

systemSetPrintEnvelopeReturnAddress(Boolean value) as Boolean

Desc:sets whether to print a return address on the envelope

systemSetReturnAddress(integer id) as Boolean

Desc:sets the current return address

systemSetSender(integer id) as Boolean

Desc:sets the current sender

titleGetList() as recordset

Desc:gets a list of titles

terminate()

Desc:sends a message to the calling program to shut down

Error:errTerminate

Private Methods:

_systemObjectSetup (DatabaseObjectReference datasource) as Boolean

Desc:establishes databsource links for all objects

Data:

_datasource as AccessDatabaseConnection

Desc:reference to the database object for the system

Default:default object

_addressbook as AddressBook

Desc:address book

Default:default object

_states as States

Desc:states

Default:default object

_titles as Titles

Desc:titles

Default:default object

_returnAddress as ReturnAddresses

Desc:return addresses

Default:default object

_senders as Senders

Desc:senders

Default:default object

_systemVariables as System

Desc:system variables, including previous files and whether to print an envelope return address

Default:default object

_letter as Letter

Desc:form letter

Default:default object

_systemReturnAddress as integer

Desc:id of current return address

Default:id of first return address

_systemSender as integer

Desc:id of current sender

Default:-1 or last sender for the letter

Programming Description Language:

Function addressbookAddRecord(string firstname, string lastname, integer title, string address1, string address2, string address3, string city, integer state, string zipcode, string phone, Boolean student, Boolean tapstudent, Boolean tapcompany, Boolean jazzstudent, Boolean jazzcompany, Boolean balletstudent, Boolean balletcompany, integer id by reference) as boolean

‘Desc:adds a record to the address book, stores id in id

‘Errors:errBlankFirstName, errBlankLastName, errBlankTitle, errBlankAddress1, errBlankCity, errBlankState, errBlankZipCode, errBlankStudent

validate all input arguments and display msgbox telling which are incorrect

return false if a msgbox is displayed

On errNotConnected

Debug.Print(“Addressbook object not connected. Connect before

calling AddressBook.addRecord.”)

On adErrInvalidConnection

Msgbox(“A fatal error has occurred. The program will now

close.”)

Terminate()

On Error

Msgbox(“The record could not be added due to an error with the

database connection. Recommend restarting the program.”)

_addressbook.addRecord(firstname, lastname, title, address1, address2,

address3, city, state, zipcode, phone, student, tapstudent,

tapcompany, jazzstudent, jazzcompany, balletstudent,

balletcompany)

return true

End Function

Function addressbookClear() as Boolean

‘Desc:removes all entries from the address book

On errNotConnected