Assignment 2, Report
- Category: Level 2, Software Development 2 (C#)
- Published: Thursday, 30 August 2018 10:37
- Hits: 780
CET203 Software Development Assignment 2 (2014/15)
Computing Level 2
I have designed a Media Rental System where subscribed members able to rent different type of medias.
UML Class Diagram
A full size diagram attached to my submission.
Member Class for member properties, like ID, Name, Tel. number, Address, Email, Subscribed date, State (active or passive), Max Media number, Rented Media number and a general list for rented Medias. Constructor for member. ToString method to override message (member ID and Name). Add Media and Return Media functions. Display method to return all member details in a formatted string. Display member’s rented media(s).
Media Class for media properties, like EAN Code. Title, Category, Type (DVD/Blue-Ray), Number of Copies, Available Copies and Rented Times for statistic. General Dictionary for member’s rented Medias. Constructor for media. ToString method to override message (media EAN Code and Title).
Display method to return all media details. Display Borrowers function. Rent and Return media functions for members.
MemberList Class for store members in a general List. Constructor for Member List. Add member to List function. Display function to return all members in a formatted string.
MediaList Class for store Medias in a general List. Constructor for Media List. Add media to List function. Display function to return all Medias in a formatted string.
FormBasedUI Class for a form based user interface to allow to use all system functions. Constructors for properties as, Member List, Media List, Text Report Generator and Serialize File Handler. A filename variable for file handing. Form Load function ask user to generate test data or load from file. It also check active members subscription’s date and if that older than one year set member state to false (passive). Button Click functions for, Search Member in list, Search Media in List, Add Member, Display All Members in list box (refresh), Renew Member Subscription, Member Passivation, Add Media, Display All Medias in a list box (refresh), Rent selected media to selected member, Return selected media from selected member, Generate Text Report (four different type in drop down box), Load system data from file, Save system data to file and Exit from program. It also includes public functions to buttons click actions.
Add New Member class for open a new form to get new member details. Add button Click function to pass all required information to member constructor. Empty fields and number required been checked.
Add New Media class for open a new form to get new media details. Add button Click function to pass all required information to media constructor. Empty fields and number required been checked.
IUserInterface is an interface which provide necessary methods to all other class which implements this interface. These methods are Add Member, Add Media, Rent Media, Return Media, Display All (IDisplay), Generate Text Report (IDisplay), Save Rental System Data and Load Rental System Data.
Text Report Generator Class for write a Member, MemberList, a Media or MediaList objects to a .txt file. File name specified by member ID, media EAN Code, AllMedias or AllMembers. All request information passed through IDisplay interface as an object and selected by type. Files saved to system’s bin/Debug folder.
IDisplay is an interface. This interface is implemented by classes Member, MemberList, Media and MediaList. Each one implements a Display method to display their details on the interface.
MRS Class contains Member and Media Lists for easier serialize or deserialize all data.
Serialize File Handler Class has two methods for Save or Load MRS System Data File.
Exception Classes include two classes. One for handing Already Rented Exception and another for handing Not Rented Exception. This two class throw error messages if selected member already rented selected media or when the selected member not rented selected media.
MRS is a media rental system. Subscribed and active members allowed rent limited number of medias.
When user add a new member or media to system it opens a new form and necessary field will be checked, if they are empty or if only number allowed user get error message.
User can rent or return medias to members. First must select a member or media for this functions or user got a warning message. If member already rented selected media or not rented at return, exceptions send a formatted error message.
To rent a media member must be active. If member breaking the rules user can change state to passive via Member Passivation button.
System also check member’s rented medias number and not allow to rent more medias like their limit.
Subscription time is a calendar year. The system every time when we open it check active members subscription’s date, if it is older than one year set member’s state variable to false (passive) so they don’t allowed to rent any more medias until they renew their subscription. User can renew selected member’s subscription by Renew buttons and system change date to that day and Member’s state to true (active).
All medias has a rented times property which show how many times was rented, to get best-renting medias. System also counting available medias and if user rent or return a media available copies been recalculated. If available copies zero user can’t rent out from that media.
User can search a member to type ID number to search field or a media by EAN code. If a barcode reader connected to hardware easy to manage a large number of medias or members.
Generate text report function allows user to save a report from a member, member list, a media or media list. First user have to select a member or media and choose a type of text report drop down box to use Generate Report button.
Load and Save buttons load or save all data from mrs.dat file which is placed in bin/Debug folder.
Finally there is a MRSTest project which is integrated to application. FileLoadTest do 5 tests as File Exist, File Not Exist, File Saved, File Loaded and Compare Loaded Test. If any test failed user got a specified error message.