Operation contracts - GoogleCode

guitarchanceΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 5 χρόνια και 7 μέρες)

222 εμφανίσεις

Workshop design

Group 1



WORKSHOP DESIGN

Documentation


Workshop design

Group 1

Design Considerations


While implementing our project we mainly took in consideration the Layered basis
architecture. This allowed us a great deal of flexibility, reduced coupling and improved
cohesion. It was also very
helpful in undertaking our unit testing.




Operation contracts


Contract CO2: update_dvd


Operation:


update_DVD(title: String, director: String, publication_date: Date)

Cross References:

Use Cases: Handling of DVD
-
CRUD

Precondition:


DVD object has

to exist


Postconditions:

-

Dvd values are modified




-

dvd_list was updated






Contract CO4: return_dvd


Operation:


return_dvd(id: long)

Cross References:

Use Case: DVD is returned

Precondition:



Person object must exist;

Dvd object must
exist

Copy object must exist

Loan object must exist



Postconditions:

-

person removed from the loan_list





-

updated loan_list



Contract

CO4: createLoan


Operation: createLoan(person,copy,period)

Use

case: Handling of Loans

Pre condition: Person object must exist;


Dvd object must exist;


Copy object must exist;

Post condition:



A Loan object has been created and values added



Loan object is added to the Loan

List


Workshop design

Group 1

Architecture

We used standard architecture which consist
s

of the three layers:



UI or Presentation Layer



Control Layer



Domain Layer


This architecture is useful especially when we would like to update this program

and
add new features. We believe it is a nice h
ierarchy architecture where

the

p
rogrammer easily
make
s

changes in the case of upgr
ade application. That is probably why

this architecture is so
common.


Code standards

We use java
with NetBeans and BlueJ.
We wrote

the methods according the class diagram

(name, parameter list, visibility).


Tests made

Model layer:

After writing the classes we created an instance of each separate one to test the constructors
and the accessor and mutator methods.

Control laye
r:

CRUD was not tested s
ince we already have done it in the model layer
.

Complex operations were tested:

1.

create loan

2.

return dvd

3.

extend loan period

4.

search methods

5.

delete methods


it is in CRUD but it’s a more complex operation

because of the connections
be
tween the model layer classes

and the control layer classes
.

Our tests included positive testing as well as negative testing.

Every test was successful!


The diagrams are not included into this document because they are too big.

See the
attachements.