Introduction

You are given a partially built Analysis Class Diagram for a system. Your task is to refine it to a Design Model that specifically supports two use cases, described below.

Scenario of use and use cases

AllMagz Inc is a company which publishes and sells many magazines about current affairs, culture, hobbies and so on. AllMagz has decided to offer subscriptions to consumers via a website. The software system that will run the website will be called AutoSub.

In order to buy a subscription, consumers will need first to register (online) for an online "registered customer" account with AutoSub (AllMagz plan to make extra money by sending advertising mail to registered users). So, after registering once to buy a magazine subscription, they will be able to buy more subscriptions without a boring data entry phase.

The informal requirement document prepared by AllMagz includes the following bullet points detailing some basic use cases:

  • Everyone will have access to a "welcome" web page, from which they can browse a list of magazines and proceed further to buying subscriptions.
  • From the welcome page, they can choose to browse the list of magazines or to register for an online account
  • While browsing the list of magazines, they can select one or more magazines, and at any time click a "purchase" button. They will then be asked to login or, if they are not yet registered, to register and then login.
  • The registration phase requires the customer to enter his/her name, postal address, optional phone number, mandatory Email address, and optionally a credit card number and expiration date, a chosen account name and a password (to be entered twice to verify it). They also have to indicate whether they wish to receive advertisings by post, and/or by Email.
  • Registered users become "customers" and can purchase magazine subscriptions as mentioned above.
  • After registration or purchases, each customer will be sent an Email message with the details of the transaction (registration details, details of subscription) as recorded.
  • Apart from the data held in AutoSub while it is running, a log of all purchases of subscriptions will be held and kept up to date in a database.

This basic design concept, similar to other similar systems, is represented in the basic Use Case diagram shown below (Figure 1). The developers have also sketched a class model, representing the essential classes needed for the scenario described above (Figure 2). The use case model also contains, in addition to the use cases matching the description above, two additional use cases, "RemindOfRenewal" and "RenewSubscription", which support renewals of subscriptions that are close to their end date. The specifications of these two use cases are given below.

Figure 1: Use Case model see image.

Figure 2: Analysis Class Diagram see image.

Use case ID: AutoSub 05 Use case: RemindOfRenewal
Short Description: Once a day, a function supported by the operating system asks AutoSub
to Email reminders to all customers who have subscriptions expiring during the next 4
weeks. AutoSub sends the reminders by Email.
Primary actors: Time
Secondary actors: SMTPserver
Preconditions: AutoSub is operational.
Main flow:
1. The Time actor initiates the use case by calling the
checkAndSendRenewalReminders() method (in the TimerReminder boundary
object)
2. for each subscription due to expire in the next 4 weeks
2.1. AutoSub prepares an Email message that explains the subscription is due to expire
and includes: a URL that the customer can use to renew the subscription; the magazine
name, the cost or a one year renewal and the date the subscription is due to expire.
2.2. AutoSub asks the SMTP server to send this message.
Postconditions:
For each subscription due to expire in less than 4 weeks, a message has been queued on
the SMTP server in the format specified above.
Alternative flows: None
Use case ID: AutoSub 06 Use case: RenewSubscription
Short Description: A customer, through his/her Web browser, confirms he/she wants to renew
a magazine subscription and pays for it.
Primary actors: Customer
Secondary actors: SMTP server, Payment system
Preconditions: AutoSub is operational. The customer is logged in to his/her account and has
reached the page for renewing the subscription to a certain magazine. The customer is
currently subscribed to this magazine
Main flow:
1. The customer clicks one of the boxes listed on the webpage, each one next to a duration of
renewal (e.g. 6, 12, 24 months) and the matching price. (chooseRenewalLength())
2. IF the customer has a non-­‐expired credit card registered in AutoSub
2.1. then
2.1.1. AutoSub asks whether the user wishes to pay with this credit card
(askUseCurrentCreditCard())
2.1.2. the customer clicks on YES or NO
2.1.3. IF the customer clicked NO
2.1.3.1. EXTENSION POINT: EnterCardDetails
2.2. else
2.2.1. EXTENSION POINT: EnterCardDetails
3. AutoSub displays to the Customer a page with all the details of the transaction (title of magazine, the new expiration date of the subscription, and the amount to be charged) and asks the Customer to confirm the purchase (showConfirmationPage())
4. the Customer clicks YES
5. AutoSub asks the PaymentSystem to charge the amount specified to the credit card specified
6. the PaymentSystem confirms that the payment was successful
7. AutoSub displays to the Customer a "receipt page" specifying the same information as at step 3, and stating that the subscription has been renewed, the amount charged to the customer's card, the date and time.
8. AutoSub requests the SMTP server to send the Customer an Email message repeating the contents of the receipt.
Postconditions:
1. The records in AutoSub have changed to include a record of the receipt for this transaction,
and an updated expiry date for this subscription
2. The Payment system has recorded accepting a request for payment matching the amount
and credit card number on the receipt
3. A confirmation message has been queued on the SMTP server
Alternative flow: Customer cancels transaction
Preconditions: The Customer has not yet performed step 4 of the main flow
Alternative flow:
1. The Customer clicks "cancel transaction"
2. AutoSub displays "transaction cancelled"
Postconditions:
The records in AutoSub indicate no change in subscription expiry dates
Alternative flow: Payment not approved
Preconditions: None
Alternative flow:
The flow starts after step 5 of the main flow.
1. The payment system tells AutoSub "payment not approved"
2. AutoSub shows the client a "payment not accepted" message with options to cancel or continue the transaction (showPaymentNotAcceptedAskContinue())
3. If the customer clicks on "continue" then
3.1. the main flow restarts with step 2
Postconditions:
The records in AutoSub indicate no change in subscription expiry dates.
Use case ID: AutoSub 07 Use case: EnterCardDetails
Short Description: A customer enters credit card details and AutoSub records them
Primary actors: Customer
Secondary actors: None
Preconditions: AutoSub is operational. The customer has logged in to his/her account
Main flow:
1. AutoSub presents a form asking for credit card details (number, extra security number,
billing address, expiration date) and a "save" button (askCreditCardDetails())
2. while AutoSub detects unfilled or invalid fields in the form,
2.1. AutoSub highlights the fields yet to be filled or to be corrected
2.2. the Customer types in the details and hits "save".
3. AutoSub returns the Customer to the last previous page.
Postconditions:
The record for this customer in AutoSub indicates the new credit card details entered
Alternative flow: Customer cancels entry of new credit card details
Preconditions: The Customer has not yet hit "save"
Alternative flow:
The Customer clicks "cancel"
AutoSub returns the Customer to the last previous page
Postconditions:
The records in AutoSub indicate no change in the customer's credit card details

Assignment

Your task is to refine the Analysis Model to a Design Model to support the development of the code for the two use cases "RemindOfRenewal" and "Renew". So, you design model must include a Design Class Diagram plus Sequence Diagrams for those two Use Cases and associated extension use cases. More details follow.

Question 1: Class diagram

Refine the Analysis Class Diagram, adding any extra classes, associations, attributes and methods that are necessary. If you think that some existing classes need to be removed, merged etc., explain what you do and why.

You must do the following:

  • Refine all associations, reifying if necessary
  • Provide class-interface pairs for each boundary class
  • add any attributes, operations, constructors and data types that you need for questions 2 and 3
  • where multiple design options are possible (e.g. using an attribute to model composition) justify your choice, in UML notes or in text file that you submit.

Note: to make sure we can identify your changes clearly, please keep the layout of the classes as in the Analysis Diagram that we have given you in figure 1, as far as possible.

Question 2: Use case realization (sequence diagram) for RemindOfRenewal

Produce a UML sequence diagram that realizes this use case. Your diagram should cover all possible branches, loops and alternative flows that are documented in the use case specification provided. Make sure that your sequence diagram is consistent with the use case specifications and with the class diagram you developed. This requires that you cross-check the two and change them in parallel until they are consistent and a good design. Part of Q1 is to add any new operations that might be needed and software like VP helps keep these consistent. Remember that the flow of messages and control between objects (lifelines) must be unbroken. Use UML notes to clarify any parts of your model that needs explanations or on which you wish to comment, and for longer comments use your separate text file.

Part of Q3s sequence diagram is provided see Q3

Question 3: Use case realization (sequence diagram) for RenewSubscription

Produce a UML sequence diagram that realises this use case. Follow the same prescriptions indicated for question 2.

You may use the partial diagram below to help you get started. Remember that the complete diagram must include lifelines for all the entity objects and boundary objects involved in the use case; and must represent the whole use case from beginning to end see image.

Question 4: State Machine

Produce a UML State Machine diagram that describes the behaviour of the Controller object for the RenewSubscription use case. Use one state for each web page shown to the customer, and indicate as actions the messages from the Controller objects and as triggers the messages it receives. Make sure that:

  • for each state, you indicate the response to each possible message that the controller may receive while in that state;
  • if the specification above does not contain all the details necessary to satisfy the previous bullet point, make your own decision, explain very briefly why it makes sense for this system, and represent it in your diagram;
  • this State machine diagram is consistent with your other diagrams, paying special attention to consistency with the Sequence Diagram of Question 3.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.