Business Driven Software Engineering       

links

Thomas Gschwind photo

Business Driven Software Engineering - EJB Lab


EJB Lab Example

Implement a small banking application with EJB. Our bank provides a session bean that handles all interactions with accounts and customers. The service bean has to provide the following functions:

  • Registration of new customers (registers customer data such as name, password, address, date of birth, gender, nationality, assigns a customer id, etc.). Only bank clerks may invoke this operation.
  • Creation of an account (account number, account name, interest rate, credit limit). Only bank clerks may invoke this operation.
  • Account history. Bank clerks and the account owner may invoke this operation.
  • Withdrawing money from an account and paying money into an account. Only bank clerks may invoke this operation.
  • Transferring money from one account to another account. Bank clerks and the account owner may invoke this operation.
  • Viewing the account history. Bank clerks and the account owner may invoke this operation.
  • Compute the total value of the accounts of a customer. Total income of a customer in the last 12 month. Net change of a customer in the last 12 month. Bank clerks and the account owner may invoke this operation.
  • Closing an account. Bank clerks and the account owner may invoke this operation.

Implement the above functionality with the help of the following JPA entities:

  • Customer: Provides information about a customer (id, name, address, password, etc).
  • Account: Provides information about an account (id/nbr, type, balance, interest rate).
  • Transaction: Provides information about a transaction executed on an account (date, amount, transaction text).

For the implementation of the relationships, use JPA's relationship management. Use suitable relationships for the above beans.

EJB Exercise Addendum

Provide a simple Web Frontend:

  • Not all functionality has to be exposed through this frontend
  • Functionality not exposed through this frontend still should be available through a standalone client
  • If the web frontend can do all the standalone client should be able to do, a simply standalone client is sufficient (just the execution of some simple methods)