Title: ObjectOriented Technology Dr' Koichiro Isshiki Computer Information Department Cal Poly, Pomona kris
1Object-Oriented TechnologyDr. Koichiro
IsshikiComputer Information DepartmentCal
Poly, Pomonakrisshiki_at_csupomona.edu
2Outline
- Introduction of OO Concepts
- Introduction of UML
- Using Nouns
- Example 1 Electronic Filing Program
- Exercise Computer-Based Gas Station
- RDD Approach
- Example 2 Electronic Checkbook
- Example 3 Elevator Simulation System
- Exercise Coffee Machine Controller
3Introduction of OO Concepts
4Methodology
- A process for the organized production of
software using a collection of predefined
techniques and notational conventions. - Early Years
-
-
Problem Domain
Solution Domain (Some Ad-hoc Model)
5Structured Methodology
Problem Domain
Solution Domain data structure data
structure
Function 1
Function 2
Function 3
6OO Methodology
Problem Domain
Solution Domain Message Message
Obj 1
Obj 2
Obj 3
7Procedural vs. OO
- Procedural Approach - a program is a collection
of procedures and functions - read_from_tape ()
- read_from_file ()
- write_to_tape ()
- write_to_file ()
- Object-Oriented Approach - a program is a
collection of cooperating objects - For object tape, define operations read write
- For object file, define operations read write
8Encapsulation - combine data and code
- e.g. visit to procedural doctor
- - go to library and get medical books
- - go to doctors office
- - Doc, here are the books and here are my
symptoms - - tell me my diagnosis
- e.g. visit to OO doctor
- - go to doctors office
- - Doc, here are my symptoms
- - tell me my diagnosis
9Encapsulation (2)
- e.g. procedural bread making
- - get baking pan, mixing bowl, mixer
- - get flour, yeast, oil
- - get cookbook
- - follow directions pour, mix, knead, raise,
knead, raise, bake, time, remove - e.g. OO bread making
- - get flour, yeast, oil
- - pour into automatic bread maker
- - turn on
10Traditional System Development
- Problems
- Software Projects
- Maintenance Cost Escalate
- Project Deadlines Slide
- Cost Estimate Difficult
- Processing
- Excessive Transformations
- Decreased Productivity
11OO System Development
- Iterative rather than sequential
- User-centered analysis process
- Concepts of objects appear in analysis and is
carried through design and implementation - Early easy prototypes
12Object-Oriented Analysis
- A problem domain
- A stage in the development cycle in which a
real-world problem is examined to understand its
requirements without planning the implementation - The process of studying user needs to arrive at a
definition of system or software requirements - OOA contains the following activities
- finding the objects
- organizing the objects
- describing how the objects interact
- defining the operations of the objects
13Object-Oriented Design
- A solution model
- The creation of an abstraction of a software
system that is consistent with the requirements
specifications and provides a reasonable
description for implementation. - A series of decisions on what is most
cost-effective implementation - OOD contains the following activities
- building system architecture
- providing full definition of classes user
interface - designing algorithms to implement class operations
14OOD Guidelines
- Coupling - the strength of interdependencies
between discrete components in a system. - Its something to be minimized e.g. use
encapsulation. - For an OO system, we are concerned with the
coupling between classes and objects that are not
part of a gen-spec or whole-part hierarchy e.g.,
we look for ways to minimize the number of
messages between objects, as well as the
complexity and content of the messages.
15OOD Guidelines (2)
- Cohesion - the strength of association of
elements within a system component (i.e. the
degree to which the responsibilities of a single
component form a meaningful unit) - An entity, such as a class, an operation, or a
module, is coherent if it is organized on a
consistent plan and all its parts fit together
toward a common goal. - Its something to be maximized e.g., a single
method should not contain both policy and
implementation.
16OOD Guidelines (3)
- Reuse
- Code reuse
- cut, copy, and paste
- subroutines and includes
- binary links
- Design reuse
- code reuse typically occurs at the bottom levels
of a system design hierarchy while design reuse
results in whole branches of the tree being
reused - Specification reuse
- eliminate completely the effort involved in
designing, coding, and testing an implementation
of that specification
17Introduction of UML
18UML
- Unified Modeling Language
- It unifies the methods of Booch, Rumbaugh, and
Jacobson - Model -- an abstraction of something for the
purpose of understanding it before building it - architectural models to show customers
- airplane models for wind-tunnel tests
19UML (2)
- It is a modeling language, not a method
- A method consists of both a modeling language and
a process - The modeling language is the notation that
methods use to express designs - The process is their advice on what steps to take
in doing a design
20UML (3)
- Different parts of UML
- Views - show different aspects of the system
- Diagrams - graphs that describe the contents in a
view - Model elements - represent common oo concepts
such as classes, objects, messages, and
relationships - General mechanisms - provide extra comments,
information, or semantics about a model element
21Views
- Use-case view A view showing the functionality
of the system as perceived by external actors. - Logical view A view showing how the
functionality is designed inside the system, in
terms of the systems static structure and
dynamic behavior.
22Diagrams
- For static parts of a system
- class diagram
- object diagram
- component diagram
- deployment diagram
- For dynamic parts of a system
- use case diagram
- sequence diagram
- collaboration diagram
- state diagram
- activity diagram
23Static Dynamic
- All systems have a static structure and dynamic
behavior. - Static view represents structural, data aspects
of a system. It does not describe the
time-dependent behavior of the system. - Dynamic modeling is to demonstrate how the
objects interact dynamically at different times
during the execution of the system, i.e. how the
objects collaborate through communication and how
the objects within the system change state during
the systems lifetime.
24Use Case Modeling
- Originates from Ivar Jacobsons methodology
(OOSE) - Purposes for use cases
- To provide a complete specification, from the
users point of view, of how the system will
function - To provide a basis for performing system tests
that verify the system - Defines actors and use cases
- Users are classified as actors in the system. For
each actor, specific use cases are played against
the system. Collectively the use cases detail
everything that the users can do with the system.
25Use Case Modeling (2)
- Actor - someone or something that interacts with
the system (send or receive messages to and from
the system) an actor can be a human being or
another system - Finding actors - by answering a number of
questions - Who will use the main functionality of the
system? - Who will need support from the system to do
their daily tasks? - Who will need to maintain, administrate, and
keep the system working? - Which hardware devices does the system need to
handle? - With which other systems does the system need to
interact? - Who or what has an interest in the results that
the system produces?
26Use Case Modeling (3)
- Use Case - a set of sequences of actions a system
performs that yield an observable result of value
to a particular actor - is always initiated by an actor (The actor must
directly or indirectly order the system to
perform the use case) - provides value to an actor
- is complete (not a function call a use case is
not complete until the end value is produced) - Finding use cases - for each of the actors
identified, ask - Which functions does the actor require from the
system? - What does the actor need to do?
- What input/output does the system need? Where
does this I/O come from or go to?
27Use Case Modeling (4)
- Example - recycling machine
- Two actors the Customer and the Operator. Brian
is the operator of the machine, so he normally
acts as the Operator actor. However, sometimes he
deposits his own bottles and cans, and then he
acts as a Customer. - Use cases
- Customers deposit cans and/or bottles.
- Customers print receipts.
- Customers collect money.
- Operators collect cans and/or bottles.
- Operators replace receipt paper.
- .
28Use Case Diagram
Recycling Machine
Deposit cans/bottles
customer
Collect cans/bottles
Print receipt
Collect money
operator
29Finding the Objects
- Using nouns (see example 1)
- Responsibility driven approach (see example 2,3)
- Using the things to be modeled (e.g. identify
individual or group things, such as persons,
organizations, locations, logs, reports, forms,
etc.) - Using decomposition
- Using generalization
- Reusing an application framework
30Using Decomposition
- Patient -gt Surgical patient, Referral patient
Patient
referralPatient
nameString ssnNumber
surgicalPatient
rphys setPhysician() physicianIs()
surgery setSurgery() surgeryIs()
init() nameIs() SSNis()
31Using Generalization
- Surgical patient, Referral patient -gt Patient
referralPatient
nameString ssnNumber
surgicalPatient
rphys setPhysician() physicianIs()
surgery setSurgery() surgeryIs()
init() nameIs() SSNis()
32Reusing An Application Framework
- The steps of this technique follow
- identify one or more relevant application
frameworks in the same application domain - reuse both objects and classes from previously
developed frameworks (note that some of the
classes may need to be modified to be reused in
your specific application)
33Using Nouns
34Example 1 Electronic Filing Program
35The Electronic Filing System
- Problem Statement
- An electronic filing program (EFP) can be used to
store and retrieve text documents. Any document
created by a word processor may be stored in the
electronic filing system. Documents may be filed
along with keywords, authors, and/or a document
description or abstract describing the document.
Documents filed in the system may also be removed
or deleted.
36The EFP (2)
- Problem Statement (contd)
- Documents stored using the EFP are indexed to
enable rapid retrieval. Users may retrieve or
locate documents based on their content,
description, author(s), or user-defined keywords.
Therefore, the document description, authors,
keywords, and/or the actual text document itself
may be searched. - A user may specify search criteria, which results
in a number of documents being found that meet
the specified search criteria. The user may then
continue to specify additional search criteria,
successively narrowing down the search until the
required documents are found. Documents found
that meet the users search criteria may then be
viewed or printed.
37The EFP (3)
- Problem Statement (contd)
- The user is provided with the capability of
specifying any junk words, which if found in
the content of the document will not be searched
or indexed - for example, and, or, not, the, if.
The user can also specify which alphanumeric
characters in the text document will be indexed
and searchable (the filing character set),
thereby limiting the search and index to only
portions of a document(s).
38Identifying Object Classes
- Grammatical Inspection - nouns/noun phrases
represent candidate objects/classes - Potential Object Classes
- abstract, alphanumeric character, author,
- content, description, document, document
description, - EFP, electronic filing system, filing character
set, index, - junk word, keyword, number of documents,
- portion of the documents, search, search
criteria, - system, text document, user, user-defined
keyword, - word processor
- By general knowledge
- line, word, page
39Identifying Object Classes (2)
- Problem Statement
- An electronic filing program (EFP) can be used to
store and retrieve text documents. Any document
created by a word processor may be stored in the
electronic filing system. Documents may be filed
along with keywords, authors, and/or a document
description or abstract describing the document.
Documents filed in the system may also be removed
or deleted.
40Identifying Object Classes (3)
- Problem Statement (contd)
- Documents stored using the EFP are indexed to
enable rapid retrieval. Users may retrieve or
locate documents based on their content,
description, author(s), or user-defined keywords.
Therefore, the document description, authors,
keywords, and/or the actual text document itself
may be searched. - A user may specify search criteria, which results
in a number of documents being found that meet
the specified search criteria. The user may then
continue to specify additional search criteria,
successively narrowing down the search until the
required documents are found. Documents found
that meet the users search criteria may then be
viewed or printed.
41Identifying Object Classes (4)
- Problem Statement (contd)
- The user is provided with the capability of
specifying any junk words, which if found in
the content of the document will not be searched
or indexed - for example, and, or, not, the, if.
The user can also specify which alphanumeric
characters in the text document will be indexed
and searchable (the filing character set),
thereby limiting the search and index to only
portions of a document(s).
42Discarding Unnecessary Incorrect Classes
- Redundant Classes - keep the most descriptive
object/class name for object classes that express
the same information - Irrelevant Classes - classes that have little or
nothing to do with the problem domain should be
eliminated - Vague Classes - classes should be specific
(should not have ill-defined boundaries or be too
broad in scope)
43Discarding Unnecessary Incorrect Classes (2)
- Attributes - attributes are properties of object
classes and not object classes themselves - Operations - a name describes an operation that
is applied to objects should be discarded as a
potential object class - Implementation Constructs - anything that has to
do with how the problem is solved should not be a
part of the analysis model
44Redundant Classes
- Document and text document are redundant. Text
document is retained because it is more
descriptive. Content refers to the document
itself and is redundant with text document. - Filing character set and alphanumeric characters
are redundant. Filing character set is retained
because its more descriptive and makes more
sense in the application domain.
45Redundant Classes (2)
- Description, document description, and abstract
are redundant. Abstract is retained because it is
a document description and is a familiar term in
business and academia. - User-defined keyword and keyword are redundant.
All keywords, documents, and authors must be
specified by the user in the EFP. Therefore,
user-defined is not relevant and keyword will be
retained.
46Irrelevant Classes
- Word processor is irrelevant since the creation
of a document is outside the scope of the EFP
software. - Portion of the document and number of documents
have nothing to do with the problem and will also
be eliminated. - User also has little to do with the problem. All
systems have users, and later on we will need to
create a user interface.
47Vague Classes
- System is too broad in scope. The system is
really the EFP, therefore system will be
discarded as a potential object class. - EFP and electronic filing system are rather broad
in scope. It is the application we are attempting
to build, and not an object class in itself.
48Attributes
- A search operation requires search criteria in
order to perform the search, but beyond that
search criteria does not affect the problem. So
search criteria should be treated as an attribute
of a search operation. Search criteria is
discarded as a potential object class.
49Operations
- Search involves a sequence of actions to locate
one or more documents satisfying some search
criteria. Search is discarded as a potential
object class.
50Implementation Constructs
- Filing character set is an implementation
construct. The exact representation of the
collection of filing characters is a design
issue. Filing character set is renamed filing
character.
51Candidate Object Classes
- abstract keyword
- author line
- filing character page
- index text document
- junk word word
52Data Dictionary
- The data dictionary provides a place to collect
information about an object class that is
considered important and to clarify the meaning
of the object class. - Abstract - Brief statement of the essential
thoughts of the document. The abstract may
consist of several sentences describing what the
specific document is all about. - Author - Name of the person who wrote or
originated the document. More than one author may
be associated with a document.
53Data Dictionary (2)
- Filing character - An alphanumeric character that
is recognized by the EFP. Some applications in
which electronic filing is used may require that
only specific characters or numbers be indexed
and retrievable. Only electronic filing
characters are indexed and retrievable. - Index - Each document is indexed in some manner
to enable rapid retrieval of data. The indexing
technique is not specifed at this point in time.
54Data Dictionary (3)
- Junk word - A word that is common in the
vocabulary of the language and is not of any
value for retrieval purposes. Junk words are
therefore not indexed. Examples of junk words are
the following and, the, or, if, is, are. - Keyword - A word that helps the user to uniquely
identify a document. Multiple keywords may be
associated with a document. -
55Data Dictionary (4)
- Line - Text documents are made of up to lines of
words. A document must have at least one line.
Each line in a text document may contain zero or
more words. - Page - A text document that is not an empty
document is made up of one or more pages. Each
page consists of one or more lines.
56Data Dictionary (5)
- Text document - Document possibly created by an
editor, word processor, desktop publishing tool,
etc. A text document is divided into pages. A
document must have one ore more pages. A page may
consist of multiple lines. Each line may consist
of multiple words. A word consists of one or more
letters. - Word - An alphabetic character or some meaningful
combination of alphabetic characters that
represents a unit of language.
57Adding AssociationsBetween Classes
- Grammatical Inspection - verb/verb phrases
represent potential associations between object
classes - Explicit verb phrases
- Implicit verb phrases
- Knowledge of problem domain
- (Note that Associations that do not come
directly from the problem statement should be
verified with the user and the problem domain
expert.)
58Explicit verb phrases
- Documents filed in system Documents filed with
abstract - Documents filed with author Documents filed with
keyword - Documents removed/deleted from system
- Documents is retrievable EFP indexes documents
- EFP retrieves text documents EFP stores text
documents - User prints documents
- User specifies indexable/searchable characters
- User specifies junk words User specifies search
criteria - User views documents Word processor creates
document
59Implicit verb phrases
- Document referenced by index
- Documents created external to EFP
- Documents must be text only
- Documents retrievable by abstract
- Documents retrievable by author
- Documents retrievable by content
- Documents retrievable by keyword
- Search criteria has abstract
- Search criteria has author
- Search criteria has keyword
- Search criteria has word
60Knowledge of problem domain
- Abstract describes document
- Documents contain pages
- Keyword identifies document
- Lines contain words
- Pages contain lines
- Text document identified by author
- Words contain alphanumeric characters
61Discarding Unnecessary Incorrect Associations
- Associations between eliminated classes - any
association stated in terms of those eliminated
classes must also be eliminated or restated in
terms of some other class - Irrelevant or Implementation associations - any
associations dealing with implementation
constructs or outside the problem domain are
eliminated - Actions - potential associations describing
transient events are discarded only those that
describe a permanent relationship between object
classes should be retained
62Associations Between Eliminated Classes
- The EFP was eliminated as a potential object
class, so we can eliminate EFP indexes documents,
EFP retrieves text documents, EFP stores text
documents, Documents created external to EFP. - User was eliminated, so we can eliminate User
prints documents, User specifies
indexable/searchable characters, User specifies
junk words, User specifies search criteria, User
views documents. - Any associations specifying document are changed
to text document.
63Irrelevant or Implementation associations
- Documents must be text only is eliminated because
it is outside the domain of the problem.
Documents are created by programs other than the
EFP, such as editors, word processors. Documents
that are not recognized as text will be rejected
by the EFP.
64Actions
- Documents filed with abstract, Documents filed
with author, Documents filed with
keyword,Documents retrievable by abstract,
Documents retrievable by author, Documents
retrievable by keyword describe interactions
between the user and the EFP and not permanent
relationships. They are all eliminated.
65Candidate Associations
- Abstract describes document
- Documents contain pages
- Document referenced by index
- Keyword identifies document
- Lines contain words
- Pages contain lines
- Text document identified by author
- Words contain alphanumeric characters
- Note that a number of these associations actually
represent aggregation.
66A New Object Class
- Alphanumeric character was discovered while
analyzing potential associations between object
classes. It was discarded as a potential object
class in favor of filing character. It now seems
more relevant since word contains alphanumeric
characters which may be nonfiling. - The discovery of new object classes means the
discovery of new associations - Word contains
alphanumeric character.
67Other Missing Associations
- Other associations are further identified between
object classes - abstract contains lines
- line contains junk words
- index references text document
68Initial EFP Class Diagram
references
identifies
1..
Author
Index
identifies
Text document
Keyword
describes
1..
0..1
Page
Abstract
1..
1..
Line
Junk word
Word
Alphanumeric char
filing char
69Adding Attributes
- Attributes are data values that are held by the
objects in a class. - Look for nouns followed by possessive phrases
(e.g., the length of the bridge, the width of the
road, the voltage of the computer, the number of
characters in the document) in the problem
statement to identify attributes. - Attributes can also be found by drawing on your
knowledge of the application domain and the real
world.
70Potential Attributes
- Based on knowledge of application domain
- Attribute Object
- Author name Author
- Character Filing character
- Character Alphanumeric character
- Date created Text document
- Document description Abstract
- Document file name Text document
- Document size Text document
- Index file name Index
-
71Potential Attributes (2)
- (contd)
- Attribute Object
- Index size Index
- Keyword name Keyword
- Line number Line
- Number of characters Word
- Page number Page
- String Word
- Word Junk word
72Discarding Unnecessary Incorrect Attributes
- Objects - entities that have features of their
own are objects, not attributes. Attributes are
pure data values. (no objects disguising
themselves as attributes in our attributes list) - Qualifiers - a qualifier is a special attribute
that reduces the effective multiplicity of an
association and increase the semantic accuracy.
Any attributes that appear to be qualifiers
should be restated as such.
73Discarding Unnecessary Incorrect Attributes (2)
- Link Attributes - if an attribute depends on the
presence of the link, then it is a link attribute
and not an object attribute. Use association
class for link attributes. (no link attributes
masquerading as object attributes in our list) - Internal Values - attributes that describe the
internal state of an object and are invisible
outside the object should not be part of the
object model during analysis. Postpone this level
of detail until design.
74Qualifiers
- Qualification improves semantic accuracy. For
instance, it is more informative to be told that
a directory and file name combine to identify a
file, rather than be told that a directory has
many files.
Directory
file
file name
Directory
file
75Qualifiers (2)
- Author name, keyword name, and index file name
qualify the associations - author identifies text
document, keyword identifies text document, and
index references text document, respectively.
Author name, keyword name, and index file name
are changed to qualifiers.
76Link Attributes
- A link attribute is a property of the links in an
association. For instance, access permission is
an attribute of Accessible by since access
permission is a joint property of File and User,
and cannot be attached to either File or User
alone without losing information.
Accessible by
User
File
access permission
/etc/termcap (read) John Doe
/etc/tempcap (read-write) Mary Brown
/usr/doe/.login (read-write) John Doe
77Link Attributes (2)
- Another link attributes example
Works-for
Person
Company
boss
name ssn address
0..1
name address
salary job title
worker
performance rating
78Internal Values
- Size of the index object, size of the text
document object, and number of characters in the
word object are attributes that describe the
internal states of the objects. They are
eliminated from our analysis model but are added
to the data dictionary so that they may be
incorporated later into our object design model.
79Candidate Attributes
- Candidate Attribute Object
- Character ASCII character
- Date created Text document
- Document description Abstract
- Document file name Text document
- Line number Line
- Page number Page
- String Word
- Word Junk word
80Use Inheritance to Share Common Structure
- Note that filing characters will most likely be
alphanumeric characters. Therefore, a word should
consist of filing and nonfiling characters. Both
filing and nonfiling characters are ASCII
characters. - However, showing filing character and nonfiling
character as subclasses of ASCII character would
be trivial inheritance. The filing character and
nonfiling character subclasses would not have
distinctive attributes, associations, or
behavior. We choose the representation to show
ASCII character as having attribute, character,
which is of the type filing or nonfiling.
81Initial EFP Class Diagram with Attributes
identifies
references
Text document
Author
author name
Index
identifies
index file name
document file name creation date
Keyword
keyword name
1..
describes
Page
0..1
Abstract
page number
description
1..
Line
Junk word
1..
line number
word
Ascii character
1..
Word
string
characterfiling or nonfiling
82Summary of Deliverables
- The deliverables for developing the object model
are - the problem statement
- the initial data dictionary
- the object model
83Identifying Actors Use Cases
- The major actor in the context of the EFP is the
user. No physical devices (other than the parts
of the computer system itself) or other computer
applications are involved. Our scenarios will
therefore be based on interactions between the
user and the EFP. - A set of use cases for the EFP
- filing a document
- searching for, or finding, a document
- viewing a document
- deleting a document
- printing a document
- changing the filing character set
- changing the junk words
84Use Case Diagram
Filing a doc
Finding a doc
Viewing a doc
Deleting a doc
Printing a doc
user
Changing filing char set
Changing junk word
85Filing a Document
- Scenario 1. Normal scenario for filing a
document. - The user wishes to file a document.
- The user specifies a directory and a document
file. - The user enters an abstract of the document,
keywords, and/or authors. - The user requests the document to be filed.
- The document is filed.
- A possible format for the filing a document use
case is shown in the following two figures.
86Filing a Document (2)
File a Document
File Name
path
OK
Files
Directories
jim.wri susan.wri article.doc computer.rpt
windows borland (..)
(a) (b) (c)
Cancel
Reference Information
87Filing a Document (3)
Document Reference Information
Document Abstract
Keywords
Authors
Cancel
OK
88Filing a Document (4)
- Scenario 2. Filing scenario with exceptions.
- The user wishes to file a document.
- The user specifies a directory.
- The user requests the document to be filed.
- The EFP displays an error message and asks the
user to specify both a directory and file name
for the document. - The user cancels the operation.
89Searching for a Document
- Scenario 3. Normal scenario requiring a single
search for a document. - The user wishes to search for a document(s)
meeting some specific criteria. - The user enters an abstract query for an abstract
search, a word or phrase for a content search,
one or more keywords for a keyword search, and/or
one or more authors for an author search. - The user requests the search to start.
- The EFP returns the names of the documents
satisfying the search criteria. - The user selects a document.
- The user views a document satisfying the search
criteria. - The user ends the request for a search operation.
90Searching for a Document (2)
- Scenario 4. Search scenario with exceptions.
- The user wishes to search for a document(s)
meeting some specific criteria. - The user requests the search to start.
- A message box is displayed showing an error
message and asking the user to enter abstract,
content, keyword, and/or author information as a
query. - The user ends the request for a search operation.
91Searching for a Document (3)
- Scenario 5. Normal scenario requiring multiple
searches for a document. - The user wishes to search for a document(s)
meeting some specific criteria. - The user enters one or more keywords for a
keyword search. - The user requests the search to start.
- The EFP returns the names of the documents
satisfying the search criteria. - The user selects a document.
- The user views a document satisfying the search
criteria. - The user enters additional keywords to narrow
down the search. - The user requests the search to start.
- The EFP returns the names of the documents
satisfying the search criteria. - The user selects a document.
- The user views a document satisfying the search
criteria. - The user ends the request for a search operation.
92Searching for a Document (4)
Search for A Document(s)
Search Results
Content Query
Document Name
View
(and)
Abstract Query
jim.wri computer.doc
(and)
Keyword Query
Print
(and)
Author Query
Done
Search
Done
93Viewing a Document
- Only documents that have been retrieved from a
search may be viewed by the EFP. Scenario 3 shows
an example of a normal scenario for viewing a
document found from a search. Scenario 6 shows an
example with exception. - Scenario 6. Viewing scenario with exceptions.
- The user wishes to search for document(s) meeting
some specific criteria. - The user enters a query.
- The user requests the search to start.
- The EFP returns the names of the documents
satisfying the search criteria. - The user tries to view a document satisfying the
search criteria. - An error message is displayed indicating that a
document must first be selected. - The user ends the request for a search operation.
94Deleting a Document
- Only documents that have been filed by the EFP
may be deleted. The EFP deletes only the index
for the document and not the document itself. - Scenario 7. Normal scenario for deleting a
document. - The user wishes to delete a document.
- The user specifies a document.
- The user requests the document to be deleted.
- The document index is deleted.
- Scenario 8. Delete scenario with exceptions.
- The user wishes to delete a document.
- The user requests the document to be deleted.
- An error message is displayed requesting the user
to specify a document. - The user cancels the operation.
95Deleting a Document (2)
Delete a Document
File Name
path
Files
Directories
jim.wri susan.wri article.doc computer.rpt
OK
windows borland (..)
(a) (b) (c)
Cancel
96Printing a Document
- A user may only print a document that has been
retrieved as part of a search. Scenarios 3 and 5
may be used to print a document by simply
replacing views with prints.
97Changing the Character Set
- As stated in the problem statement, the user can
specify which alphanumeric characters will be
indexed and searchable, thereby limiting the
search and index to only portions of a
document(s). - Scenario 9. Normal scenario for changing the
character set. - The user wishes to add a character to the filing
character set. - The user specifies a character to include in the
filing character set. - The user requests the character to be included.
- The character is included in the character set.
- Scenario 10. Character set scenario with
exceptions. - The user wishes to add a character to the filing
character set. - The user specifies a character to include in the
filing character set. - The user cancels the operation.
98Changing the Character Set (2)
Changing Filing Characters
Characters
Character
c d _at_ A
OK
Discard
Include
Cancel
99Changing the Junk Words
- As stated in the problem statement, the user can
specify any junk words, which will not be
searched or indexed - for example, and, or, not,
the, if. - Scenario 11. Normal scenario for changing junk
words. - The user wishes to add a new junk word to the
programs set of junk words. - The user enters a junk word.
- The user requests the word to be added.
- The word is added to the junk word set.
- Scenario 12. Junk word scenario with exceptions.
- The user wishes to add a new junk word to the
programs set of junk words. - The user enters a junk word.
- The user cancels the operation.
100Changing the Junk Words (2)
Changing Junk Words
Junk Words
Junk Word
and the if or him then was
Add
Delete
OK
Cancel
101Preparing Sequence Diagrams
- Sequence diagrams describe how groups of objects
interact and collaborate, emphasize the time
order of messages - Sequence diagrams are constructed by
- identifying events (or messages) in scenarios
- identifying the actor/object that sends an event
- identifying the actor/object that receives an
event
102Sequence Diagram for Filing a Document
An User
A User Interface
A Text Document
request file operation
specify directory file name
enter abstract, keywords, and/or authors
request document to be filed
process filing request
document filed
document filed
103Sequence Diagram for Searching a Document
An User
A User Interface
A Text Document
request search operation
enter abstract, content, keyword, and/or author
queries
request search to start
find document(s)
list of documents meeting search criteria
list of documents meeting search criteria
select a document
view a document
Note that this is also the sequence diagram for
viewing (printing) a document
end request for search
104Sequence Diagram for Deleting a Document
An User
A User Interface
A Text Document
request delete operation
specify directory file name
request document index deletion
delete document index
document index deleted
document index deleted
105Sequence Diagram for Changing Character Set
An User
A User Interface
request filing character operation
specify filing character to include
character included in set
106Sequence Diagram for Adding Junk Words
An User
A User Interface
request junk word operation
enter junk word
request junk word to be added
junk word is added
107State Diagrams
- State Diagram (SD) - a set of states and events
and their relationships to describe the behavior
of a system (usually one state diagram for each
object class with nontrivial dynamic behavior). - An event is something that happens at some point
in time, e.g. left-mouse-button is clicked. - The attribute values held by an object represent
the state of the object, e.g. the state of a
person is healthy or unhealthy. - Event has no duration state occupies an interval
of time.
108State Diagrams (2)
- States and events are dual of one another (i.e.
an event separates two states and a state
separates two events). - State diagram for light switch
Flip switch
off
on
Flip switch
109State Diagrams (3)
- The state of the system is the product of the
states of all the objects (not represented by a
single state of a single object). - General form
Event guard /action
State 1 entry/action do/activity exit/action
State 2 entry/action do/activity exit/action
110User Interface Class State Diagram
Start
selection
User Interface
File Document
Delete Document
Search
Filing Character
Junk Word
111File Document State Diagram
File Document
Document Data Input
Path Input
dorequest file name
file name entered/record file name
cancel operation selected /cancel operation
dorequest directory name
directory name entered/record directory
name
document reference information requested
Document Reference Information
File dofile
document
dorequest keywords
keywords entered/record keywords
dorequest authors
authors entered/record authors
file document operation selected directoryfile
name entered
dorequest abstract
abstract entered/record abstract
112Delete Document State Diagram
Delete Document
Path Input
dorequest file name
file name entered/record file name
dorequest directory name
directory name entered/record directory
name
delete operation selected directoryfile name
entered
cancel operation selected /cancel operation
Delete dodelete
document
113Search State Diagram
Search
Query Input
dorequest content query
content query entered/record query
cancel operation selected /cancel operation
dorequest keyword query
keyword query entered/record query
dorequest abstract query
abstract query entered/record query
end search
start search query entered
dorequest author query
author query entered/record query
Find Documents dolook for
document
list of document names generated
complete examining search results
Search Results Visible
view document
dopresent document in window
dorequest file name
file name entered/record file name
viewing done
print document
dorequest directory name
directory name entered/record
directory name
doprint text document
print done
114Junk Word State Diagram
Junk Word
dorequest junk word
junk word entered/record junk word
cancel operation selected /cancel operation
delete
junk word operation complete
doremove junk word
add
doinclude junk word
115Filing Character State Diagram
Filing Character
dorequest filing character
filing character entered/record
filing character
cancel operation selected /cancel operation
delete
filing character operation complete
doremove filing character
include
doadd filing character
116Updating the Object Model
- A user interface is an application object. The
application object does not need to be included
in the initial object model, but should be added
to the object model after making up the dynamic
model.
117 Revision of EFP Object Model
User interface
file document, search for document, delete a
document, add/delete junk word, include/discard
filing character, view document, print document
references
identifies
Text document
Author
author name
Index
index file name
identifies
document file name creation date
Keyword
keyword name
1..
describes
Page
0..1
Abstract
page number
description
1..
Line
Junk word
1..
line number
word
Ascii character
Word
1..
string
characterfiling or nonfiling
118Summary of Deliverables
- The deliverables for developing the dynamic model
are - scenarios of typical interaction sequences
- sequence diagrams for each scenario
- state diagrams for those classes with important
dynamic behavior - a revised object model (if necessary)
119Key Operations
- File and find are the two major functions of the
EFP system. - For the file operation, the processes include
- validate document type
- create text document index
- For the find operation, the processes include
- build search vector (for content query)
- check for document matches (for content query)
- check for document reference information matches
(for abstract, keyword, author queries) - build document name list, i.e., the searching
result
120Missing Classes
- Hash engine
- Hash document record process has significant
computation. We create a class, called hash
engine, to collect all of the hashing functions
together in one place. - This will minimize the impact on the system as
these hashing algorithms are optimized. - Hash engine creates an index of a document.
121Missing Classes (2)
- Search engine
- The search engine class collects the search
functions together in one place to facilitate a
search. - The operations of search engine operate on the
content query, search vector, filing directory,
and document name list object classes. - Search vector
- Build search vector is a top-level process that
is implemented by several low-level processes. - A search vector is produced by a search engine.
122Missing Classes (3)
- Content query
- A content query is a collection of phrase(s) and
query operator(s). It allows users to check for
document matches. It has features of its own and
is modeled as a class. - A content query will be processed by a search
engine. - Document name list
- Document name list class has an attribute that is
a name list, generated as the result of a search. - Document name list is produced from search engine.
123Missing Classes (4)
- Document reference information
- Document reference information will be used to
check for document reference information matches
(in a find operation). - A document reference information class consists
of zero or more author objects, zero or more
keyword objects, and zero or more abstract. So it
has an aggregate relationship with the author,
keyword, and abstract objects.
124Adding Operations to the OM
- Operation Object Class
- file document text document
- find document search engine
- create text document index document index
- build search vector search engine
- check for document matches content query
- check for doc ref info matches doc ref
information - hash document record hash engine
- build document name list search engine
125Adding Operations to the OM (2)
- Operation Object Class
- view document text document
- print text document text document
- delete document index filing directory
126Another Missing Classes
- Filing directory
- filing directory object class has zero or more
index object classes
User interface
Filing directory
file document search for
document delete a document
add/delete junk word include/discard filing
character view document
print document
index file name
references
Index
index file name
Text document
127 Revision 2 of EFP Object Model
Document name list
0..1
Search engine
User Interface
Filing directory
1..
build search vector build doc name list find doc
delete index
Operates on
Index file name
Index file name
Text document
yield
doc name dir name creation date
describes
Document reference information
utilizes
0..1
references
Index file name
1..
0..1
Index
Search vector
file doc view doc print doc
check for document ref info matches
vector
create text doc index
build search vector
1..
1..
Page
1..
Author
Keyword
0..1
Hash engine
Query
1..
1..
Abstract
hash doc record
Line
Word
String
ASCII char
1..
1..
Charfiling or nonfiling
Junk word
Nonjunk word
128Designing the Application Interface
- The steps in designing the interactive interface
include - Isolate user interface objects from the objects
that define the semantics of the application. - Use the dynamic model as the structure of the
program. - Fully specify the application functions invoked
by the user interface.
129Menu Bar Pull-Down Menus
File Document Storage Document Retrieval
Utilities Help
Search...
Filing characters Junk words...
Exit
File Delete...
Contents Using Help Commands
Dialog Boxes Junk Words Filing
Characters
About Electronic Filing
130 User Interface Class Diagram
Window
exit file
delete search
filing characters junk words help
Dialog
File a Doc
Doc Ref Info
Search
Delete
Junk Word
OK cancel reference info
OK cancel
search cancel done
OK cancel
add delete OK