Operation contracts - Google Code

guitarchanceSoftware and s/w Development

Aug 15, 2012 (5 years and 2 months ago)

269 views

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 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 found it as nice Hierarchy architecture where programmer is clear
where he have to make changes in the case of upgrade application. Maybe therefore t
his
architecture is so common.


Code standards

We use java with NetBeans and BlueJ. We code the methods according the class
diagram(name, parameter list, visibility).


Tests made

Model layer:

No tests were made since it contains only getters(accessors) a
nd setters(mutators). No logic
in it.

Control layer:

CRUD was not tested since it is too simple to test it.

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 bit complicated b
ecause of the connections between
the model layer classes.

Every test was successful!


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

See the
attachements.