This tutorial will use a simple bank account business object with some basic business logic for doing deposits, withdrawals, and getting the current balance of the account.
The following is a listing of the AccountBase.java module:
package COM.ibm.jaws.tutorial1; public class AccountBase { protected float balance = 0; public AccountBase() { } public AccountBase(float balance) { this.balance = balance; } public void deposit(float amount) { balance += amount; } public void withdrawal(float amount) { balance -= amount; } public float getBalance() { return balance; } }
The AccountBase business object need not be modified in any way to make the AccountBase object distribution and persistence capable. This enables the business object to be written completely independent of specific object services, an important facet of the Bojangles project.
Bojangles currently requires the initial business object name to end with Base (denoted in red). This is a restriction that may be removed in the future.
An additional requirement of the business object is that it provide a default constructor (denoted in green) that does nothing more than set the fields to a default value.