Académique Documents
Professionnel Documents
Culture Documents
Q u e ry F o r V id e o s
P a y F in e s
R e n t V id e o s
M anage M e m b e r s h ip s C le r k L o g In C u s to m e r
M a n a g e V id e o s M anager M a n a g e U s e rs A d m in is t r a t o r
2. Write the Rent Videos use case in expanded, essential, conversational style. Include both a typical course of events, and an alternatives section. In the alternatives section, list exactly two frequent alternatives. Do not write an elaborate heading section for the use case (i.e., ignore Purpose, Overview, ); rather, start immediately with the typical course of events.
Use Case: Rent Videos
Essential, Expanded, Conversational Style Typical Course of Events Actor Actions 1. 2. This use case begins when a Customer arrives at a checkout with videos to rent. The Customer presents their membership identification to the Clerk, who enters it into the system. For each video, the Clerk records the item identification into the system. Clerk informs Customer of total rental fee, and asks for payment. Customer pays cash to Clerk. Clerk records payment into system. 9. Generates receipt and loan report. 3. Presents membership information, and status of loans (usually nothing on loan, and no outstanding fines). Presents accumulating list of rental video titles, due dates, and total rental fee. System Response
4. 6. 7. 8.
5.
10. Clerk gives receipt and loan report to Customer, who then leaves with the rental items. Alternatives Step 3: Customer has unpaid fines. Customer must pay them before proceeding with the loan. Step 6. Customer has insufficient cash. Cancel transaction or deduct rental items until transaction can be paid for.
*
I n it i a t e s 1 1 C u s to m e r a d d re s s na m e phoneNum b er R e n ts -fr o m R e n ts V id e o S t o r e a d d re s s nam e p ho ne N um b e r 1 M e m b e r s h ip ID s ta r tD a te I d e n t if i e s - r e n t e r -o f 1
1 ..* S to c k s 1 V id e o ID I s - r e c o r d e d - in
* * *
1 S t o r a g e M e d iu m d e s c r ip t i o n
1 O w n s -a 1 C a t a lo g 1 D e s c r ib e d - b y 1 .. *
L o a n P o li c y p e r D a y R e n ta lC h a r g e p e rD a y L a te C h a rg e 1 .. * 1 D e f in e s 1 ..*
V id e o D e s c r i p t i o n t it le s u b je c t C a t e g o r y D e t e r m in e s - r e n t a l- c h a r g e I n f lu e n c e s - c h a r g e
C le r k
: S y s te m
c o n f ir m M e m b e r s h ip ( m e m b e r I D )
r e c o r d V i d e o R e n t a l( v id e o I D )
m a k e P a y m e n t( a m o u n t)
Contract Name: Responsibilities: Cross References: Preconditions: Postconditions: A VideoRental, vr, was created and initialized. vr was associated with a Video, based on videoID match. vr was associated with the current RentalTransaction. recordVideoRental (videoID) Record the rental of a video and add it to ongoing rental transaction. Present the item title, charge, and due date. Use Case: Renting Videos videoID is known to system. A RentalTransaction has been created.
c o n f i r m M e m b e r s h i p ( m e m b e r s h ip I D )
: R e n tV id e o s H a n d le r
1 : m : = g e t M e m b e r s h ip ( m e m b e r s h i p I D ) : M e m b e r s h ip : V id e o S t o r e
2 : [ is M e m b e r ] c r e a t e ( m )
b y C re a to r
1 . 1 : m : = f in d ( m e m b e r s h i p I D ) : M e m b e r s h ip
: R e n t a lT r a n s a c t io n
2 .1 : c re a te ( )
: V id e o R e n t a l : V id e o R e n t a l
: M e m b e r s h ip
6. Using the recordVideoRental operation contract as a starting hint, complete the UML collaboration diagram. Annotate every message with the GRASP (Expert, Creator, and so on) and/or other pattern that justifies it.
b y C o n t r o ll e r
b y E x p e rt r e t u r n s " n u l l" i f n o t p r e s e n t
r e c o r d V i d e o R e n t a l( v id e o I D )
: R e n t V id e o s H a n d le r
1 : v : = g e t V id e o ( v id e o I D ) : V i d e o
: C a ta lo g
2 : [ v a li d I D ] a d d V i d e o R e n t a l ( v ) b y C re a to r
1 . 1 v : = f in d ( v id e o I D ) : V i d e o
: R e n t a l T r a n s a c t io n
2 .2 : a d d ( v r )
: V id e o
2 .1 : c r e a te ( v ) : V id e o R e n t a l : V id e o R e n t a l
v r : V id e o R e n t a l
V id e o S t o r e
g e t M e m b e r s h i p ( m e m b e r s h ip I D ) : M e m b e r s h i p 1 O f f e r s -r e n t a ls - t o
*
M e m b e r s h ip m e m b e r s h ip I D : S t r in g s ta r tD a te : D a te
10
Evaluation: Motivation
(6 marks) In the approach to analysis and design that has been studied in this course, briefly compare and contrast these two terms. What is analysis about? What is design about?
Analysisinvestigation in order to understand the problem, vocabulary, business rules, and so on. Designa logical (pre-software) solution that fulfills the requirements.
b.
(4 marks) Briefly, what are some motivations for creating 1) conceptual models, and 2) operation contracts?
Conceptual Modelunderstand the vocabulary and the relationship between important concepts. Decompose the problem space in terms of things. Operation ContractsDefine the responsibilities of a system operation. Define the business rules, constraints, and results associated with an operation. Capture in one document much of the relevant detail required to fulfill, in design, the operation.
11