Click DVDs “Just click to pick” ___________________________ CS4125 Systems Analysis and Design Chantelle Geoghegan - 0544981 Danielle Frawley- 0545511 BLANK MARKING SCHEME CS4125: Systems Analysis Assignment 1: Semester II, 2008-2009 Name: Chantelle Geoghegan ID: 0544981 Name: Danielle Frawley ID: 0545511 Item Detailed Description Marks Marks Allocated Awarded Sub-total Presentation Total 2 General Presentation Adherence to guidelines i.e. front cover sheet, blank marking scheme, table of contents 4 Narrative Narrative description of business 1 scenario 5 Software Is it linear (Waterfall) or iterative Lifecycle (RUP). 1 Discuss risk management strategy? 6 Project Plan Plan specifying timeline, deliverables, 1 and roles. 7 System System architecture diagram 1 Architecture 8 Requiremen t 9 Analysis Use case diagram(s) and structured 3 use case descriptions(s) Non-functional (quality) attributes 1 Screen shots / report formats 1 Method used to identify candidate 1 classes 3 5 Class diagram with generalisation, composition, multiplicity, dialog, ClickDVDs control, entity, interface classes, etc. 1.5 0.5 Two communication diagram 8 Page 1 Sequence diagram State chart with annotated transition strings 1 1 Entity relationship diagram with cardinality 10 Design Description of an architectural or 3 design pattern that was evaluated. Cannot use MVC, Broker and 1 Singleton. 2 diagram 7 Pattern incorporated into class Refinement of class diagram from analysis to include MVC architectural pattern, and collection classes 1 Refined interaction diagram from analysis with MVC elements 11 Data Fragments to illustrate different dictionary artifacts created during requirements, 1 analysis and design. 12 References 14 Online Week 8: Use cases 1 Assessment Week 10: Class and Communication 1 1 2 Diagrams from analysis phase TOTAL ClickDVDs 30 Page 2 TABLE OF CONTENTS Blank marking scheme ........................................................................................................................................1 Narrative Description ..........................................................................................................................................5 Software Lifecycle Model [1] ............................................................................................................................7 Project Plan and Allocation of Roles .......................................................................................................... 10 System Architecture .......................................................................................................................................... 11 Three-Tier Architecture .............................................................................................................................. 13 Discussion of UML Workbench Used .................................................................................................... 14 Requirements ....................................................................................................................................................... 15 Functional .......................................................................................................................................................... 15 Non-Functional ................................................................................................................................................ 25 Use Case Diagrams......................................................................................................................................... 26 GUI Prototypes ................................................................................................................................................ 29 Staff User Interface Prototypes .............................................................................................. 29 Member User Interface Prototypes ...................................................................................... 30 Analysis.................................................................................................................................................................... 33 CandiDate Objects .......................................................................................................................................... 33 Class Diagram................................................................................................................................................... 34 Sequence Diagram ......................................................................................................................................... 34 Communication Diagram ............................................................................................................................ 37 State Chart ......................................................................................................................................................... 38 Entity Relationship Diagram..................................................................................................................... 39 Design ....................................................................................................................................................................... 40 Architectural Style ......................................................................................................................................... 40 Model-View-Controller Pattern .............................................................................................. 40 State Pattern ................................................................................................................................... 41 Proxy Pattern ................................................................................................................................. 41 ClickDVDs Page 3 Façade Pattern .............................................................................................................. 42 CLASS Diagram including MVC ................................................................................................................ 43 Staff package ..................................................................................................................................................... 44 Member Package ............................................................................................................................................ 45 Cart package ..................................................................................................................................................... 46 Rental Package................................................................................................................................................. 46 Dvd package ...................................................................................................................................................... 47 price package.................................................................................................................................................... 47 Sequence Diagram including MVC ......................................................................................................... 48 Deployment Diagram ................................................................................................................................... 49 Data Dictionary .................................................................................................................................................... 50 References .............................................................................................................................................................. 53 ClickDVDs Page 4 NARRATIVE DESCRIPTION “ClickDvds” is a new company that has created an online shop whereby members can rent DVDs and have them delivered directly to their home. After registering their name and address, customers can browse through a wide selection of DVD titles and place them in a virtual shopping trolley. A maximum of three DVDs can be rented at one time by a single customer. Customers can add and remove DVDs from their shopping trolley or quit without making a purchase. Payment is made by submitting credit card details online. DVDs are dispatched on the day of order and delivery times are usually within 36 hours depending on the customer’s location. Credit cards are debited on the day of dispatch. DVDs must be returned and have arrived in the store by the return date specified when the order was taken. If the DVD has not been returned by this date then an extra charge will be placed on the customer’s account. The customer can extend the rental period after the order has been placed by accessing their online account. This will also place an outstanding charge on the customer’s account if they do not wish to pay on order. Customers will not be able to rent any more DVDs until this charge has been paid. This is how the customer interacts with the system. In order to keep the system up to date there are many sub-systems involved. DVD Management Systems keeps a record of the DVDs that are available to rent as well as the DVDs that are currently rented and the date of return. This is the main subsystem used by the system. Through the website it informs the customer of the DVDs that are available to rent as well as the date when out-of-stock DVDs will be available. This system is also responsible for adding new DVD titles and removing DVD titles that are available to rent from the online store. If the DVD has not been returned by the return date, the system notifies the member management system and updates the member’s cart information. Price Management Systems keeps the prices of DVDs. The price of a DVD depends on the type of DVD rented. For example, New Release movie costs more to rent than a Children’s movie. The types include: New Release, Classic, Children's. Any outstanding payment a customer has is due to a late return or extending the rental time. Credit Card ClickDVDs Page 5 details are stored electronically for relay to the card processing centre when the DVDs are dispatched. Member Management System keeps a record of each member. Only customers that have an account can access the online system. Each member is represented by a membership number. This system is responsible for adding and removing a member as well as updating a member’s details such as the member’s name or address. The member system communicates with the account system to find out whether the customer owes any money. Rental Management System stores the DVDs information. This includes the DVDs name, type, rental period and price. The type, rental period and price can all be changed. The type of DVD may change depending on its release date and intended audience. The rental period is decided by the customer. The price depends on the type and rental period. Each Sub-System must communicate with each other in order to maintain the overall system and keep the information up to date. This results in a well-maintained, easy to use system. ClickDVDs Page 6 SOFTWARE LIFECYCLE MODEL [1] For our System Design software lifecycle model we have chosen to use the Traditional lifecycle, also known as the Waterfall lifecycle Model. The first formal description of the waterfall model is often cited to be an article published in 1970 by Winston W. Royce (1929–1995.) It was developed in the late 60’s to try and produce a systematic approach to engineering. There are 7 individual phases of the Waterfall lifecycle model which are to be followed sequentially. These phases are: System Engineering, Requirements analysis, Design, Construction, Testing, Installation and Maintenance. To follow the waterfall model, one proceeds from one phase to the next in a purely sequential manner and the model maintains that one should move to a phase only when a proceeding phase is completed and perfected. 1. System Engineering: This phase involves firstly identifying the major requirements that the system has The next step after this is to identify those parts of the system which would be best implemented in software, hardware and the components which should be allocated to human participants. In essence this phase of the Waterfall model defines how all the major parts of the system will interact with each other. 2. Requirements Analysis: This phase of the model is used for a more intense gathering of the systems requirements and also for clearly defining each of these requirements. Fact finding techniques are often used for the gathering of requirements and also to aid their analysis. During this phase the objective moves to identify what the system users would require from the software. 3. Design: When the systems requirements are known, then work can begin on determining how best to design and construct a system which fulfils these requirements. The design of the system is first concerned with the specification of the architecture which defines the software components and their relationships. It involves arriving at a balance between conflicting requirements within environment constraints. Human activities can also be included in the design at this phase. 4. Construction: ClickDVDs Page 7 This phase involves turning the completed system design into actual program code. Some of this coding may be automated, and can use different programming languages as well as different database management systems for different areas of the system. 5. Testing: There are several levels of testing performed on the system to ensure that it satisfies user requirements. Components can be tested individually and then as a subsystem. This is then followed by the testing of the whole system together. 6. Installation: After a successful testing phase the system can be transported to the customer for an introduction. The system needs to be introduced carefully to minimize disruption. There should be a contingency plan in place which is appropriate to the level of use. 7. Maintenance: As it is likely that the system will be subject to change over its lifetime, corrections to the software may have to be made at some point. It is also possible that the maintenance phase will be used for implementing aspects of the systems behavior which may not have been done before installation. This may have been due to time constraints etc. Requirements changes may also occur and this will often have to be taken into account during the maintenance stage. Supporting Arguments for the Waterfall Model: Time spent early on in software production can lead to greater economy later on in the software lifecycle; that is, it has been shown many times that a bug found in the early stages of the production lifecycle (such as requirements specification or design) is cheaper, in terms of money, effort and time, to fix than the same bug found later on in the process. A further argument for the waterfall model is that it places emphasis on documentation (such as requirements documents and design documents) as well as source code. In less designed and documented methodologies, should team members leave, much knowledge is lost and may be difficult for a project to recover from. Many prefer the waterfall model for its simple approach and argue that it is more disciplined. The waterfall model provides a structured approach; the model itself progresses linearly through easily understandable and explainable phases and thus is easy to understand. For each design phase in the Waterfall model there are a number of ClickDVDs Page 8 explicitly defined deliverables, which many see as a major justification of this model. These deliverables can be used to monitor productivity and also the quality of activity performed. Criticisms of the Waterfall Model: Many believe that real projects very rarely follow a sequential lifecycle like that of the Waterfall model. Some project phases overlap and certain things may need to be repeated. Others believe that it is impossible, for a project, to get one phase of a software product's lifecycle perfected before moving on to the next phases and learning from them. If clients change their requirements after a design is finished, that design must be modified to accommodate the new requirements, it assumes that designers are able to foresee problem areas without extensive prototyping and at least some investment into implementation. ClickDVDs Page 9 PROJECT PLAN AND ALLOCATION OF ROLES Week Deliverables Allocated to 07 Narrative Description Chantelle Geoghegan 07 Software Lifecycle Danielle Frawley 09 System Architecture Discussion Danielle Frawley Requirements 08 Use Case Descriptions Chantelle Geoghegan & Danielle Frawley 08 Non-Functional Requirements Chantelle Geoghegan & Danielle Frawley 08 GUI Prototypes Chantelle Geoghegan & Danielle Frawley 09 Use Case Diagrams Danielle Frawley Analysis 08 List Candidate Objects Chantelle Geoghegan 09 Communication Diagram Chantelle Geoghegan 09 Sequence Diagram Danielle Frawley 09 State Chart Chantelle Geoghegan 09 Entity Relationship Diagram Chantelle Geoghegan 10 Class Diagram Chantelle Geoghegan Design 11 Class Diagram including MVC, State and Chantelle Geoghegan Facade Patterns 11 Sequence Diagram incl. MVC Danielle Frawley 12 Architectural Style Description Chantelle Geoghegan 12 Data Dictionary Danielle Frawley Extras 12 Use Case using OCL Danielle Frawley 12 Deployment Diagram Danielle Frawley 12 Data Management incl. Proxy Pattern Chantelle Geoghegan ClickDVDs Page 10 SYSTEM ARCHITECTURE There are many integrated parts which make up the Click DVD system. Each part has its own functionality and so the decision was made to separate these parts of the system into their own distinct packages. In order to group these parts, it was essential to look at the different responsibilities of each integrated part. The packages were hence grouped as follows: Member Management Package This package includes everything to manage the Members of Click DVD. It includes a member entity which holds all relevant information for the members account. Staff Management Package This package includes everything needed to manage all the staff who is an employee of Click DVD. All staff details are held in a staff entity class. Rental Management Package The Rental Management Package was created to manage Rentals which can occur at Click DVD. DVD Management Package The DVD Management package was created to manage the DVDs in stock at ClickDVD. DVD details are stored in a DVD entity. Price Management Package The Price Management package includes everything needed to manage the prices of DVDs. The details for prices are stored in three different subclasses of an abstract class Price. Cart Management Package The Cart Management package is used to manage each member’s cart. In the analysis phase the approach decided upon to take was to “Program to interface, not implementation.” This was done because by allowing the system to depend on interfaces instead of the implementation, there is lower dependency between classes. It also allows for implementation to vary. Two other benefits which can be seen from programming to interface not implementation are: Clients remain unaware of the specific types of objects they use, as long as the objects adhere to the interface that clients expect. Clients remain unaware of the classes that implement these objects. Clients only know about the abstract class or classes defining the interface. [4] ClickDVDs Page 11 This concept also allows us to build functional structures but to keep them loose enough for change and reusability. Concrete classes are instantiated, but by using the abstract class interface, (instead of the concrete classes’) flexibility is brought to the implementation. The package diagram below shows the dependencies between each package in the system as well as their respective interfaces. ClickDVDs Page 12 THREE-TIER ARCHITECTURE For the purposes of this project the standard 3 tier architecture is used for the Click DVD store system. The three layers included in the architecture are: Presentation Layer Business Layer Data Layer The implementation of this 3 tier architecture can be seen in the following diagram: ClickDVDs Page 13 DISCUSSION OF UML WORKBENCH USED For this project, “Select Architect”, from the “Solutions Factory” software package was used to create the UML diagrams included in the project. Select Solutions Factory is an integrated set of products and modeling tools for Service and Component based development, design review, requirements management code generation and reuse. It tightly couples component based development and solution assembly. It includes both analysis and design functionality. Select Architect is a feature of Select Solutions Factory and is what was primarily used for creating the UML diagrams in this project. Select Architect is a scalable design environment for pragmatic Business Motivation Modeling (BMM), Business Processing Modeling (BPM), Service and Component Based Development and design, UML and database design. Select Architect is widely recognized and accepted as a consistent innovator in the design tools and modeling tools market. As it was used in this project for the creation of UML diagrams such as sequence, communication, entity and class diagrams, it was essential to become familiar with the features and tools it uses. After these tools were mastered, Select Architect became an essential tool in the completion of this project. ClickDVDs Page 14 REQUIREMENTS FUNCTIONAL Use Case Rent DVD Goal In Context Member Requests to Rent a DVD for specified amount of time for an agreed price. Scope & Context Company, Sub-function Preconditions The customer is a member The DVD is available to be rented The customer has not gone over their limit for Renting DVDs Success End Condition Member has rented the DVD. There is one less DVD available. We have received money for the goods. Failed End Condition We have not given the member the DVD, the correct DVD, or the member has not paid for the DVD Primary, Secondary Member, Administrator, Credit Card Company Actors Trigger Request for Rental Description ClickDVDs Step Action 1 Member requests to rent DVD 2 Verification that member is in system 3 Check DVD is in stock 4 Check Member hasn’t gone over limit 5 Check for outstanding payments 6 Agree Rental Days 7 Member receives DVD 8 Store receives payment for DVD Page 15 Extensions Variations Step Branching Action 2a Customer is not member 2ai Customer is added to system 3a DVD is not in stock 3ai Renegotiate Rental 4a Member has exceeded Rental limit 4ai Order cancelled 5a Member exceeds agreed rental time 5ai Extend Rental Days Step Branching Action 1 Member can order over the web 6 Member receives by post 7 Member pays by card Related Information Rent DVD Priority Top Performance 5 minutes to order instant payment Frequency 100 per day Channels to actors Interactive, Database Open Issues What if credit card is stolen? What if we only have part of the order? Due Date Release 1.0 Super ordinates Find Member, Find DVD Subordinates Add Rental USE CASE: Become Member Description In order to become a member the customer must register their details with the store. Once registered, the customer will receive a membership number which they will use to access the store. Pre-Conditions Post-Conditions Actor Actions System Response The customer is not The customer is a 1. The actor selects 2. Register Details already a member. member and has the “Register” page is displayed. ClickDVDs Page 16 received a button on the home 4. Customer membership page. account is created number. 3. Required fields using the received are filled out and details. The the “Register customer’s Account” button is membership pressed. number is display on screen. Extension None USE CASE: Login Description The customer must enter their membership number and password to login. Pre-Conditions Post-Conditions Actor Actions System Response The customer must The customer has 1. The actor selects 2. The system be a member and logged into the the “Login” button displays the login have a valid system and can now from the home page. membership rent DVDs. page. 4. Login is 3. Actor enters their confirmed and membership redirects the actor number and to the home page. number. password into the required fields and presses the “Confirm Login” button. Alternative Courses Step 4 Login not valid, displays login not valid message. USE CASE: View Account Description The customer views their account details which display their registered information as ClickDVDs Page 17 well as DVDs currently rented and outstanding payments. Pre-Conditions Post-Conditions Actor Actions The customer must The customer’s 1. The actor logs in be a member and account is displayed (use case 2) System Response have a valid 2. The “View 3. The customer’s membership Account” button is account is number. selected. displayed. Extension After step 3 the customer can edit their account details. USE CASE: View Shopping Cart Description The customer can view their shopping cart while browsing for DVDs. The shopping cart displays all DVD which have been added. Pre-Conditions Post-Conditions Actor Actions System Response The customer must The customer’s 1. The actor logs in be a member and shopping is (use case 2) have a valid displayed 2. The “View 3. Displays membership Shopping Cart” shopping cart. number. button is selected. Extension After Step 3 customer can edit shopping cart USE CASE: View Customer Account Description A staff member can view a customer’s account by accessing the members screen and searching for the member by membership number. Pre-Conditions Post-Conditions Actor Actions The staff knows the The customer’s 1. The actor logs in customer account is displayed (use case 2) System Response membership 2. Members tab is 3. Displays Member number. selected. Screen. 4. Membership 5. Members account ClickDVDs Page 18 number is entered is displayed. into the search bar and the “Search” button is pressed. Extension After step 5 staff can edit the members account. USE CASE: Return DVD Description Customer returns DVD within the agreed rental period. Staff updates the DVD quantity information and the customer account. Pre-Conditions Post-Conditions Actor Actions System Response The customer must The customer’s 1. Actor logs in (use have rented a DVD. account does not case 2). The DVD must be hold any late fees 2. Actor selects DVD 3. Displays DVD info returned on or for that DVD. The tab page before the agreed DVD has been 4. Actor searches 5. Displays DVD return date. returned. for DVD by DVD ID information 6. Actor updates 7. Updates quantity quantity to reflect available in Stock returned DVD. Control for selected DVD and updates Customer account with late fee. 8. Actor accesses customers account (use case 5) 9. Returned DVD is 10. Selected DVD is selected for the deleted from the rented list and the customers rented “Returned” button list. is selected. Extension ClickDVDs Page 19 After step 10, if the DVD was returned late the staff can add a late fee to the customer’s account USE CASE: Extend Rental Description The customer can extend the rental period of a currently rented DVD by logging into their members account and extending the rental period. The cost of this extension is then added to the customer’s account. Pre-Conditions Post-Conditions Actor Actions System Response The customer must The customer has 1. Actor views have a DVD extended the rental account (use case 3) currently rented. period for the 2. A DVD currently 3. Select DVD specific DVD. rented is selected. details displayed. 4. Rental period is 5. Extended fee is extended and the added to customer “Update” button is account and the pressed. payment screen is displayed. 6. Customer pays 7. Customers’ extended rental fee account screen is (use case 9) displayed. Extension none USE CASE: Checkout Description After adding DVDs to the shopping cart, the customer then pays for the DVDs by processing to the checkout. Pre-Conditions Post-Conditions Actor Actions The customer must The customer has 1. Actor views be a member. paid for rented shopping cart (use The customer has DVDs and the DVDs case 4). DVDs in the will be dispatched. 2. “Checkout” ClickDVDs System Response 3. Total payment Page 20 shopping cart. button is selected. due displayed. 4. “Pay Now” button selected (use case 9) Extension After Step 3, customer cancels rental. USE CASE: Pay Fees Description Customer pays fees. Pre-Conditions Post-Conditions Actor Actions The customer must The customer no 1. Checkout DVDs be a member. longer has fees on (use case 8) The customer has account. 2. Credit card 3. Credit card details entered and details page “Pay” button displayed. selected. 7. Customers fees to pay System Response account updated to reflect no outstanding fees and customer account displayed. Alternative Course Step 1, access payments screen through extend rental (use case 10). USE CASE: Pay Outstanding Fees Description The customer can pay any outstanding fees obtain by extending rental period or returning DVD after the agreed rental period, by accessing their account. Pre-Conditions Post-Conditions Actor Actions The customer must The customer no 1. Actor views be a member. longer has any account (use case ClickDVDs System Response Page 21 The customer must outstanding 3). 3. Outstanding have outstanding payments. 2. “Pay Outstanding payments total payments on their Fee” button is displayed. account. selected. 5. Customers 4. “Pay Now” button account updated to selected (use case reflect no 9). outstanding fees. Extension none USE CASE: Cancel Membership Description The customer can cancel their membership by logging into the system and selecting delete account from the customer account page. The account is then removed from the customer account system. Pre-Conditions Post-Conditions Actor Actions The customer must The customer is no 1. Actor views be a member. longer a member. account (use case 3) System Response The customer must 2. “Delete 3. Customer have no outstanding Membership” account is deleted payments on their button is pressed. and customer is account. logged out. Extension After Step 2, customer has outstanding fees and is redirected to the payment screen. USE CASE: Delete Member Description A staff member can delete a member’s account by accessing the account and deleting the member. Pre-Conditions ClickDVDs Post-Conditions Actor Actions System Response Page 22 The customer must The member 1. Actor views be a member. The account has been customers account staff must know the deleted. (use case 5). customers’ 2.”Delete Account” 3. Members account membership ID button is selected. is deleted. must be known. Extension: none Pre and Post Conditions OCL: Context: Member Pre: self.memberID exists() Post: self.memberID Empty self.name Empty self.Address Empty self.Phone Empty self.Email Empty self.OwnedCart Empty USE CASE: Add New DVD Title Description A staff member can add a new DVD title to the online store by adding the DVDs details. Pre-Conditions Post-Conditions Actor Actions The DVD must not The new DVD is 1. Actor logs in (use be in the store added to the store. case 2) already. System Response 2. DVD tab is 3. The DVD selected. information screen is displayed. 4. The relevant DVD 5. The new DVD is details into the added to the store. fields provided (Name, Type, ID) and the “Add DVD” button is selected. ClickDVDs Page 23 Extension none USE CASE: Update DVD details Description When more DVD’s arrive to the store or when DVD’s are returned the quantity of the DVD must be updated to reflect the quantity currently in the store. Pre-Conditions Post-Conditions Actor Actions System Response DVD must be The quantity of the 1. Actor logs in (use contained in the DVD has been case 2) system. updated. 2. The actor selects 3. The DVD screen DVD tab. is displayed 4. The actor 5. DVD information searches for the is displayed on DVD by ID. screen. 7. The DVD details 6. The actor edits are updated. the DVD details and selects the “Update” button. Alternative Course Step 6, DVD type can be changed Step 6 DVD quantity can be changed Step 6 DVD can be removed by selecting the remove button. USE CASE: Update Price Description Each type has a fixed price associated with it and this can be changed in the price tab. Pre-Conditions Post-Conditions Actor Actions The type must exist The type price is 1. Actor logs in (use in the system. updated. case 2) ClickDVDs System Response 2. The actor selects 3. The price screen the “Price” tab. is displayed. Page 24 4. The actor selects 5. The price for the the price, edits the selected type is amount and selects updated. the “Update” button. Alternative Course Step 4 The standard rental price is updated. Step 4 The late rental price is updated. Step 4 The extend rental price is updated. Step 4 The type rental price is updated. NON-FUNCTIONAL Non-Functional Requirement Description Availability As the DVD rental system is online it must be available to the customer at all times. Quality The DVD rental system fulfils the customers’ expectations by conforming to the customer’s requirements of renting a DVD online. Reliability The system is reliable as the required databases are backed up nightly in case of a system failure. Scalability The database for system use will often need to be increased in size as more DVD’s are added. For this reason it needs to be easily scalable. Usability As customers utilize this system the user- interface needs to be quite intuitive to use and user friendly. ClickDVDs Page 25 USE CASE DIAGRAMS ClickDVDs Page 26 ClickDVDs Page 27 ClickDVDs Page 28 GUI PROTOTYPES STAFF USER INTERFACE PROTOTYPES Adding, Updating and Deleting Types and Price Details UI Adding, Updating, Viewing and Deleting DVDs UI ClickDVDs Page 29 Adding, Updating, Viewing and Deleting Member Details UI MEMBER USER INTERFACE PROTOTYPES Browse DVDs ClickDVDs Page 30 Create a Rental ClickDVDs Page 31 View Cart ClickDVDs Page 32 ANALYSIS CANDIDATE OBJECTS The noun identification method was chosen to identify the candidate objects. Renting a DVD A customer must first be a member of the store to rent a DVD. When the member logs in, they can browse through a selection of DVDs and add them to a virtual shopping cart. The cart cannot contain more than three rentals at a time. Each DVD is a different price depending on its type and rental period. When the member is satisfied with their selection, the member can proceed to pay for their rentals. Update DVD details A staff member can update a DVD’s details by searching for the DVD on the system. The staff member can then change this information and save the changes. Candidate Objects Member DVD Cart Rental Price ClickDVDs Page 33 CLASS DIAGRAM ClickDVDs Page 34 SEQUENCE DIAGRAM ClickDVDs Page 35 ClickDVDs Page 36 COMMUNICATION DIAGRAM ClickDVDs Page 37 STATE CHART ClickDVDs Page 38 ENTITY RELATIONSHIP DIAGRAM ClickDVDs Page 39 DESIGN ARCHITECTURAL STYLE After examining the class diagram created in the analysis phase, it was clear that a more structured approach should be taken in order to reduce the complexity and dependencies within the system. This involved introducing structural and behavioral patterns. The structural patterns chosen were the Proxy Pattern which was applied to the Data Management package and the façade pattern which was applied to the Entity interfaces. The behavioral pattern chosen was the State Pattern which was applied to the Cart Object. The Model-View-Controller pattern was also applied to the entire system. MODEL-VIEW-CONTROLLER PATTERN INTENT: Support user requirements that are presented through different interface styles and aids maintainability and portability. PROBLEM: The same information should be capable of presentation in different formats in different windows. Changes within one view should be reflected immediately in the other views. Changes in the user interface should be easy to make. Core functionality should be independent of the interface to enable multiple interface styles to co-exist. SOLUTION: Separate the core functionality (model) from the interface and through its incorporation of a mechanism for propagating updates to other views. The interface itself is split into two elements: the output presentation (view) and the input controller (controller). [3] The model-view-controller pattern was applied to the entire class diagram. This grouped the classes into three main components: models that comprise of the main functionality, views that present the user interface and controllers that manage the updates to views. ClickDVDs Page 40 STATE PATTERN INTENT: Allow an object to alter its behavior when it’s internal state changes. The object will appear to change class. PROBLEM: An object exhibits different behavior when its internal state changes, making it appear that the object changes class at runtime. SOLUTION: Separate the state dependant behavior from the original class. [1] The cart object can be in one of four states. These states change dynamically as DVDs are added and removed from the cart. Changing the state of the cart changes the behavior of the object. As the cart has a state dependant behavior it was decided to apply the state pattern to the object. Applying the state pattern to the cart object reduces the amount of if-else statements. It also created a new class for each state which holds a state-specific version of the operations. PROXY PATTERN INTENT: Provides a proxy object as a placeholder for another object until it is required. PROBLEM: The way a persistent objects maintain a reference to other objects. SOLUTION: Use a proxy for each business class to link to where there is an association with another object or objects. [1] A database broker framework was designed to control the data required by the various objects. It purpose is to separate the business objects from the data storage implementation. A broker class was used for every business class that is persistent as it provides the mechanism to materialize and dematerialize objects to and from the database. The proxy pattern was then applied to this framework. The proxy holds a private instance of the real object; clients then execute actions on the proxy which are passed to the real object. The results from the real object are returned to the client via the proxy. ClickDVDs Page 41 FAÇADE PATTERN INTENT: Provide a unified interface to a set of interfaces in a subsystem. Façade defines a higher level interface that makes the system easier to use. PROBLEM: Need to minimize communications and dependencies. SOLUTION: Structuring a system into subsystems helps to reduce complexity and providing a simple interface. [1] The façade pattern was chosen to reduce the complexity of the system. The façade pattern was used with the Model-View-Controller pattern and was applied to the model components. This pattern was implemented by providing an interface that communicates with all subsystem interfaces. The view and the controller then communicate with this interface which reduces the complexity of the overall system. Figure 1 The Façade pattern [3] ClickDVDs Page 42 CLASS DIAGRAM INCLUDING MVC ClickDVDs Page 43 STAFF PACKAGE ClickDVDs Page 44 MEMBER PACKAGE ClickDVDs Page 45 CART PACKAGE RENTAL PACKAGE ClickDVDs Page 46 DVD PACKAGE PRICE PACKAGE ClickDVDs Page 47 SEQUENCE DIAGRAM INCLUDING MVC ClickDVDs Page 48 DEPLOYMENT DIAGRAM The Deployment diagram shows a PC Client which is connected to a server. The Server holds all of the java archive files for the MemberManagement package, Rental Management Package, DVDManagement package, Cart Package, Staff Management package and the PriceManagement package. These are all held on a server as they will all need to be accessed by the customers through means of a browser application which is held in the client (Referred to in the diagram by ClientApplication.jar). The means of connection from client to server is by TCP/IP. ClickDVDs Page 49 DATA DICTIONARY Name: Administrator Type: Actor Description: The Administrator is the role of the staff member uses the system and is responsible for a number of different operations to do with the day to day running of the store. These operations include: 1. Updating the price, genre, type of DVDs there are in store, 2. Adding new DVDs to the system and 3. Deleting DVDs, Members etc. Name: Member Type: Actor Description: The Member represents a member of the store, a customer who can interact with the system and perform various operations such as: Renting DVDs Extending the DVD rental period Browsing for DVDs Name: Credit Card Company Type: Actor Description: The Credit Card Company is an external actor, which deals with the payments from members credit cards for rentals. Name: Rentals Type: Logical Entity Description: The Rental Entity is used to store information about the various Rentals of DVDs that exist. Entity Relationships: Rental is contained in a Cart and requires a DVD. Name: DVD Type: Logical Entity ClickDVDs Page 50 Description: The DVD Entity is used to store information about the various DVD’s that ClickDVD stores. Entity Relationships: DVD has a price and is required by Rental. Name: Cart Type: Logical Entity Description: The Cart Entity is used to store information about the Carts used by the members when choosing DVDs to rent. Entity Relationships: Cart contains Rental, and is owned by a member. Name: CartState Type: Abstract Class Description: The Cart can be in three different states. Active, Full, and Complete. The Cart State abstract class is used to show which methods are implemented in the Active, Full and Complete Classes. Name: isPaid Type: Boolean Description: The isPaid value is set to true when the credit card company validate the credit card payment. When this value is true, the cart state changes to paid. Name: Price Type: Logical Entity Description: The Price is used to store the different prices and points for each DVD. Different types of DVD have different prices. The three different types of DVD are New Release, Regular, and Children’s. Name: Member Type: Logical Entity Description: The Member is used to store information about the various members of ClickDVDs. Such info includes: name address, ID, Phone and Email address. Entity Relationships: Member owns a Cart. Name: ClickDVDs DVDManageable Page 51 Type: Interface Description: The DVDManageable interface provides the functionality needed for the staff to manage the DVDs, for example adding or removing a DVD. Name: DVDViewable Type: Interface Description: The DVDViewable interface provides the functionality needed for the members to view DVDs. Name: RentalCollection Type: Collection Class Description: The RentalCollection class provides a collection of Rentals which can be accessed by the Cart. A Cart contains a collection of Rentals. Name: database [DataManagement] Type: Attribute Description: Used to represent the database which is used to hold the data for use in ClickDvds. Name: MemberManageable Type: Interface Description: The MemberManageable interface provides the functionality needed for the staff to manage the Members, for example, viewing, updating or removing a Member. Name: MemberAccount Type: Interface Description: The MemberAccount interface provides the functionality needed for the members to view their own accounts. Here they can delete their account, view, and update their account. As well as extend rentals currently occurring. ClickDVDs Page 52 REFERENCES 1. Bennett, S., et al. (2006). Object-Orientated Systems Analysis and Design, 3rd Edition. McGraw Hill 2. Fowler, M. (2006). UML DISTILLED THIRD EDITION. Addison-Wesley 3. Gamma, E., et al. (1995). Design Patterns. Addison-Wesley 4. http://www.as3dp.com/2009/02/14/design-pattern-principles-foractionscript-30-program-to-an-interface-not-an-implementation/ Programming to interfaces not implementation. [Accessed 24-04-2009] ClickDVDs Page 53