de.h_da.library.datamanagement.usecase
Interface BookManagement


public interface BookManagement

[usecase] This use case comprises all functionality used by library staff to administer the book stock.


Method Summary
 int addBook(Book bookRecord, int numberOfBooksOnStock)
          [command] Adds a new Book object and numberOfBooksOnStock new BookOnStock objects to the datamanagement component.
 void addBooksOnStock(int bookId, int numberOfBooksOnStock)
          [command] Creates new BookOnStock objects for an existing Book.
 void modifyBook(Book book)
          [command] Modifies an already stored Book object.
 

Method Detail

addBook

int addBook(Book bookRecord,
            int numberOfBooksOnStock)
[command] Adds a new Book object and numberOfBooksOnStock new BookOnStock objects to the datamanagement component.

Parameters:
book - [in] a volatile book object (transfer obejct), not yet stored
numberOfBooksOnStock - [in] number of BookOnStock objects that are to be created
Returns:
[out] the id of the persistent Book object
        [post exists new Book b: b.title.equals(book.title)
         analogous for all attributes of entity Book
         post exist numberOfBookOnStock new instances BookOnStock boS: boS.book.equals(b)
        ]
        
 

addBooksOnStock

void addBooksOnStock(int bookId,
                     int numberOfBooksOnStock)
[command] Creates new BookOnStock objects for an existing Book.

Parameters:
bookId - the id of the Book object for which new BookOnStock objects are to be created
numberOfBooksOnStock - number of BookOnStock objects that are to be created
       [pre exists Book b: b.id == book.id
         post exist numberOfBookOnStock additional instances BookOnStock boS: boS.book.equals(b)
       ]
 

modifyBook

void modifyBook(Book book)
[command] Modifies an already stored Book object.

Parameters:
book - volatile book object (transfer object) with id
        [pre exists Book b: b.id == book.id
         post b.title.equals(book.title) 
         analogous for all attributes of entity Book
        ]