Beruflich Dokumente
Kultur Dokumente
INF207-E
OBJECT-ORIENTED CONCEPTS
DEPARTMENT OF SYSTEMS DEVELOPMENT
SCHOOL OF COMPUTING
UNISA
inf207@osprey.unisa.ac.za
http://osprey.unisa.ac.za
TABLE OF CONTENTS
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Nota aan Afrikaanssprekende studente
.............................................. 3
.................................................................. 4
Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
INF207-E/205
Introduction
Nota aan Afrikaanssprekende studente
INF207-E/101/2005
INF207-E/102/2005
Contact Information
INF207-E/201/2005
Discussion of Assignment 1
INF207-E/202/2005
Discussion of Assignment 2
INF207-E/203/2005
Discussion of Assignment 3
INF207-E/204/2005
Discussion of Assignment 4
INF207-E/205/2005
Solution to Assignment 5
ASSIGNMENT 5
Due Date: 17 July 2006
Maximum credits: 100
Marks: 100
Study Letter 101 (this letter)
Study Letter 501
SCHACH : Chapters 1-10
Please use a word processor to do this assignment.
[50]
[50]
Solution
1) Requirements Workflow of the Chocoholics Anonymous Project
The initial glossary of the Chocoholics Anonymous project is depicted below:
Accounts payable
Chocolate
Chocoholics
Anonymous
(ChocAn)
Electronic
fund
(EFT)
transfer
Invalid number
Member number
INF207-E/205
5
ChocAn.
Member status
Magnetic tape
Member suspended
The member number is valid but the member has not paid his or
her dues
Provider
Provider directory
Provider number
Provider status
Active, Inactive.
Provider type
Service code
dietitian.)
Validation
Visit
ChocAn
Information
System
Maintain
Member
Maintain
Provider
Verify
Member Status
Add Visit
Member
Provider
Print Member
Report
Print Provider
Report
include
Print Manager
Report
Print EFT
Report
The use case Maintain Member combines use cases Add Member and Update Member, and similarly for
Maintain Provider. The use-case diagram is shown in Figure 1. Descriptions of the use cases appear in
Figures 2 through 8.
Brief description:
The Maintain Member use case enables a provider to enter new member data or update existing
member data given by the member.
Step-by-step description:
1.
INF207-E/205
Brief description:
The Verify Member Status use case enables the provider to validate a members status by
entering the member number into the system.
Step-by-step description:
1
2.
The ChocAn information system informs the provider regarding the member status.
Figure 4. Description of the Verify Member Status use case for ChocAn.
Brief description:
The Add Visit use case enables a provider to enter details of a members visit into the ChocAn
information system.
Step-by-step description:
1.
The ChocAn information system checks whether the member number is valid. If so, the
Brief description:
The Print Member Report use case enables a member to receive a list of all the services provided
to that member during the current week.
Step-by-step description:
1.
The ChocAn information system prints a report of all visits by each member during the
Brief description:
The Print Provider Report use case enables a provider to receive a list of all the services
provided by that provider during the current week.
Step-by-step description:
1.
The ChocAn information system prints a report of services provided by each provider during
the current week, including:
Provider name, number, address, city, state, ZIP code.
For each service provided:
Date of service
Date and time data received from computer
Member name and number
Service code
Fee to be paid
Total number of consultations with members
Total fee for the week
Figure 7. Description of the Print Provider Report use case for ChocAn.
INF207-E/205
Brief description:
The Print EFT Report enables the ChocAn information system to print a list of funds to be
transferred to the providers bank accounts.
Step-by-step description:
1.
Figure 8. Description of the Print EFT Report use case for ChocAn.
Brief description:
The Print Manager Report use case enables a ChocAn manager to print the Accounts Payable
report summarizing the fees to be paid for the current week and the total number of visits to
providers.
Step-by-step description:
1.
Figure 9. Description of the Print Manager Report use case for ChocAn.
The initial business model includes all the use cases of Figure 1, together with their descriptions.
The initial requirements include all the use cases of Figure 1, together with their descriptions.
10
2) Analysis Workflow of the Chocoholics Anonymous Project
In this solution, subheadings are underlined.
Scenarios for the use cases of Figure 1 appear in Figures 10 through 19.
A provider wishes to add a new member.
1.
2.
The system displays a message that the member has been successfully added.
Figure 10. First scenario of the Maintain Member use case of the ChocAn information system.
The provider locates the current member record by searching by member name or member
number.
2.
3.
The system displays a message that the member information has been successfully modified.
Figure 11. Second scenario of the Maintain Member use case of the ChocAn information system.
11
INF207-E/205
2.
The system displays a message that the provider has been successfully added.
Figure 12 First scenario of the Maintain Provider use case of the ChocAn information system.
The provider locates the current provider record by searching by provider name or provider
number.
2.
3.
The system displays a message that the provider information has been successfully modified.
Figure 13. Second scenario of the Maintain Provider use case of the ChocAn information system.
1.
2.
The system determines whether the member is active, inactive, suspended, or not found.
Figure 14 Scenario of the Verify Member Status use case of the ChocAn information system.
12
A member visits a provider.
1.
2.
3.
4.
5.
6.
The name and number of all services available from that provider are displayed on the screen
by the system.
7.
8.
9.
12. The system displays a message that the visit has been successfully added.
Figure 15. Scenario for the Add Visit use case of the ChocAn information system.
13
INF207-E/205
The ChocAn information system prints a report of all visits by each member during the
The ChocAn information system prints a report of services provided by each provider during
Figure 18. Scenario for the Print EFT Report use case of the ChocAn information system.
14
A ChocAn manager wishes to print a manager report.
1
The ChocAn information system prints a report of services provided by each provider during
Identify the nouns: For a monthly fee, members of ChocAn are entitled to unlimited visits to providers.
The services of the providers include those of internists, dietitians, and exercise experts. Reports are
printed each week regarding members, providers, and the overall fees payable to providers.
With regard to the nouns in the previous paragraph, internist, dietitian, and exercise expert could be
treated two ways. First, they could be considered subclasses of Provider Class. Second, they could be
considered attributes of Provider Class. For simplicity, we adopt the second choice, noting that it is
easier to add subclasses than to remove them. Also, fee, ChocAn, report, and week are abstract nouns.
This leaves Member Information Class, Visit Information Class, Provider Information Class, and
Service Information Class as the candidate entity classes.
Now comparing scenarios 10 and 11 with scenarios 12 and 13, it is clear that we need to declare a class
Person Information Class as a superclass of Member Information Class and Provider Information Class.
[A hint in this regard is given to the student in Appendix ABoth providers and members have name,
number, address, city, state, and ZIP code attributes].
INF207-E/205
15
The initial class diagram is shown in Figure 20.
ChocAn
Application Class
Person
Information Class
Service
Information Class
Visit
Information Class
Member
Information Class
Figure 20. The initial class diagram for the ChocAn information system.
Provider
Information Class
16
Add Visit Class
Create Reports Class
The initial statechart is shown in Figure 21.
quit
selected
maintain member
selected
maintain provider
selected
member status
selected
add visit
selected
print reports
selected
Maintaining
Member
Maintaining
Provider
Modify or add
provider information
Verifying
Member Status
Verify status of
member
Adding
Visit
Printing
Reports
Add visit
information for
member
Print member,
provider (EFT), or
manager report
INF207-E/205
17
Get
Input
Class
Member
ChocAn
Interface
Class
Provider
Figure 22.
Maintain
Member
Class
Member
Info
Class
Class diagram showing the classes that realize the Maintain Member and Verify
Member Status use cases of the ChocAn information system.
: Get
Input
Class
3: Supply new
member data
4: Return new
member data
Member
1: Select Add
Member option
Provider
Figure 23.
8: Display acknowledgment
: ChocAn
Interface
Class
2: Transfer
selection
5: Add new
member
7: Send acknowledgment
: Maintain
6: Send acknowledgment
Member
Class
: Member
Info
Class
18
The class diagram is shown in Figure 22.
Consider the scenario of Figure 10, the first scenario of the Maintain Member use case. The collaboration
diagram is shown in Figure 23, the flow of events in Figure 24, and the corresponding sequence diagram in
Figure 25.
The provider enters data provided by the new member (13). The ChocAn information system
is updated accordingly (45). An acknowledgment is displayed (68).
Figure 24. The flow of events of the realization of the scenario of Figure 23 of the Maintain Member use
case of the ChocAn information system.
Member
Provider
: ChocAn Interface
Class
: Maintain Member
Class
: Get Input
Class
: Member Info
Class
1: Select Add
Member option
2: Transfer selection
3: Supply new
member data
4: Return new
member data
Data provided
by the member
for the provider
to enter
Figure 25.
INF207-E/205
19
: Get
Input
Class
3: Supply modified
member data
4: Return modified
member data
Member
1: Select Modify
Member option
Provider
Figure 26.
8: Display acknowledgment
2: Transfer
selection
: ChocAn
Interface
Class
7: Send acknowledgment
5: Modify
member data
: Maintain
Member
Class
6: Send acknowledgment
: Member
Info
Class
The provider enters modified data provided by the member (13). The ChocAn information
system is updated accordingly (45). An acknowledgment is displayed (68).
Figure 27.
Now consider the scenario of Figure 11, the second scenario of the Maintain Member use case. The
collaboration diagram is shown in Figure 26, the flow of events in Figure 27, and the corresponding
sequence diagram in Figure 28.
20
Member
Provider
: ChocAn Interface
Class
: Maintain Member
Class
: Get Input
Class
: Member Info
Class
1: Select Modify
Member option
2: Transfer selection
3: Supply modified
member data
4: Return modified
member data
Data provided
by the member
for the provider
to enter
Figure 28.
Get
Input
Class
Provider
Figure 29.
ChocAn
Interface
Class
Maintain
Provider
Class
Class diagram showing the classes that realize the Maintain Provider
use case of the ChocAn information system.
Provider
Info
Class
INF207-E/205
21
: Get
Input
Class
3: Supply new
provider data
1: Select Add
Provider option
Provider
Figure 30.
8: Display acknowledgment
: ChocAn
Interface
Class
4: Return new
provider data
2: Transfer
selection
5: Add new
provider
7: Send acknowledgment
: Maintain
6: Send acknowledgment
Provider
Class
: Provider
Info
Class
The new provider enters data (13). The ChocAn information system is updated accordingly (45).
An acknowledgment is displayed (68).
Figure 31.
The flow of events of the realization of the scenario of Figure 7.75 of the
Maintain Provider use case of the ChocAn information system.
22
Provider
: ChocAn Interface
Class
: Maintain Provider
Class
: Get Input
Class
: Provider Info
Class
1: Select Add
Provider option
2: Transfer selection
3: Supply new
provider data
4: Return new
provider data
5: Add new provider
6: Send acknowledgment
7: Send acknowledgment
8: Display acknowledgment
Figure 32.
: Get
Input
Class
3: Supply modified
provider data
1: Select Modify
Provider option
Provider
Figure 33.
8: Display acknowledgment
4: Return modified
provider data
2: Transfer
selection
: ChocAn
Interface
Class
7: Send acknowledgment
5: Modify
provider data
: Maintain
Provider
Class
6: Send acknowledgment
: Provider
Info
Class
INF207-E/205
23
The provider enters modified data (13). The ChocAn information system is updated accordingly
(45). An acknowledgment is displayed (68).
Figure 34.
Now consider the scenario of Figure 13, the second scenario of the Maintain Provider use case. The
collaboration diagram is shown in Figure 33, the flow of events in Figure 34, and the corresponding
sequence diagram in Figure 35.
Provider
: ChocAn Interface
Class
: Maintain Provider
Class
: Get Input
Class
: Provider Info
Class
1: Select Modify
Provider option
2: Transfer selection
3: Supply modified
provider data
4: Return modified
provider data
5: Modify provider data
6: Send acknowledgment
7: Send acknowledgment
8: Display acknowledgment
Figure 35.
24
: Get
Input
Class
3: Request member
number
Member
Provider
Figure 36.
1: Select Verify
Member Status
option
8: Display member
status
: ChocAn
Interface
Class
4: Return member
number
2: Transfer
selection
5: Request
member status
7: Return member
status
: Maintain
Member
Class
6: Return member
status
: Member
Info
Class
The provider enters the member number, supplied by the member (14). The ChocAn information
system returns the member status (57), which is then displayed (8).
Figure 37.
The flow of events of the realization of the scenario of Figure 14 of the Verify
Member Status use case of the ChocAn information system.
INF207-E/205
25
Use case Verify Member Status:
The class diagram is shown in Figure 22.
Consider the scenario of Figure 14 of the Verify Member Status use case. The collaboration diagram is
shown in Figure 36, the flow of events in Figure 37, and the corresponding sequence diagram in Figure 38.
Member
Provider
: ChocAn Interface
Class
: Maintain Member
Class
: Get Input
Class
: Member Info
Class
Data provided
by the member
for the provider
to enter
Figure 38.
26
The member provides
data for the provider
to enter
Get
Input
Class
Member
Provider
Figure 39.
ChocAn
Interface
Class
Add
Visit
Class
: Maintain
Member
Class
Maintain
Provider
Class
Request
Service
Class
Member
Info
Class
Provider
Info
Class
Service
Info
Class
Class diagram showing the classes that realize the Add Visit use case
of the ChocAn information system.
Visit
Info
Class
INF207-E/205
27
Use case Add Visit:
The class diagram is shown in Figure 39.
Member
1: Select Add
Visit option
Provider
4: Return member
number
20: Return comments and
date of visit
2: Transfer
selection
: ChocAn
Interface
Class
8: Transfer
member
information
: Maintain
Member
Class
6: Request
member
information
7: Return
member
information
: Member
Info
Class
5: Transfer member
number
Figure 40.
: Get
Input
Class
: Add
Visit
Class
9: Transfer
provider
number
: Visit
Info
Class
: Maintain
Provider
Class
10: Request
11: Return
provider
provider
information
information
: Provider
Info
Class
: Request
Service
Class
14: Request
sevice code
16: Approve
service
name
15: Return
service
name
17: Return
service
information
: Service
Info
Class
28
The provider enters the member provided by the member (14). The ChocAn information system
determines the member's status and other member information (58). Now the provider number
is used to obtain provider information (912). Next, the service code is entered (1314) and the
service name returned, displayed for the provider's approval (15-16), and used to return service
information (1718). The provider provides comments and the date of visit (1920). Visit
information is then recorded and displayed (2124).
Figure 41.
(The box above is the figure - as done by the process in the textbook (see
p.117).) The flow of events of the realization of the scenario of Figure 15 of
the Add Visit use case of the ChocAn information system.
Consider the scenario of Figure 15, a scenario of the Add Visit use case. The collaboration diagram is
shown in Figure 40, the flow of events in Figure 41, and the corresponding sequence diagram in Figure 42.
INF207-E/205
29
Member
: ChocAn Interface
Class
1: Select Add
Visit option
Provider
: Add Visit
Class
: Get Input
Class
: Maintain Member
Class
: Member Info
Class
2: Transfer selection
3: Request member
number
4: Return member
number
Data provided
by the member
for the provider
to enter
Figure 42.
30
: Maintain Provider
Class
: Provider Info
Class
: Request Service
Class
: Service Info
Class
: Visit Info
Class
Figure 42.
INF207-E/205
31
Member
Info
Class
ChocAn
Interface
Class
Figure 43.
Create
Report
Class
Member
Report
Class
Class diagram showing the classes that realize the Print Member Report use
case of the ChocAn information system.
: Member
Info
Class
3: Request member
information
1: Select Print
Reports option
Provider
Figure 44.
8: Display acknowledgment
4: Return member
information
2: Select Print
Member Report
: ChocAn
Interface
Class
7: Send acknowledgment
5: Print member
report
: Create
Report
Class
6: Send acknowledgment
: Member
Report
Class
32
Use case Print Member Report:
The class diagram is shown in Figure 43.
Consider the scenario of Figure 16 of the Print Member Report use case. The collaboration diagram is
shown in Figure 44, the flow of events in Figure 45, and the corresponding sequence diagram in Figure 46.
The provider requests that a report be printed (1) and that it be the member report (2).
Information regarding the member is obtained (34), the report printed (5), and an
acknowledgment is displayed (68).
Figure 45.
The flow of events of the realization of the scenario of Figure 44 of the Print
Member Report use case of the ChocAn information system.
: Create
: ChocAn Interface
Class
Report Class
1: Select Print
Reports option
2: Select Print
Member Report
Provider
: Member Info
Class
: Member Report
Class
3: Request member
information
4: Return member
information
5: Print member report
6: Send acknowledgment
7: Send acknowledgment
8: Display acknowledgment
Figure 46.
INF207-E/205
33
: Provider
Information
Class
Provider
: ChocAn
Interface
Class
: Create
Report
Class
: Provider
Report
Class
: Service
Information
Class
Figure 47.
Class diagram showing the classes that realize the Print Provider Report use
case of the ChocAn information system.
34
: Provider
Information
Class
3: Request
provider
information
1: Select Print
Reports option
Provider
4: Return
provider
information
2: Select Provider
Report
: ChocAn
Interface
Class
9: Send acknowledgment
7: Print provider
report
: Create
Report
Class
6: Return
service
information
8: Send acknowledgment
: Provider
Report
Class
5: Request
service
information
: Service
Information
Class
Figure 48.
The provider requests that a report be printed (1) and that it be the provider report (2).
Information regarding each provider (34) and the services provided by that provider (56) is
obtained and incorporated in the provider report. The provider report is printed (7), and an
acknowledgment is displayed (810).
Figure 49.
The flow of events of the realizations of the scenario of Figure 48 of the Print
Provider Report use case of the ChocAn information system.
INF207-E/205
35
: ChocAn Interface
: Create Report
Class
Class
1: Select Print
Reports option
2: Select Print
Provider
Report
Provider
: Provider Info
Class
: Service Info
Class
: Provider Report
Class
3: Request provider
information
4: Return provider
information
5: Request service information
6: Return service information
7: Print provider report
10: Display
acknowledgment
Figure 50.
9: Send
acknowledgment
36
: Provider
Information
Class
Provider
: ChocAn
Interface
Class
: Create
Report
Class
: EFT
Report
Class
: Service
Information
Class
Figure 51.
Class diagram showing the classes that realize the Print EFT Report use case
of the ChocAn information system.
INF207-E/205
37
: Provider
Information
Class
4: Return
provider
information
3: Request
provider
information
1: Select Print
Reports option
Provider
2: Select EFT
Report
: ChocAn
Interface
Class
7: Print EFT
report
9: Send acknowledgment
: Create
Report
Class
6: Return
service
information
8: Send acknowledgment
: EFT
Report
Class
5: Request
service
information
: Service
Information
Class
Figure 52.
The provider requests that a report be printed (1) and that it be the EFT report (2).
Information regarding each provider (34) and the services provided by that provider (56) is
obtained and incorporated in the EFT report.
The flow of events of the realizations of the scenario of Figure 52 of the Print
EFT Report use cases of the ChocAn information system.
38
: ChocAn Interface
: Create Report
Class
Class
1: Select Print
Reports option
2: Select Print
Provider
report
Provider
: Provider Info
Class
: Service Info
Class
: EFT Report
Class
3: Request provider
information
4: Return provider
information
5: Request service information
6: Return service information
7: Print provider report
10: Display
acknowledgment
Figure 54.
9: Send
acknowledgment
INF207-E/205
39
: Provider
Information
Class
Provider
: ChocAn
Interface
Class
: Create
Report
Class
: Manager
Report
Class
: Service
Information
Class
Figure 55.
Class diagram showing the classes that realize the Print Manager Report use
case of the ChocAn information system.
40
: Provider
Information
Class
3: Request
provider
information
1: Select Print
Reports option
Provider
4: Return
provider
information
2: Select Print
Manager Report
: ChocAn
Interface
Class
9: Send acknowledgment
7: Print manager
report
: Create
Report
Class
6: Return
service
information
8: Send acknowledgment
: Manager
Report
Class
5: Request
service
information
: Service
Information
Class
Figure 56.
The provider requests that a report be printed (1) and that it be the print manager report (2).
Information regarding each provider (34) and the services provided by that provider (56) are
obtained and incorporated in the print manager report.
INF207-E/205
41
: ChocAn Interface
: Create Report
Class
Class
1: Select Print
Reports option
2: Select Print
Manager
Report
Provider
: Provider Info
Class
: Service Info
Class
: Manager Report
Class
3: Request provider
information
4: Return provider
information
5: Request service information
6: Return service information
7: Print manager report
10: Display
acknowledgment
Figure 58.
9: Send
acknowledgment
UNISA 2006