This use case deals with when a customer returns a DVD to the

advertisement
Workshop 2
Design
Group 4
Máté Lukács
Ion Sircu
Richard Spence
Tomas Rimkus
Contents
Problem Statement ................................................................................................................................. 3
Use Case’s ............................................................................................................................................... 3
Interact with person (CRUD) ............................................................................................................... 3
Use Case Description ...................................................................................................................... 3
System Sequence Diagram.............................................................................................................. 3
Interact with DVD (CRUD) ................................................................................................................... 3
Use Case Description ...................................................................................................................... 3
System Sequence Diagram.............................................................................................................. 3
Loaning a DVD out .............................................................................................................................. 4
Use Case Description ...................................................................................................................... 4
System Sequence Diagram.............................................................................................................. 4
Receiving a DVD back in ...................................................................................................................... 5
Use Case Description ...................................................................................................................... 5
System Sequence Diagram.............................................................................................................. 5
Contracts ................................................................................................................................................. 6
Loaning a DVD ..................................................................................................................................... 6
Returning a DVD.................................................................................................................................. 6
Domain Model ........................................................................................................................................ 7
Consideration of the architecture........................................................................................................... 7
Code Standards ....................................................................................................................................... 7
Testing ..................................................................................................................................................... 8
Test Plan .............................................................................................................................................. 8
Test Conclusion ................................................................................................................................... 9
Source Code ............................................................................................................................................ 9
Problem Statement
We have been given the task of designing a currently half designed DVD Rental system. We were
given several parts of the design and had to finish the rest along with completing the coding of the
program.
Our goals were to fully design the system using what we have learned in previous lessons and then
to implement the design we came up with.
We must use version control software when doing this project and every class must be tested
individually.
Use Case’s
Interact with person (CRUD)
Use Case Description
This use case encompasses all C.R.U.D operations interacting with a person. When referring to
C.R.U.D, we are referring to the possibility to Create, Read, Update and delete objects within a
system. This means that we are talking about four separate operations but cover them all with a
single acronym.
System Sequence Diagram
This SSD was given to us in the Design Workshop hand out.
Interact with DVD (CRUD)
Use Case Description
This use case encompasses all C.R.U.D operations interacting with a person.
System Sequence Diagram
This SSD was given to us in the Design Workshop hand out.
Loaning a DVD out
Use Case Description
Loaning out a DVD requires the user of the system to know several things. Who is loaning the DVD
and which DVD they want to loan. Once the user knows this information they can access the system.
The user starts by inputting the customers ID into the system to retrieve their details, then the user
creates a new loan. From here the system takes over and checks if there are any free copies
available of the requested DVD, if a copy is free it will get the copy’s information. Then a tracking
record is created for the new loan and the loan information passed back to the user (with weather
the copy is in or out).
System Sequence Diagram
Receiving a DVD back in
Use Case Description
This use case deals with when a customer returns a DVD to the collection. It starts by having the user
look up the customer’s details to see if they have in fact loaned the DVD they are trying to return.
The system then updates the tracking record for the copy that is being returned and then tells the
user what has happened.
System Sequence Diagram
Contracts
Loaning a DVD
Operation
loanDvd(Loan Loan)
Use Cases
Loaning a DVD out
Pre-Conditions




Person created
Person added to address book
DVD created
DVD copy created


Loan created
Tracking record created
Post-Conditions
Returning a DVD
Operation
returnDVD(Loan Loan)
Use Cases
Receiving a DVD back in
Pre-Conditions





Person created
Person added to address book
DVD created
DVD copy created
Loan created


Loan removed
Tracking record updated
Post-Conditions
Domain Model
Please find domain model in the image labelled Attachment A.
The domain model is shows each class connected to its containing package. This shows how the
layers connect to each other as well as showing the standard domain model. The TUILayer handles
all user interaction with the program and as such has the most connectivity to other classes. It’s
classes access nearly every other class in the supplication along with the utilities designed to make
actions such as generating ID’s for the loans, DVD’s and other collection items easier.
Our second layer, the Domain layer, houses all of the main classes used to make the program run.
Consideration of the architecture
The structure of the program revolves around two main classes, the AddressBook class and the
Tracking class. These two classes hold the information about each person in the system along with
where each copy is and who has it.
The tracking class is used to keep track of every copy in the system and was created as a central
system to follow which copy goes where and to make sure this data is easily available and constant.
Each person that is created is kept in the AddressBook class, this makes them easily accessible for
use and information lookup by both the user and other classes while keeping them organized.
Most of our design considerations were made before coding started, but as a result of constant
testing, we adjusted as we went along.
Code Standards
We didn’t use any particular standards other than the normal Java naming conventions. Although
we did make sure to comment complex code as to make it easier for the others to help out and
quickly understand what’s going on without having to have another team member go through the
code with them. Also, each coder used the same naming standards for coding methods, attributes
and variables.
Testing
Test Plan
Task
Add a new person
Edit the person’s name
Create a new DVD
Create a new Copy
Loan the new copy out to
the new person
Return the loaned DVD
Delete the copy
Delete the DVD
Delete the person
Comment
This was a fairly simple
operation, finding it in the
menu was straight forward as
was entering the details.
Easily done as long as you know
the persons ID and the exact
name of the field you want to
edit
Another simple operation
which was easy to find as the
menu wasn’t so complicated.
I didn’t have to actually go
through a menu to do this, it
was automatically done when I
created a new DVD.
One of the more complicated
procedures in the system but it
was quite intuitive in that once
items (people and dvd’s) have
been inputted into the system,
they can be chosen from a list
when loaning. This makes the
process a easy to handle and
very easy to see what you are
doing.
A very easy process, again just
choosing from a list and
following the on screen
prompts
This process occurs when a
DVD is deleted
An easy action to complete,
just pick the DVD
Operation worked fine,
although I needed to list the
people in the list to get the ID
of the person I wanted to
delete before I could delete
them.
Result
New person was added to the
system.
Name was changed eventually
after finding out the correct
Field name.
New DVD created.
Already created when creating
a new DVD
A copy of a DVD has been
loaned out to a person.
Loan was removed
Deleted as a result of a DVD
being deleted
DVD was deleted.
Person was deleted.
Test Conclusion
The application worked as intended but had a few flaws that with time could be fixed. The testing
did show us several important bugs that involved recoding certain parts of the program. It also
showed us areas in which we could improve the system.
Source Code
Please find the source code attached as Attachment B.
Download